There is an issue while a customized check_script was made ready to run a particular application command and process the output.
Below are the details.
Logapp root:/usr/local/nagios/libexec 2$ /usr/local/nagios/libexec/check_nrpe -V
Code: Select all
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 3.0.1
Last Modified: 09-08-2016
License: GPL v2 with exemptions (-l for more info)
check_watchque:
Code: Select all
#!/bin/bash
/<Path to application>/watchqueue 1 ##(--> this command is not executed while using check_nrpe )
if [ `/bin/cat /tmp/watchqueue_1.txt | /bin/grep shm | /usr/bin/head -1 | /bin/awk '{print $7}' | /bin/sed 's/(//g;s/)//g'` -ge `/bin/date +%s` ]
then
MsgRate=`/bin/cat /tmp/watchqueue_1.txt | /bin/grep 'Total UDP Messages' | /bin/awk '{print $9}' | /bin/sed 's/(//g'`
/bin/echo "Ok: Message rate is $MsgRate | $MsgRate"
exit 0
else
/bin/echo "Critical: File /tmp/watchqueue_1.txt is not generated with current time"
exit 2
fi
nrpe.cfg configuration:
Code: Select all
log_facility=daemon
debug=0
pid_file=/usr/local/nagios/var/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1,X.X.X.X
dont_blame_nrpe=1
allow_bash_command_substitution=1
command_timeout=60
connection_timeout=300
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10%
command[check_watchque]=/usr/local/nagios/libexec/check_watchque
Command execution output:
From nagios user:
(Below is appropriate output)
Code: Select all
Logapp nagios:~ 0$ /usr/local/nagios/libexec/check_watchque
Ok: Message rate is 0 | 0
Code: Select all
Logapp nagios:~ 0$ /usr/local/nagios/libexec/check_nrpe -H localhost -c check_watchque
Critical: File /tmp/watchqueue_1.txt is not generated with current time
Code: Select all
Logapp root:/usr/local/nagios/libexec 130$ /usr/local/nagios/libexec/check_nrpe -H localhost -c check_watchque
Critical: File /tmp/watchqueue_1.txt is not generated with current time
Thanks for investing your time for viewing issue.
BR//