I have strange problem with nagios plugin. I got error: Return code of 127 is out of bounds - plugin may be missing.
I google this error and in most cases it is a plugin name error or $USER1$ definition.
In my resources.cfg I have:
Code: Select all
$USER1$=/usr/lib64/nagios/plugins
and this is valid location when I have plugins
Code: Select all
ls -l /usr/lib64/nagios/plugins/
-rwxr-xr-x. 1 root root 53672 May 1 2014 check_apt
-rwxr-xr-x. 1 root root 15944 Jun 10 2014 check_bacula
-rwxr-xr-x. 1 root root 2251 May 1 2014 check_breeze
-rwxr-xr-x. 1 root root 58224 May 1 2014 check_by_ssh
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_clamd -> check_tcp
-rwxr-xr-x. 1 root root 45240 May 1 2014 check_cluster
-rwxr-xr-x. 1 root root 62008 May 1 2014 check_dbi
-rwsr-x---. 1 root nagios 57888 May 1 2014 check_dhcp
-rwxr-xr-x. 1 root root 53840 May 1 2014 check_dig
-rwxr-xr-x. 1 root root 62776 May 1 2014 check_disk
-rwxr-xr-x. 1 root root 9289 May 1 2014 check_disk_smb
-rwxr-xr-x. 1 root root 61968 May 1 2014 check_dns
-rwxr-xr-x. 1 root root 36624 May 1 2014 check_dummy
-rwxr-xr-x. 1 root root 3349 May 1 2014 check_file_age
-rwxr-xr-x. 1 root root 6315 May 1 2014 check_flexlm
-rwsr-x---. 1 root nagios 57888 May 1 2014 check_fping
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_ftp -> check_tcp
-rwxr-xr-x. 1 root root 49488 May 1 2014 check_game
-rwxr-xr-x. 1 root root 53496 May 1 2014 check_hpjd
-rwxr-xr-x. 1 root root 95952 May 1 2014 check_http
-rwsr-x---. 1 root nagios 61512 May 1 2014 check_icmp
-rwsr-x---. 1 root nagios 45440 May 1 2014 check_ide_smart
-rwxr-xr-x. 1 root root 15123 May 1 2014 check_ifoperstatus
-rwxr-xr-x. 1 root root 12600 May 1 2014 check_ifstatus
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_imap -> check_tcp
-rwxr-xr-x. 1 root root 6887 May 1 2014 check_ircd
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_jabber -> check_tcp
-rwxr-xr-x. 1 root root 53896 May 1 2014 check_ldap
lrwxrwxrwx. 1 root root 10 Jun 23 12:02 check_ldaps -> check_ldap
-rwxr-xr-x. 1 root root 15847 May 13 2014 check_linux_bonding
-rwxr-xr-x. 1 root root 49288 May 1 2014 check_load
-rwxr-xr-x. 1 root root 5989 May 1 2014 check_log
-rwxr-xr-x. 1 root root 22366 May 1 2014 check_mailq
-rwxrwxrwx. 1 root root 3128 Jun 30 11:17 check_mem
-rwxr-xr-x. 1 root root 49416 May 1 2014 check_mrtg
-rwxr-xr-x. 1 root root 45192 May 1 2014 check_mrtgtraf
-rwxr-xr-x. 1 root root 58056 May 1 2014 check_mysql
-rwxr-xr-x. 1 root root 53736 May 1 2014 check_mysql_query
-rwxr-xr-x. 1 root root 49328 May 1 2014 check_nagios
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_nntp -> check_tcp
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_nntps -> check_tcp
-rwxrwxrwx. 1 root root 24712 May 1 2014 check_nrpe
-rwxr-xr-x. 1 root root 61856 May 1 2014 check_nt
-rwxr-xr-x. 1 root root 61944 May 1 2014 check_ntp
-rwxr-xr-x. 1 root root 58056 May 1 2014 check_ntp_peer
-rwxr-xr-x. 1 root root 14283 May 1 2014 check_ntp.pl
-rwxr-xr-x. 1 root root 57832 May 1 2014 check_ntp_time
-rwxr-xr-x. 1 root root 69944 May 1 2014 check_nwstat
-rwxr-xr-x. 1 root root 189265 Jul 28 2014 check_openmanage
-rwxr-xr-x. 1 root root 8779 May 1 2014 check_oracle
-rwxr-xr-x. 1 root root 53512 May 1 2014 check_overcr
-rwxr-xr-x. 1 root root 58056 May 1 2014 check_pgsql
-rwxr-xr-x. 1 root root 61984 May 1 2014 check_ping
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_pop -> check_tcp
-rwxr-xr-x. 1 root root 62144 May 1 2014 check_procs
-rwxr-xr-x. 1 root root 53696 May 1 2014 check_radius
-rwxr-xr-x. 1 root root 49520 May 1 2014 check_real
-rwxr-xr-x. 1 root root 9581 May 1 2014 check_rpc
-rwxr-xr-x. 1 root root 1453 May 1 2014 check_sensors
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_simap -> check_tcp
-rwxr-xr-x. 1 root root 70608 May 1 2014 check_smtp
-rwxr-xr-x. 1 root root 79080 May 1 2014 check_snmp
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_spop -> check_tcp
-rwxr-xr-x. 1 root root 49536 May 1 2014 check_ssh
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_ssmtp -> check_tcp
-rwxr-xr-x. 1 root root 45168 May 1 2014 check_swap
-rwxr-xr-x. 1 root root 66504 May 1 2014 check_tcp
-rwxr-xr-x. 1 root root 49496 May 1 2014 check_time
lrwxrwxrwx. 1 root root 9 Jun 23 12:02 check_udp -> check_tcp
-rwxr-xr-x. 1 root root 25226 Feb 12 01:09 check_updates
-rwxr-xr-x. 1 root root 57712 May 1 2014 check_ups
-rwxr-xr-x. 1 root root 45208 May 1 2014 check_uptime
-rwxr-xr-x. 1 root root 40976 May 1 2014 check_users
-rwxr-xr-x. 1 root root 2936 May 1 2014 check_wave
drwxr-xr-x. 2 root root 4096 Feb 7 2014 eventhandlers
-rwxr-xr-x. 1 root root 45248 May 1 2014 negate
-rwxr-xr-x. 1 root root 40928 May 1 2014 urlize
-rw-r--r--. 1 root root 2065 May 1 2014 utils.pm
-rwxr-xr-x. 1 root root 2791 May 1 2014 utils.sh
in commands.cfg I have:
Code: Select all
define command{
command_name check_nrpe
command_line $USER1$/ckeck_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
[root@localhost ~]# /usr/lib64/nagios/plugins/check_nrpe -H 19.0.0.90 -c check_mem
I got result
MEMORY OK : Mem used: 14.29%, Swap used: 0.00% |MemUsed=14.29%;100;100 SwapUsed=0.00%;25;50 MemCached=15.35% SwapCached=0.00% Active=15.25%
so on remote site all is configured properly.
my service definition is:
Code: Select all
define host {
use linux-server
host_name tjdata
alias tjdata
address 19.0.0.90
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
}
define service {
use generic-service
host_name tjdata
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service {
use generic-service
host_name tjdata
service_description SSH
check_command check_ssh
notifications_enabled 0
}
define service {
use generic-service
host_name tjdata
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
define service{
use generic-service
host_name tjdata
service_description Memory Usage
check_command check_nrpe!check_mem
}
define service{
use local-service
host_name tjdata
service_description MySQL service running
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'mariadb.service'
}
define service{
use local-service
host_name tjdata
service_description Root Partition
check_command check_local_disk!20%!10%!/
}
cnetos 7 OS, nagios Core 3.5.1