[Nagiosplug-devel] Perl Plugin - Output

Thomas Guyot-Sionnest dermoth at aei.ca
Fri Feb 4 06:26:23 CET 2011


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

On 11-02-03 02:24 PM, Claudio M. Llanca wrote:
> Hi Guys, well, this is my fist post in this list. :)
> 
> So here is my doubt.
> 
> I'm using nagios perl module, to create a set of monitors to check for
> specific application metrics on my company's client.
> 
> For that I'm using perl and the nagios perl module Nagios::Plugin .
> 
> The problem seems to be the exit structure of the performance data, as
> you can see in my example, each value are separated using double
> semi-colon , instead of a single. like the following link shows.
> 
> http://nagios.sourceforge.net/docs/3_0/pluginapi.html
> 
> OUTPUT :
> 
> WWW RESPONSES OK | 20x=94.71%;; 30x=5.00%;; 40x=0.28%;; 50x=0.00%;;
> 
> So I've found the following line on Performance.pm (part of the nagios
> plugin module)
> 
> Nagios/Plugin/Performance.pm
> 
>  # Previous implementation omitted trailing ;; - do we need this?
>  $out =~ s/;;$//;
> 
> So .. my question is, that output is still valid for nagios ?

Yes, but you shouldn't have to do that. In fact, there's a number of
semicolon for additional performance data, and each additional part is
optional as well as the ; (if there's is no more parts).

see:
http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN201

The spec is:

'label'=value[UOM];[warn];[crit];[min];[max]

so for example if you have only max to show, it will look like:
20x=94.71%;;;;100

But if you really want to remove any extra trailing semicolon, you can do:

$out =~ s/;+(\s|$)/$1/g;

Or keep the last one:

$out =~ s/;+(\s|$)/;$1/g;

This shouldn't affect performance data parsers at all.

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

iEYEARECAAYFAk1LjfUACgkQ6dZ+Kt5BchY5cQCgjiPhK7Eob9v5owaRyQ9sfnJD
7RQAoLFkutH9ZjPtoI6NBj1ISQneFlLS
=BZUt
-----END PGP SIGNATURE-----




More information about the Devel mailing list