logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Monitoring::Plugin::Threshold - class for handling Monitoring::Plugin thresholds.

Author

       This code is maintained by the Monitoring Plugin Development Team: see https://monitoring-plugins.org

Description

       Internal Monitoring::Plugin class for handling threshold data. See Monitoring::Plugin for public
       interfaces.

       A threshold object contains (typically) a pair of ranges, associated with a particular severity e.g.

         warning  => range1
         critical => range2

Name

       Monitoring::Plugin::Threshold - class for handling Monitoring::Plugin thresholds.

Synopsis

           # NB: This is an internal Monitoring::Plugin class.
           # See Monitoring::Plugin itself for public interfaces.

           # Constructor
           $t = Monitoring::Plugin::Threshold->set_thresholds(
               warning  => $warning_range_string,
               critical => $critical_range_string,
           );

           # Value checking - returns CRITICAL if in the critical range,
           # WARNING if in the warning range, and OK otherwise
           $status = $t->get_status($value);

           # Accessors - return the associated N::P::Range object
           $warning_range  = $t->warning;
           $critical_range = $t->critical;

See Also