<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I've had a thought - does overriding die cause a problem with embedded perl? Design-wise, Nagios::Plugin should play nicely with embedded perl.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>Ton</DIV><DIV><BR><DIV><DIV>On 31 Aug 2006, at 20:36, Lawrence, Lynne wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV dir="ltr" align="left"> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">I believe that if you put the signal handler in the BEGIN{} block of Nagios::Plugin it will take effect when the class is loaded with the 'use' statement, even before object creation:</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2"></FONT></DEFANGHTML_SPAN> </DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">package Nagios::Plugin;</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">use strict;</FONT></DEFANGHTML_SPAN></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><DEFANGHTML_SPAN class="674253017-31082006"></DEFANGHTML_SPAN></DEFANGHTML_SPAN> </DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">our %STAT=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);</FONT></DEFANGHTML_SPAN></FONT></DEFANGHTML_SPAN></FONT></DEFANGHTML_SPAN></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2"><DEFANGHTML_SPAN class="674253017-31082006"></DEFANGHTML_SPAN></FONT></DEFANGHTML_SPAN></FONT></DEFANGHTML_SPAN></DEFANGHTML_SPAN> </DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">BEGIN { <FONT size="2">$SIG{__DIE__} = sub { die_exit(@_) }; }</FONT></FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">.</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">.</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">.</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">sub die_exit {</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">    my $fmt = shift;</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">    printf("Execution Error: " . $fmt, @_);<BR>    exit($STAT{UNKNOWN},);</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">}</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2"></FONT></DEFANGHTML_SPAN> </DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2">This way users would not have to include it in plugin scripts.</FONT></DEFANGHTML_SPAN></DIV> <DIV dir="ltr" align="left"><DEFANGHTML_SPAN class="674253017-31082006"><FONT face="Arial" size="2"></FONT></DEFANGHTML_SPAN> </DIV> </DIV></BLOCKQUOTE></DIV><DIV><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV><BR class="khtml-block-placeholder"></DIV><DIV><A href="http://www.altinity.com">http://www.altinity.com</A></DIV><DIV>T: +44 (0)870 787 9243</DIV><DIV>F: +44 (0)845 280 1725</DIV><DIV>Skype: tonvoon</DIV></SPAN></SPAN></SPAN></SPAN></SPAN><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></DIV></BODY></HTML>