Munin自定义插件权限被拒绝

时间:2013-05-03 13:48:38

标签: plugins permission-denied munin

我的tomcat应用程序在/ usr / share / tomcat6 / webapps / myApp / munin /下的文件中写入了一些值。这个文件的权限是默认的(tomcat:tomcat所有权)644。我写了一个非常简单的munin插件来读取这些值,它位于/ usr / share / munin / plugins /中。权限有(root:root)755,就像其他插件一样。我还在/ etc / munin / plugins /.

中创建了一个符号链接

如果我使用munin-run myApp_lookuptime,我会获得值,配置和--debug的正确输出。 但是,如果我telnet,它会给我“退出”。 munin-node.log说:

2013/05/03-14:35:08 [30657] Error output from myApp_lookuptime:
2013/05/03-14:35:08 [30657]     /etc/munin/plugins/myApp_lookuptime: line 15: /usr/share/tomcat6/webapps/myApp/munin/myApp.LookupTime.log: Permission denied
2013/05/03-14:35:08 [30657] Service 'myApp_lookuptime' exited with status 1/0.

在/etc/munin/plugin-conf.d/munin-node中,我写道:

[myApp*]
user root
group root

但它仍然失败。从该服务器上的任何虚拟帐户,我能够读取该日志,但仍然munin失败并显示“Permission Denied”错误。我做错了什么?

2 个答案:

答案 0 :(得分:1)

嗯,真的很简单。 SELinux阻止了我的插件。因此,如果您的服务器不公开,请将其关闭,或者如果服务器是公共的,请学会制定规则。

以下是CentOS指南:http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html

之后,我重新启动了,我的插件就像魅力一样。

谢谢你,我。

答案 1 :(得分:0)

在/etc/munin/plugin-conf.d/munin-node中为你的插件设置env.PATH变量,这样它就可以找到所有可执行文件。

请参阅 http://munin-monitoring.org/wiki/faq#Q:Whydoesapluginworkwithmunin-runbutnotinmunin-node