简体   繁体   English

Munin自定义插件权限被拒绝

[英]Munin custom plugin Permission Denied

My tomcat application writes some value in a file under /usr/share/tomcat6/webapps/myApp/munin/. 我的tomcat应用程序在/ usr / share / tomcat6 / webapps / myApp / munin /下的文件中写入一些值。 Permissions on this file are default (tomcat:tomcat ownership) 644. I wrote a very simple munin plugin to read those value, and it stands in /usr/share/munin/plugins/. 该文件的权限是默认权限(tomcat:tomcat所有权)644。我编写了一个非常简单的munin插件来读取这些值,它位于/ usr / share / munin / plugins /中。 Permissions there are (root:root) 755, like the other plugins. 像其他插件一样,具有(root:root)755的权限。 I also made a symlink in /etc/munin/plugins/. 我还在/ etc / munin / plugins /中创建了一个符号链接。

If I use munin-run myApp_lookuptime, I get proper output for values, config and --debug. 如果我使用munin-run myApp_lookuptime,则将获得正确的值,config和--debug输出。 However, if I telnet, it gives me "Bad exit". 但是,如果我远程登录,它会给我“不良出口”。 munin-node.log says: 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.

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

[myApp*]
user root
group root

But it still fails. 但是它仍然失败。 From any dummy account on this server, I'm able to read that log, but still munin fails with "Permission Denied" error. 从该服务器上的任何虚拟帐户,我都可以读取该日志,但是munin仍然失败,并显示“ Permission Denied”错误。 What am I doing wrong? 我究竟做错了什么?

Well, it was simple really. 好吧,真的很简单。 SELinux was blocking my plugins. SELinux阻止了我的插件。 So, either turn it off if your server is not public or learn to make rules if the server is public. 因此,如果您的服务器不公开,则将其关闭;如果服务器是公开的,则应学习制定规则。

Here is a guide for CentOS: http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html 这是CentOS的指南: http : //www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html

After that, I rebooted, and my plugins worked like a charm. 在那之后,我重新启动,并且我的插件像个魅力一样发挥了作用。

Thank you, me. 谢谢我

Setting env.PATH variable for your plugin in /etc/munin/plugin-conf.d/munin-node so it can find all executables did the trick for me. 在/etc/munin/plugin-conf.d/munin-node中为您的插件设置env.PATH变量,以便它可以找到所有可执行文件,这对我来说很成功。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM