Nagios:...tResult(3)
π NAME π
okay so welcome to the Nagios::Plugin::ExitResult manual page, section 3, coming at you from the User Contributed Perl Documentation besties π
. This class is a helper class for returning both output and return codes when testing. Thatβs the whole NAME vibe: output + return codes, testing time, no cap β¨.
β¨ SYNOPSIS β¨
Hereβs the little code moment, literally copy-paste energy:
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!');
ok so quick translation: in a test file somewhere youβve got Nagios::Plugin::Functions::_fake_exit(1), then later nagios_exit( CRITICAL, 'aiiii ...' ) hands you $e, and you can print $e->message and $e->return_code. Also: NP::ExitResult stringifies to the message output, so that like(nagios_exit( WARNING, 'foobar'), qr/^foo/, 'matches!') match is a slay π.
π¦ DESCRIPTION π¦
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. Itβs giving test-helper main character energy, not full program energy πΈ.
π AUTHOR π
Author credit goes to: Gavin Carr , <gavin@openfusion.com.au> π«Ά.
π COPYRIGHT AND LICENSE π
Copyright (C) 2006 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.
Thatβs the whole page, bestie π. Signing off with perl v5.42.0, dated 2024-03-04, and the Nagios:...tResult(3) footer. Bye bye, go test something iconic πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Nagios-Plugin 0.36-bp160.1.8 Β· Artistic-1.0 or GPL-2.0+
- opensuse-leap 16.0: perl-Nagios-Plugin 0.36-bp160.1.8 Β· Artistic-1.0 or GPL-2.0+
- opensuse-leap 16.0: perl-Nagios-Plugin 0.36-bp160.1.8 Β· Artistic-1.0 or GPL-2.0+
- opensuse-leap 16.0: perl-Nagios-Plugin 0.36-bp160.1.8 Β· Artistic-1.0 or GPL-2.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms