Monitoring::Plugin::ExitResult(3pm)

Monitoring::Plugin::ExitResult3pm

Helper class for returning both output and return codes when testing.

Usage

    use Test::More;
    use Monitoring::Plugin::Functions;
    # In a test file somewhere
    Monitoring::Plugin::Functions::_fake_exit(1);
    # Later ...
    $e = plugin_exit( CRITICAL, 'aiiii ...' );
    print $e->message;
    print $e->return_code;
    # MP::ExitResult also stringifies to the message output
    like(plugin_exit( WARNING, 'foobar'), qr/^foo/, 'matches!');

Overview

Monitoring::Plugin::ExitResult is a tiny helper class intended for use when testing other Monitoring::Plugin modules. A Monitoring::Plugin::ExitResult object is returned by plugin_exit() and friends when Monitoring::Plugin::Functions::_fake_exit has been set, instead of doing a conventional print + exit.

Releases

5 releases since Debian 9 (Stretch); the text changed 1 time.

  1. 9
  2. 10–13

Author

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

Originally:
Gavin Carr , <[email protected]>

From libmonitoring-plugin-perl 0.40-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.