Page 1 of 1

Return code of 127 for check of service 'PING'

Posted: Tue Nov 24, 2015 10:16 am
by gersangreal
Hi everyone! I installed nagios on Centos 6.7 from repository and configured it. But it don't work. I receive warning messages:

Warning: Return code of 127 for check of host 'gate' was out of bounds. Make sure the plugin you're trying to run actually exists.
Warning: Return code of 127 for check of service 'PING' on host 'gate' was out of bounds. Make sure the plugin you're trying to run actually exists.
Warning: Return code of 127 for check of service 'PING' on host 'bigkiev' was out of bounds. Make sure the plugin you're trying to run actually exists.
Warning: Return code of 127 for check of service 'PING' on host 'gate' was out of bounds. Make sure the plugin you're trying to run actually exists.
Warning: Return code of 127 for check of host 'bigkiev' was out of bounds. Make sure the plugin you're trying to run actually exists.
Warning: Return code of 127 for check of service 'PING' on host 'bigkiev' was out of bounds. Make sure the plugin you're trying to run actually exists.

I checked plugins, they are exist. I try to run it from command line:
[root@gate nagios]# /usr/lib64/nagios/plugins/check_ping -H 192.168.0.25 -w 100.0,80% -c 500.0,100% -p 2
PING OK - Packet loss = 0%, RTA = 0.26 ms|rta=0.265000ms;100.000000;500.000000;0.000000 pl=0%;80;100;0
It works fine... Please help me :cry:
I checked plugins permission. This is what it shows:

[root@gate plugins]# ls -l
total 2812
-rwxr-xr-x 1 root root 2251 Sep 11 21:05 check_breeze
-rwxr-xr-x 1 root root 66632 Sep 11 21:06 check_by_ssh
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_clamd -> check_tcp
-rwxr-xr-x 1 root root 50008 Sep 11 21:06 check_cluster
-rwsr-x--- 1 root nagios 64976 Sep 11 21:06 check_dhcp
-rwxr-xr-x 1 root root 62272 Sep 11 21:06 check_dig
-rwxr-xr-x 1 root root 70104 Sep 11 21:06 check_disk
-rwxr-xr-x 1 root root 9289 Sep 11 21:05 check_disk_smb
-rwxr-xr-x 1 root root 71560 Sep 11 21:06 check_dns
-rwxr-xr-x 1 root root 35360 Sep 11 21:06 check_dummy
-rwxr-xr-x 1 root root 3349 Sep 11 21:05 check_file_age
-rwxr-xr-x 1 root root 6315 Sep 11 21:05 check_flexlm
-rwsr-x--- 1 root nagios 64608 Sep 11 21:06 check_fping
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_ftp -> check_tcp
-rwxr-xr-x 1 root root 54464 Sep 11 21:06 check_game
-rwxr-xr-x 1 root root 61848 Sep 11 21:06 check_hpjd
-rwxr-xr-x 1 root root 140696 Sep 11 21:06 check_http
-rwsr-x--- 1 root nagios 69696 Sep 11 21:06 check_icmp
-rwsr-x--- 1 root nagios 53360 Sep 11 21:06 check_ide_smart
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_imap -> check_tcp
-rwxr-xr-x 1 root root 6887 Sep 11 21:05 check_ircd
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_jabber -> check_tcp
-rwxr-xr-x 1 root root 63440 Sep 11 21:06 check_ldap
lrwxrwxrwx 1 root root 10 Nov 23 17:57 check_ldaps -> check_ldap
-rwxr-xr-x 1 root root 54424 Sep 11 21:06 check_load
-rwxr-xr-x 1 root root 5989 Sep 11 21:05 check_log
-rwxr-xr-x 1 root root 21480 Sep 11 21:05 check_mailq
-rwxr-xr-x 1 root root 53464 Sep 11 21:06 check_mrtg
-rwxr-xr-x 1 root root 53200 Sep 11 21:06 check_mrtgtraf
-rwxr-xr-x 1 root root 78744 Sep 11 21:06 check_mysql
-rwxr-xr-x 1 root root 73728 Sep 11 21:06 check_mysql_query
-rwxr-xr-x 1 root root 54928 Sep 11 21:06 check_nagios
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_nntp -> check_tcp
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_nntps -> check_tcp
-rwxr-xr-x 1 root root 29680 Sep 19 00:56 check_nrpe
-rwxr-xr-x 1 root root 69904 Sep 11 21:06 check_nt
-rwxr-xr-x 1 root root 67096 Sep 11 21:06 check_ntp
-rwxr-xr-x 1 root root 66328 Sep 11 21:06 check_ntp_peer
-rwxr-xr-x 1 root root 14283 Sep 11 21:05 check_ntp.pl
-rwxr-xr-x 1 root root 62968 Sep 11 21:06 check_ntp_time
-rwxr-xr-x 1 root root 78248 Sep 11 21:06 check_nwstat
-rwxr-xr-x 1 root root 8779 Sep 11 21:05 check_oracle
-rwxr-xr-x 1 root root 59448 Sep 11 21:06 check_overcr
-rwxr-xr-x 1 root root 72960 Sep 11 21:06 check_pgsql
-rwxr-xr-x 1 root root 68184 Sep 11 21:06 check_ping
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_pop -> check_tcp
-rwxr-xr-x 1 root root 66352 Sep 11 21:06 check_procs
-rwxr-xr-x 1 root root 58696 Sep 11 21:06 check_real
-rwxr-xr-x 1 root root 9581 Sep 11 21:05 check_rpc
-rwxr-xr-x 1 root root 1453 Sep 11 21:05 check_sensors
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_simap -> check_tcp
-rwxr-xr-x 1 root root 89048 Sep 11 21:06 check_smtp
-rwxr-xr-x 1 root root 109680 Sep 11 21:06 check_snmp
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_spop -> check_tcp
-rwxr-xr-x 1 root root 56488 Sep 11 21:06 check_ssh
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_ssmtp -> check_tcp
-rwxr-xr-x 1 root root 52440 Sep 11 21:06 check_swap
-rwxr-xr-x 1 root root 80048 Sep 11 21:06 check_tcp
-rwxr-xr-x 1 root root 57704 Sep 11 21:06 check_time
lrwxrwxrwx 1 root root 9 Nov 23 17:57 check_udp -> check_tcp
-rwxr-xr-x 1 root root 63560 Sep 11 21:06 check_ups
-rwxr-xr-x 1 root root 48168 Sep 11 21:06 check_users
-rwxr-xr-x 1 root root 2936 Sep 11 21:05 check_wave
drwxr-xr-x 2 root root 4096 Aug 31 2013 eventhandlers
-rwxr-xr-x 1 root root 49376 Sep 11 21:06 negate
-rwxr-xr-x 1 root root 46352 Sep 11 21:06 urlize
-rw-r--r-- 1 root root 2065 Sep 11 21:05 utils.pm
-rwxr-xr-x 1 root root 2791 Sep 11 21:05 utils.sh

I'll appreciate any help!!!

Re: Return code of 127 for check of service 'PING'

Posted: Tue Nov 24, 2015 10:32 am
by hsmith
Can you post your service definition for one of these failing checks?

Re: Return code of 127 for check of service 'PING'

Posted: Tue Nov 24, 2015 10:46 am
by gersangreal
hsmith wrote:Can you post your service definition for one of these failing checks?
I have just one service:

define service {
<------>use<---><------><------><------>linux-service
<------>host_name<-----><------><------>bigkiev
<------>service_description<---><------>PING
<------>check_command<-><------><------>check_ping!300.0,20%!500.0,60%
<------>}

Re: Return code of 127 for check of service 'PING'

Posted: Tue Nov 24, 2015 11:11 am
by rkennedy
Can you also post the host definition for the host bigkiev?

Re: Return code of 127 for check of service 'PING'

Posted: Tue Nov 24, 2015 11:15 am
by gersangreal
rkennedy wrote:Can you also post the host definition for the host bigkiev?
This my host definition:
define host {<->
<------>use<---><------><------>office-linux-server
<------>host_name bigkiev
<------>address><------><------>198.168.0.25
<------>check_period<--><------>24x7
<------>check_interval<><------>5
<------>retry_interval<><------>1
<------>max_check_attempts<---->10
<------>check_command<-><------>check-host-alive
<------>notification_period<--->workhours
<------>notification_interval<->30
<------>contact_groups<><------>admins
<------>register<------><------>1
<------>}

and this my check-host-alive command definition:

# 'check-host-alive' command definition
define command{
command_name check-host-alive
command_line /usr/lib64/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5
}

Re: Return code of 127 for check of service 'PING'

Posted: Tue Nov 24, 2015 12:25 pm
by rkennedy
I believe this is a permissions issue.

To verify, can you try running the following commands and post the result -

Code: Select all

su nagios
/usr/lib64/nagios/plugins/check_ping -H 192.168.0.25 -w 100.0,80% -c 500.0,100% -p 2

Re: Return code of 127 for check of service 'PING'

Posted: Wed Nov 25, 2015 2:30 am
by gersangreal
rkennedy wrote:I believe this is a permissions issue.

To verify, can you try running the following commands and post the result -

Code: Select all

su nagios
/usr/lib64/nagios/plugins/check_ping -H 192.168.0.25 -w 100.0,80% -c 500.0,100% -p 2
I tried to do that you wrote, but I have some issue. When I'm trying to do
su nagios
I received this result
This account is currently not available.
but user nagios exists
id nagios
uid=497(nagios) gid=497(nagios) groups=497(nagios)
I checked file /etc/passwd and find there this row:
nagios:x:497:497::/var/spool/nagios:/sbin/nologin
I think I can't do su nagios, because it was created without shell /bin/bash.

Re: Return code of 127 for check of service 'PING'

Posted: Wed Nov 25, 2015 5:11 am
by gersangreal
Thank you, rkennedy! I solved my issue. I found out I had wrong permissions on directory /bin. I set permissions 755 and it fixed my nagios.
Thanks man!!!

Re: Return code of 127 for check of service 'PING'

Posted: Wed Nov 25, 2015 10:21 am
by rkennedy
You're welcome. Glad to see this worked! I'll close this thread out now, but feel free to open another one if you ever need assistance in the future.