如何解决Icinga2 以退出代码 128 终止,输出:execvpe(python /usr/lib64/nagios/plugins/check_yum.py) 失败:没有这样的文件或目录
# ls -l /usr/lib64/nagios/plugins/check_yum.py
-rw-r--r--. 1 root root 29861 02-20 13:51 /usr/lib64/nagios/plugins/check_yum.py
并且手动运行正常:
# python /usr/lib64/nagios/plugins/check_yum.py -t 50
YUM OK: 0 Security Updates Available. 39 Non-Security Updates Available | security_updates_available=0 non_security_updates_available=39 total_updates_available=39
但在 webdashboard 中我看到:
execvpe(python /usr/lib64/nagios/plugins/check_yum.py) Failed: No such file or directory
Icinga2 登录客户端:
[2021-02-20 13:54:42 +0100] warning/PluginCheckTask: Check command for object 'backup.mydomain.tld' (PID: 12025,arguments: 'python /usr/lib64/nagios/plugins/check_yum.py' '-t' '50') terminated with exit code 128,output: execvpe(python /usr/lib64/nagios/plugins/check_yum.py) Failed: No such file or directory
服务器配置:
apply Service "yum"{
check_command = "check_yum.py"
check_interval = 12h
retry_interval = 1h
command_endpoint = host.vars.client_endpoint
assign where host.vars.distro == "RHEL"
}
object CheckCommand "check_yum.py" {
command = ["python " + PluginDir + "/check_yum.py" ]
arguments = {
"-t" = "$yum_timeout$"
}
vars.yum_timeout = 70
}
object Host "backup.mydomain.tld" {
check_command = "hostalive"
address = "xx.xx.xx.xx"
vars.client_endpoint = name //follows the convention that host name == endpoint name
vars.procs_warning = "1050"
vars.procs_critical = "1200"
vars.distro = "RHEL"
有什么想法吗?
//编辑 问题出在 PATH 中,将命令更改为:
command = [ PluginDir + "/check_yum.py" ]
解决问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。