Re: command not defined
Posted: Fri Dec 06, 2013 4:25 pm
Under xinetd
Support for Nagios products and services
https://support.nagios.com/forum/
There is a line server_args that tells nagios to use the configuration saved in /usr/local/nagios/etc/nrpe.cfg. The other checks that work fine via automatic calling like check_hda1 are not implemented here, too. 194.59.103.56 is the IP address of my nagios server.# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 127.0.0.1 194.59.103.56
}
BUT:***** Nagios *****
Notification Type: PROBLEM
Service: Check Listener
Host: VBGMADB11
Address: 194.59.101.179
State: CRITICAL
Date/Time: Tue Dec 10 03:08:23 CET 2013
Additional Info:
NRPE: Command check_lsnr not defined
Code: Select all
nagios@madpbk51:~> id
uid=200(nagios) gid=200(nagios) Gruppen=200(nagios),210(nagcmd),504(oinstall)
nagios@madpbk51:~> /usr/local/nagios/libexec/check_nrpe -H VBGMADB11 -c check_lsnr
Oracle Listener is working fine.
nagios@madpbk51:~> echo $?
0Code: Select all
[nagios@vbgmadb11 etc]$ id
uid=54322(nagios) gid=54323(nagios) groups=54321(oinstall),54323(nagios)
[nagios@vbgmadb11 etc]$ /usr/local/nagios/libexec/check_nrpe -H localhost -c check_lsnr
Oracle Listener is working fine.
[nagios@vbgmadb11 etc]$ echo $?
0
[nagios@vbgmadb11 etc]$ /usr/local/nagios/libexec/check_listener.bsh
Oracle Listener is working fine.
[nagios@vbgmadb11 etc]$ echo $?
0Code: Select all
yum install mlocate
updatedb
locate nrpe.cfgCode: Select all
ps -aef | grep "nrpe\|xinetd"Code: Select all
service xinetd stop
killall nrpeCode: Select all
ps axuw | grep nrpeCode: Select all
service xinetd startCode: Select all
[root@vbgmadb11 local]# yum install mlocate
Loaded plugins: security
Setting up Install Process
Package mlocate-0.15-1.el5.2.x86_64 already installed and latest version
Nothing to do
[root@vbgmadb11 local]# updatedb &
[1] 544
[root@vbgmadb11 local]#
[1]+ Done updatedb
[root@vbgmadb11 local]# locate nrpe.cfg
/usr/local/nagios/etc/nrpe.cfgCode: Select all
[root@vbgmadb11 local]# ps -aef | grep "nrpe\|xinetd"
root 685 427 0 07:21 pts/0 00:00:00 grep nrpe\|xinetd
root 31835 1 0 Dec09 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
[root@vbgmadb11 local]# service xinetd stop
Stopping xinetd: [ OK ]
[root@vbgmadb11 local]# killall nrpe
nrpe: no process killedCode: Select all
[root@vbgmadb11 local]# ps axuw | grep nrpe
root 825 0.0 0.0 61180 756 pts/0 R+ 07:22 0:00 grep nrpeCode: Select all
[root@vbgmadb11 local]# service xinetd start
Starting xinetd: [ OK ]Code: Select all
[root@vbgmadb11 local]# madpbk51:~ # vi /usr/local/nagios/etc/servers/services.cfg
...
define service{
use generic-service
hostgroup_name DB
host_name !vmacldb92,!vbgmadb71;,!vbgmadb11
service_description Check Listener
contact_groups admins,db-admins
normal_check_interval 60
notification_interval 240
check_command check_nrpe!check_lsnr
}
...
madpbk51:~ # /etc/init.d/nagios stop
Stopping nagios: .done.
madpbk51:~ # /etc/init.d/nagios start
Starting nagios: done.Code: Select all
Dec 11 07:57:26 madpbk51 nagios: Caught SIGTERM, shutting down...
Dec 11 07:57:26 madpbk51 nagios: Successfully shutdown... (PID=32177)
Dec 11 07:57:58 madpbk51 su: (to nagios) root on /dev/pts/0
Dec 11 07:57:58 madpbk51 nagios: Nagios 3.5.0 starting... (PID=3164)
Dec 11 07:57:58 madpbk51 nagios: Local time is Wed Dec 11 07:57:58 CET 2013
Dec 11 07:57:58 madpbk51 nagios: LOG VERSION: 2.0
Dec 11 07:57:58 madpbk51 nagios: Finished daemonizing... (New PID=3165)Code: Select all
/usr/local/nagios/var # tail -f nagios.log
[1386743263] Caught SIGTERM, shutting down...
[1386743263] Successfully shutdown... (PID=2747)
[1386743276] Nagios 3.5.0 starting... (PID=32176)
[1386743276] Local time is Wed Dec 11 07:27:56 CET 2013
[1386743276] LOG VERSION: 2.0
[1386743276] Finished daemonizing... (New PID=32177)
...
[1386744486] SERVICE ALERT: vbgmadb11;Check Listener;CRITICAL;SOFT;1;NRPE: Command 'check_lsnr' not defined
...
[1386744606] SERVICE ALERT: vbgmadb11;Check Listener;CRITICAL;SOFT;2;NRPE: Command 'check_lsnr' not defined
[1386744726] SERVICE ALERT: vbgmadb11;Check Listener;CRITICAL;HARD;3;NRPE: Command 'check_lsnr' not defined
...
[1386744726] SERVICE NOTIFICATION: nagiosadmin;vbgmadb11;Check Listener;CRITICAL;notify-service-by-email;NRPE: Command check_lsnr not definedCode: Select all
Dec 11 07:22:04 vbgmadb11 xinetd[31835]: Exiting...
Dec 11 07:23:21 vbgmadb11 xinetd[947]: xinetd Version 2.3.14 started with libwrap loadavg labeled-networking options compiled in.
Dec 11 07:23:21 vbgmadb11 xinetd[947]: Started working: 1 available service
Dec 11 07:55:31 vbgmadb11 xinetd[947]: START: nrpe pid=4372 from=194.59.103.56
Dec 11 07:55:31 vbgmadb11 nrpe[4372]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Dec 11 07:55:31 vbgmadb11 xinetd[947]: EXIT: nrpe status=0 pid=4372 duration=0(sec)Code: Select all
nagios@madpbk51:~> /usr/local/nagios/libexec/check_nrpe -H vbgmadb11 -c check_lsnr
Oracle Listener is working fine.Code: Select all
madpbk51:/usr/local/nagios/var # ll
total 1772
drwxrwxr-x 2 nagios nagios 4096 Dec 12 00:00 archives
-rw-r--r-- 1 nagios nagios 976 Dec 12 10:07 nagios.debug
-rw-r--r-- 1 nagios nagios 6 Dec 12 10:07 nagios.lock
-rw-r--r-- 1 nagios nagios 100416 Dec 12 10:07 nagios.log
-rw-r--r-- 1 nagios nagios 399468 Dec 12 10:07 objects.cache
-rw------- 1 nagios nagios 635632 Dec 12 10:07 retention.dat
drwxrwsr-x 2 nagios nagcmd 4096 Dec 12 10:07 rw
drwxrwxr-x 3 nagios nagios 4096 Dec 9 13:57 spool