Nagios::Plugin::ExitResult(3pm)

Nagios::Plugin::ExitResult3pm

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

Usage

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

Overview

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

Releases

3 releases since Debian 6.0 (Squeeze); the text changed 1 time.

  1. 6.0
  2. 7–8

Author

Gavin Carr , <[email protected]>

From libnagios-plugin-perl 0.36-1 in Debian 8 (Jessie). Parsed by carta from the page's man source.