The used plugin is the "official" one unaltered.
On the Nagios server side logs:
Code: Select all
[1406800743.128670] [2048.1] [pid=25278] Done. Final output: ''/usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks 20% 10%''
[1406800743.128673] [2048.1] [pid=25278] **** END MACRO PROCESSING *************
[1406800743.128718] [016.1] [pid=25278] Check result output will be written to '/var/log/nagios/spool/checkresults/checkoET2Gt' (fd=7)
[1406800743.128937] [016.2] [pid=25278] Service check is executing in child process (pid=25496)
[1406800743.131941] [016.2] [pid=25496] Moving temp check result file '/var/log/nagios/spool/checkresults/checkoET2Gt' to queue file '/var/log/nagios/spool/checkresults/cgcNt6M'...
[1406800752.135130] [016.0] [pid=25278] Starting to reap check results.
[1406800752.135189] [016.1] [pid=25278] Starting to read check result queue '/var/log/nagios/spool/checkresults'...
[1406800752.135220] [016.1] [pid=25278] Processing check result file: '/var/log/nagios/spool/checkresults/cgcNt6M'
[1406800752.135361] [016.2] [pid=25278] Found a check result (#1) to handle...
[1406800752.135373] [016.1] [pid=25278] Handling check result for service 'Disk usage' on host '10.27.128.81'...
[1406800752.135378] [016.0] [pid=25278] ** Handling check result for service 'Disk usage' on host '10.27.128.81'...
[1406800752.135382] [016.1] [pid=25278] HOST: 10.27.128.81, SERVICE: Disk usage, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: Yes, RETURN CODE: 127, OUTPUT: (null)
[1406800752.135454] [016.2] [pid=25278] ST: HARD CA: 3 MA: 3 CS: 2 LS: 2 LHS: 2
[1406800752.135460] [016.1] [pid=25278] Service is in a non-OK state!
[1406800752.135464] [016.1] [pid=25278] Host is currently UP, so we'll recheck its state to make sure...
[1406800752.135468] [016.1] [pid=25278] * Using last known host state: 0
Code: Select all
Jul 26 00:14:07 elukancompute nrpe[10027]: Connection from 10.27.128.80 port 7555
Jul 26 00:14:07 elukancompute nrpe[10027]: Host address is in allowed_hosts
Jul 26 00:14:07 elukancompute nrpe[10027]: Handling the connection...
Jul 26 00:14:07 elukancompute nrpe[10027]: Host is asking for command 'check_all_disks' to be run...
Jul 26 00:14:07 elukancompute nrpe[10027]: Running command: /usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/vda
Jul 26 00:14:07 elukancompute nrpe[10027]: Command completed with return code 0 and output: DISK OK - free space: / 8135 MB
(85% inode=92%);| /=1377MB;7960;8955;0;9951
Jul 26 00:14:07 elukancompute nrpe[10027]: Return Code: 0, Output: DISK OK - free space: / 8135 MB (85% inode=92%);| /=1377M
B;7960;8955;0;9951
Jul 26 00:14:07 elukancompute nrpe[10027]: [30B blob data]
Code: Select all
Disk usage CRITICAL 07-31-2014 13:09:03 1d 1h 52m 46s 3/3 (Return code of 127 is out of bounds - plugin may be missing)
Code: Select all
# /usr/lib64/nagios/plugins/check_nrpe -H 10.27.128.81 -c check_all_disks\!20%\!10%
DISK OK - free space: / 8135 MB (85% inode=92%);| /=1377MB;7960;8955;0;9951
Code: Select all
# su -c "/usr/lib64/nagios/plugins/check_nrpe -H localhost -c check_all_disks\!20%\!10% " nrpe
DISK OK - free space: / 8135 MB (85% inode=92%);| /=1377MB;7960;8955;0;9951
Code: Select all
# cat /etc/nagios/check_omat
#!/bin/sh
#if [ ! -e /etc/nagios/outfile.txt ]
#then
#touch /etc/nagios/outfile.txt
#fi
echo $1 $2 $3 $4 $5 $6 $7 $8 > /etc/nagios/outfile.txt
echo SERVICE STATUS: OK
exit 0
Code: Select all
# tail /etc/nagios/nrpe.cfg
include_dir=/etc/nrpe.d/
command[check_all_disks]=/usr/lib64/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p /dev/vda
command[check_load]=/usr/lib64/nagios/plugins/check_load -w 60% -c 80%
command[check_users]=/usr/lib64/nagios/plugins/check_users -w 10 -c 20
command[df_var]=df /var/ | sed -re 's/.* ([0-9]+)%.*/\1/' | grep -E '^[0-9]'
command[check_swap]=/usr/lib64/nagios/plugins/check_swap -w $ARG1$ -c $ARG2$
command[load5]=cut /proc/loadavg -f 1 -d " "
command[xinetd]=/usr/lib64/nagios/plugins/check_procs -c 1: -a xinetd
command[httpd]=/usr/lib64/nagios/plugins/check_procs -c 1: -a httpd
command[check_omat]=/etc/nagios/check_omat -w $ARG1$ -c $ARG2$
Code: Select all
# /usr/lib64/nagios/plugins/check_nrpe -H localhost -c check_omat\!20%\!10%
NRPE: Unable to read output
Code: Select all
# su -c "/etc/nagios/check_omat 20% 10% 2>/dev/null" nrpe
SERVICE STATUS: OK