Monitor...hreshold(3)

okay bestie, welcome to the Monitoring::Plugin::Threshold(3) manpage β€” it's a user-contributed Perl doc and literally the internal class for handling thresholds in Monitoring::Plugin. let's get into it πŸ’…

✨ NAME ✨

Monitoring::Plugin::Threshold β€” the iconic class for handling Monitoring::Plugin thresholds. no cap.

πŸ’… SYNOPSIS πŸ’…

real talk: this is an internal Monitoring::Plugin class. if you're looking for the public interfaces, you want to see Monitoring::Plugin itself, iykyk.

here's the whole thing in code form, bestie:

# 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;

so like, set_thresholds is the constructor β€” you pass in warning and critical range strings and it gives you back a threshold object. then get_status($value) checks a value and returns:

  • CRITICAL if it's in the critical range
  • WARNING if it's in the warning range
  • OK otherwise

and the accessors warning and critical return the associated N::P::Range object for each. slay. πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is the internal Monitoring::Plugin class for handling threshold data. again, if you want the public interfaces, go see Monitoring::Plugin. this is just the behind-the-scenes bestie doing the work. 🫢

a threshold object contains (typically) a pair of ranges, associated with a particular severity. like:

warning  => range1
critical => range2

it's giving "two ranges, two severities, one iconic object". periodt. πŸ’–

πŸ‘‘ AUTHOR πŸ‘‘

this code is maintained by the Monitoring Plugin Development Team β€” see https://monitoring-plugins.org for all the deets. they're the real MVPs, fr fr. πŸ”₯

Copyright (C) 2014 by Monitoring Plugin Team

Copyright (C) 2006-2014 by Nagios Plugin Development Team

this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so like, it's free, it's open, it's iconic. ngl, that's a vibe. πŸ’œ


and that's the whole vibe, bestie! this page was served up by perl v5.42.0 on 2018-08-02, and you're reading the Monitor...hreshold(3) manpage. stay slaying βœ¨πŸ’–

πŸ“¦ where this page comes from