The format of the thresholds, which was discussed in 24.1.5 Specifying thresholds, page 557, is not easy to parse, which is why the functions from the module
Nagios::Plugin are a welcome help:
$np->set_thresholds( warning ⇒ $warn_threshold, critical ⇒ $crit_threshold, ); $result = $np->check_threshold($size); $np->nagios_exit($result, "check size: $size kByte");
set_thresholds has the task of setting the thresholds for the
$crit_threshold contain the details that the user passed on to the options
--critical on the command line.
check_threshold compares the thresholds with the total size of the directory in
$size and stores the return code in the variable ...