Return code of 127 is out of bounds - plugin may be missing
Posted: Tue Mar 03, 2015 8:40 am
hi everyone,
I have tested the following script in ruby in command line:
And it works:
but when i add this service on nagios xi, i receive the following error:
(Return code of 127 is out of bounds - plugin may be missing)
nagios.log
file permission
Obs: I looked other threads, but i didnt found any solution.
I have tested the following script in ruby in command line:
Code: Select all
#!/usr/bin/env ruby
used_space=`df -h / | grep -v "Filesystem" | awk '{print $5}'`
case used_space.chomp <=> "85%"
when -1
puts "OK - #{used_space.chomp!} of disk space used."
exit 0
when 0
puts "WARNING - #{used_space.chomp!} of disk space used."
exit 1
when 1
puts "CRITICAL - #{used_space.chomp!} of disk space used."
exit 2
else
puts "UNKNOWN - #{used_space.chomp!} of disk space used."
exit 3
end
Code: Select all
[root@teste libexec]# ./check_teste.rb
OK - 15% of disk space used.(Return code of 127 is out of bounds - plugin may be missing)
nagios.log
Code: Select all
[1425389629] Warning: Return code of 127 for check of service 'teste' on host 'DOUAI' was out of bounds. Make sure the plugin you're trying to run actually exists.Code: Select all
[root@teste libexec]# ls -la check_teste.rb
-rwxr-xr-x 1 root nagios 432 Mar 3 10:36 check_teste.rb
[root@teste libexec]# pwd
/usr/local/nagios/libexec