ping plugin - no output
Tedman Eng
teng at dataway.com
Wed Sep 22 07:55:37 CEST 2004
Just a few problems here....
$ARG2 has no closing $ in your definition
Your script does not pass on an exit code. Nagios does not actually care
about the text output, it reads the exit code emitted by the command.
See: http://nagiosplug.sourceforge.net/developer-guidelines.html
I'm not certain how Nagios handles single quotes '' in relation to insertion
of $variables$, but you might need to change them to double quotes "" in the
definition.
Why are you capturing the output and then echoing it again?
Just do:
$1|tail -1
Furthermore,
What does the output of check_ping to the host look like?
What is the exit code of check_ping to this host?
-----Original Message-----
From: James Green [mailto:james.green at stealthnet.net]
Sent: Tuesday, September 21, 2004 10:33 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] ping plugin - no output
Hi
Due to one of my machines bizarrely giving weird error messages at random:
jmkg at m1:/etc/nagios$ ping xxx.xxx.xxx.xxx
PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) from xxx.xxx.xxx.xxx : 56(84)
bytes of data.
64 bytes from xxx.xxx.xxx.xxx: icmp_seq=1 ttl=254 time=0.412 ms
WARNING: failed to install socket filter
: Protocol not available
64 bytes from xxx.xxx.xxx.xxx: icmp_seq=2 ttl=254 time=0.258 ms
64 bytes from xxx.xxx.xxx.xxx: icmp_seq=3 ttl=254 time=0.314 ms
64 bytes from xxx.xxx.xxx.xxx: icmp_seq=4 ttl=254 time=0.370 ms
64 bytes from xxx.xxx.xxx.xxx: icmp_seq=5 ttl=254 time=0.301 ms
--- xxx.xxx.xxx.xxx ping statistics ---
5 packets transmitted, 5 received, 0% loss, time 4047ms
rtt min/avg/max/mdev = 0.258/0.331/0.412/0.054 ms
I built a simple wrapper script, thus:
#!/bin/bash
output=`$1|tail -1`
echo $output
Which works rather well at the command line:
jmkg at m1:/etc/nagios$ /opt/nagios/libexec/check_ping_stealthnet
'/opt/nagios/libexec/check_ping -H xxx.xxx.xxx.xxx -w 10,10% -c 20,20%
-p 10'
Packet loss = 0%, RTA = 0.34 ms
And within the checkcommands.cfg:
define command {
command_name check_ping_int
command_line
/opt/nagios/libexec/check_ping_stealthnet
'/opt/nagios/libexec/check_ping -H $ARG3$ -w $ARG1$ -c $ARG2 -p 10'
}
Yet within nagios it reports a critical situation, with "No output!" as
the result.
I have no idea why. Can anyone offer some advice please?
Many thanks!
--
James Green
Systems Administrator, StealthNET Ltd, www.stealthnet.co.uk
Tel: 0870 800 1777 Intl: +44 1493 660066 Fax: 0870 135 1069
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue.
::: Messages without supporting info will risk being sent to /dev/null
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list