O'Reilly logo

Nagios, 2nd Edition by Wolfgang Barth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

25.5 Displaying Performance Data

Displaying performance data with Nagios::Plugin is just as simple as processing thresholds. All you need to do is run the function add_perfdata with a few parameters, and the rest is handled by nagios_exit automatically:

$np->add_perfdata(
   label ⇒ "size",
   value ⇒ $size,
   uom ⇒ "kB",
   threshold ⇒ $np->threshold(),
);

The parameter label defines the name of the variable. value contains the measured value, uom defines the unit of measurements, in this case KB. threshold expects a threshold object, which is generated with the function threshold(). The thresholds must already have been set, with set_thresholds.

The output is shown automatically when nagios_exit is run, provided that the performance data were defined before ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required