NAME
Nagios::Plugin::Performance - Performance information in a perl object
SYNOPSIS
use Nagios::Plugin::Performance;
@p = Nagios::Plugin::Performance->parse_perfstring("/=382MB;15264;15269;; /var=218MB;9443;9448");
if (@p) {
print "1st label = ", $p[0]->label, $/;
print "1st uom = ", $p[0]->uom, $/;
print "2nd crit = ", $p[1]->threshold->critical, $/;
} else {
print "Cannot parse",$/;
}
DESCRIPTION
Handles common Nagios Plugin performance data. This has a public interface because it could be used by performance graphing routines, such as nagiostat (http://nagiostat.sourceforge.net), perfparse (http://perfparse.sourceforge.net), nagiosgraph (http://nagiosgraph.sourceforge.net) or NagiosGrapher (http://www.nagiosexchange.org/NagiosGrapher.84.0.html).
Once the performance string has been parsed, you can query the label, value, uom, or thresholds.
CLASS METHODS
- Nagios::Plugin::Performance->parse_perfstring($string)
-
Returns an array of Nagios::Plugin::Performance objects based on the string entered. If there is an error parsing the string, an empty array is returned.
OBJECT METHODS
- label, value, uom, min, max
-
These all return scalars. min and max are not well supported yet.
- rrdlabel
-
Returns a label that can be used for the dataset name of an RRD, ie, between 1-19 characters long with characters [a-zA-Z0-9_].
There is no guarantee that multiple N:P:Performance objects will have unique rrdlabels.
- threshold
-
This returns a Nagios::Plugin::Threshold object.
SEE ALSO
Nagios::Plugin for information about versioning.
http://nagiosplug.sourceforge.net
AUTHOR
This code is maintained by the Nagios Plugin Development Team: http://nagiosplug.sourceforge.net
COPYRIGHT AND LICENSE
Copyright (C) 2006 Nagios Plugin Development Team
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.