From f05979b75c181690d1cafb79cf78c6096f1ead5d Mon Sep 17 00:00:00 2001 From: Gavin Carr Date: Mon, 18 Dec 2006 23:33:48 +0000 Subject: Expand MESSAGE METHODS docs in Nagios::Plugin. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1551 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/lib/Nagios/Plugin.pm b/lib/Nagios/Plugin.pm index 23d8450..576322b 100644 --- a/lib/Nagios/Plugin.pm +++ b/lib/Nagios/Plugin.pm @@ -535,7 +535,19 @@ EXPERIMENTAL AND SUBJECT TO CHANGE add_messages and check_messages are higher-level convenience methods to add and then check a set of messages, returning an appropriate return code -and/or result message. +and/or result message. They are equivalent to maintaining a set of @critical, +@warning, and and @ok message arrays (add_message), and then doing a final +if test (check_message) like this: + + if (@critical) { + nagios_exit( CRITICAL, join(' ', @critical) ); + } + elsif (@warning) { + nagios_exit( WARNING, join(' ', @warning) ); + } + else { + nagios_exit( OK, join(' ', @ok) ); + } =over 4 -- cgit v0.10-9-g596f