[Nagiosplug-devel] [ nagiosplug-Bugs-2902089 ] Move nagios_die out of N::P::Thresholds

SourceForge.net noreply at sourceforge.net
Sun Nov 22 21:25:04 CET 2009


Bugs item #2902089, was opened at 2009-11-22 17:18
Message generated for change (Comment added) made by datamuc
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2902089&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interface (example)
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: DaTa (datamuc)
Assigned to: Nobody/Anonymous (nobody)
Summary: Move nagios_die out of N::P::Thresholds

Initial Comment:
N::P::Thresholds uses nagios_die. This is suboptimal for using
that Class in other Projects. Though one can set
N::P::F::_use_die, but then $@ contains get_shortname and a
STATUS_TEXT, which feels odd.

----------------------------------------------------------------------

>Comment By: DaTa (datamuc)
Date: 2009-11-22 21:25

Message:
That's the point, nagios_die only uses die, if
$Nagios::Plugin::Functions::_use_die is true, otherwise it calls
nagios_exit. And when you do that, $@ contains get_shortname and a
STATUS_TEXT.

i.e.: Nagios::Plugin:Thresholds->new(warning => 'x:y'); throws
"NAGIOS-PLUGIN-01 UNKNOWN - Cannot parse warning range: 'x:y'". IMHO, it
should die with "Cannot parse warning range: 'x:y'" without
"NAGIOS-PLUGIN01 UNKNOWN -". This should be added as late as possible.

This is what my patch does. Well, it's just my opinion. Close with "Wont
Fix" if it's not your point of view.

----------------------------------------------------------------------

Comment By: Thomas Guyot-Sionnest (dermoth)
Date: 2009-11-22 17:29

Message:
Can't you just trap it? IIRC nagios_die uses die() to terminate the
program, and die can be trapped with  $SIG{__DIE__}.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2902089&group_id=29880




More information about the Devel mailing list