New plugin produces (null) output
Posted: Thu Apr 07, 2011 2:19 am
I have a new installation of FAN (Fully Automated Nagios) and I have created a small shell script to check the latency between two hosts in a remote network. The script is located in /usr/lib/nagios/plugins and looks like this:
also, under /etc/nagios/objects/command.cfg I have the following entry
and in /etc/nagios/objects/servers.cfg
I would expect this to give me the latency between remote_server and the switches, but only returns (null) on the web interface. Am I doing something very stupid that I have not noticed?
Regards,
Inspector Gadget
Code: Select all
#!/bin/bash
ssh root@remote_server ping -c 1 $1 | awk '{ print $7 }'| grep -i time > tmp_latency
cat tmp_latency | while read line
do
echo ${line:5}
done
exit 0
Code: Select all
define command{
name check_lat
command_name check_lat
command_line /usr/lib/nagios/plugins/check_lat.sh -H $HOSTADDRESS$
}
Code: Select all
define service{
use generic-service
host_name switch4.domain.com,switch7.domain.com
service_description Latency
check_command check_lat
normal_check_interval 5
retry_check_interval 1
}
Regards,
Inspector Gadget