Icinga2 以退出代码 128 终止,输出:execvpe(python /usr/lib64/nagios/plugins/check_yum.py) 失败:没有这样的文件或目录

问题描述

Icinga2 看不到检查文件,但文件存在:

# 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 (将#修改为@)