[Nagiosplug-devel] Plugin results not displaying correctly in nagios

Thomas Guyot-Sionnest dermoth at aei.ca
Tue Nov 23 04:08:58 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10-11-19 01:44 PM, Rick Garland wrote:
> Hi all:
>  
> Got Nagios 3.0.3 running on RHEL5.5
>  
> I made a shell script to dynamically look for and check the IF traffic
> rate.
> It is looking for /^bond/ || /^eth/ out of the netstat -i output
>  
[...]
>  
> If I omit the perf data, the results are displayed correctly. Here is
> sample output from nagios;
> 
>     Status Information:    bond0 receive=276/min transmit=132/min
>                                     eth0 receive=264/min transmit=132/min
>                                     eth1 receive=12/min transmit=0/min
>     Performance Data:
>  
>  
> If I include perf data, I get the following output in nagios;
>  
>     Status Information:    bond0 receive=276/min transmit=132/min
>                                     eth0 receive=264/min transmit=132/min
>     Performance Data:    bond0 276;;;; 132;;;; eth0 264;;;; 132;;;;
> *eth1 receive=12/min transmit=0/min*|eth1 12;;;; 0;;;;
>  
>     In the Perf Data are the results for eth1, which should be on the
> Status line.

If you look at the nagios documentation, the plugin output is explained
as (roughly) this (optional parts in brackets ( [] ):

v1/v2 format:

plugin output [ | perfdata ]

v3 format:

plugin output [ | perfdata ]
extended output
...
extended output [ | perfdata ]

Nagios v3 adds the extended output (which was originally limited to one
line). In the extended output, the first encountered | is the start of
the perfdata string and everything else that follows is perfdata. If you
print a perfdata on each line everything past the 2nd line is taken as
perfdata.

You could just print all perfdata after all output lines have been printed.

- -- 
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzrMEIACgkQ6dZ+Kt5BchbYvwCgppXB62SAtIbKVT601hoi1GPU
cksAoN3+7b5Nl3/HG7dRutGFvfdMhoPl
=ui/9
-----END PGP SIGNATURE-----




More information about the Devel mailing list