Return code of 127; executing script/pluggin
Posted: Fri May 03, 2019 1:47 pm
I have added a script check_bw.sh to the /usr/local/nagios/libexec/ folder, made sure it matches the other plugin rights with 'chmod 755'.
When I execute it from a command line "/usr/local/nagios/libexec/check_bw.sh -H 10.32.255.1 -b 1000000000 -v 2c -m input -C public -i ethernet1/1/24 -p 15" I get the response I expected " Current input bandwidth usage is 0.267 Mb/s, 0% used".
When trying to use it as command in a my_bw_check.cfg file I get the message "Return code of 127 is out of bounds. Check if plugin exists"
The path to the my_bw_check.cfg file has been added in the nagios.cfg "cfg_dir=/usr/local/nagios/etc/objects/services". The my_bw_check.cfg file is:
define host{
use generic-switch
host_name stl-core-sw
alias STL-CORE-SW
address 10.32.255.1
hostgroups avpn_switches
}
define hostgroup{
hostgroup_name avpn_switches
alias HSB Switch AVPN
}
define service{
use generic-service
host_name stl-core-sw
service_description CHECK BANDWIDTH
check_command check_bw.sh!stl-core-sw!100!v2!input!public!ethernet1/1/24!30
check_interval 2
retry_interval 1
}
Can you think of any reason why the command runs from a command line but throws a 127 out of bounds when I run it in a my_bw_check.cfg file?
When I execute it from a command line "/usr/local/nagios/libexec/check_bw.sh -H 10.32.255.1 -b 1000000000 -v 2c -m input -C public -i ethernet1/1/24 -p 15" I get the response I expected " Current input bandwidth usage is 0.267 Mb/s, 0% used".
When trying to use it as command in a my_bw_check.cfg file I get the message "Return code of 127 is out of bounds. Check if plugin exists"
The path to the my_bw_check.cfg file has been added in the nagios.cfg "cfg_dir=/usr/local/nagios/etc/objects/services". The my_bw_check.cfg file is:
define host{
use generic-switch
host_name stl-core-sw
alias STL-CORE-SW
address 10.32.255.1
hostgroups avpn_switches
}
define hostgroup{
hostgroup_name avpn_switches
alias HSB Switch AVPN
}
define service{
use generic-service
host_name stl-core-sw
service_description CHECK BANDWIDTH
check_command check_bw.sh!stl-core-sw!100!v2!input!public!ethernet1/1/24!30
check_interval 2
retry_interval 1
}
Can you think of any reason why the command runs from a command line but throws a 127 out of bounds when I run it in a my_bw_check.cfg file?