Dear Sir, I am writing to thank you for your letter and say,
On 06/12/06, Ciro Iriarte <[EMAIL PROTECTED]> wrote: > Hi, i'm running nagios 2.5 with various perl scripts, just added > check_snmp_int.pl (http://www.manubulon.com/nagios/snmp_int.html) to the > mix, but i'm getting some ePN error when it gives CRITICAL status (it could > be a coincidence) > > Output: > Serial2:DOWN: 1 int NOK : CRITICAL**ePN > /usr/lib/nagios/plugins/check_snmp_int.pl: "Use of uninitialized value in > join or string at /usr/sbin/p1.pl line 72,". > > According to the output, it's the TIEHANDLE sub > > 70: sub TIEHANDLE { > 71: my ($class) = @_; > 72: my $me = ''; > 73: bless \$me, $class; > 74:} > > Is this a problem with ePN (what i think, because of the output) or with the > script? If it is ePN, it certainly isn't in the TIEHANDLE sub (which only runs when ePN loads - once when Nagios starts). It's unimpressive that the error is so poorly reported. The problem is almost certainly with plugin. What I think is happening is that what the plugin writes (to STDOUT) when it reports a CRITICAL, contains some undefined values (when the plugin calls print, the tied file handle results in the p1.pl PRINT sub being called. All PRINT does is concatenate all the args into a string and append it to the tied object). (here's a demo [EMAIL PROTECTED] standardise_router_configs]$ cat x #!/usr/bin/perl -w use strict ; my @x = (undef, 1, undef, 2) ; print join(" ", @x), "\n" ; [EMAIL PROTECTED] standardise_router_configs]$ perl x Use of uninitialized value in join or string at x line 7. Use of uninitialized value in join or string at x line 7. 1 2 [EMAIL PROTECTED] standardise_router_configs]$ ) If you can simulate or reproduce the event that causes the problem, try to inspect the values of the variables that the plugin outputs before it exits with the CRITICAL. You should see the problem - but it will be reported differently - with or without ePN. ePN could and maybe should be modified to not die when print is called with undef elements. On the other hand, Perl with strict always complains and since ePN alwats runs with strict, you see the complaints (assuming that is really the cause of the problem). HTH, Yours sincerely. > > Thanks in advanced > Ciro > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Nagios-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagios-users ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. ::: Messages without supporting info will risk being sent to /dev/null
