为了监控Mailman邮件列表,我已经将check_mailman_qfiles插件添加到Icinga主机。
只有主机名作为参数,手动运行时插件工作正常:
user@icinga:~$ /usr/lib/nagios/plugins/check_mailman_qfiles mail.example.com all normal
但是,当作为Icinga的一部分定期运行时,插件会抱怨它不能统计“归档”,即qfiles目录中的第一个文件:
Notification Type: PROBLEM Service: Mailman Host: example.com mail server Address: 10.1.2.3 State: UNKNOWN Date/Time: Fri Jun 26 16:09:16 PDT 2015 Additional Info: **ePN /usr/lib/nagios/plugins/check_mailman_qfiles: Cant stat /usr/local/mailman/qfiles/archive: No such file or directory
最初我以为是因为我从shell运行手动命令,而nagios用户的shell是/ bin / false。 但是我试着用nagios(暂时)使用bash,并且命令作为nagios用户运行正常。
还有什么会导致插件自动运行时失败?
我在mailman命令,服务和主机组定义下面粘贴了一个链接到插件。
此外,这是对Debian wheezy运行的Icinga 1.7.1-7。 谢谢!
命令定义,来自/etc/icinga/commands.cfg:
define command{ command_name check_mailman_qfiles command_line $USER1$/check_mailman_qfiles $ARG1$ }
服务定义,来自/etc/icinga/objects/services_icinga.cfg:
define service{ service_description Mailman use generic-service hostgroup_name mailman-servers is_volatile 0 check_period 24x7 max_check_attempts 3 normal_check_interval 3 retry_check_interval 1 contact_groups admins notification_interval 120 notification_period 24x7 notification_options w,u,c,r check_command check_mailman_qfiles }
主机组定义,来自/etc/icinga/objects/hostgroups_icinga.cfg:
define hostgroup{ hostgroup_name mailman-servers ; The name of the hostgroup alias Mailman servers ; Long name of the group members mail.example.com }
插件位于https://exchange.nagios.org/directory/Plugins/Email-and-Groupware/Mailman/check_mailman_qfiles/details
你的问题是embedded式Perl解释器(ePN =embedded式Perl)。 这个插件可能不是(显然不是)ePN安全的。
全局禁用它(因为它有可怕的内存泄漏),或者根据文档禁用该脚本 。
此外,您的检查命令应该是check_mailman_qfiles!mail.example.com以匹配您的手动testing。