Nagios2 and check_apc_ups_snmp plugin error
Marcin Wasilewski
marcinwasilewski at poczta.onet.pl
Tue Jun 6 10:40:25 CEST 2006
Hello,
I have some problems with this plugin in Nagios2. On Nagios1 it was running
ok, but after moving to Nagios2 it returns such status:
Current Status: UNKNOWN
Status Information:**ePN failed to compile
/usr/lib/nagios/plugins/check_apc_ups_snmp: "Global symbol "$versionopt"
requires explicit package name at (eval 9) line 44,
Performance Data:Global symbol "$versionopt" requires explicit package name
at (eval 9) line 51.
I don't know PERL and I have no idea what should I correct to get this
working...
Below is a part of the check_apc_ups_snmp script so maybe some of You could
help me?
Best regards
Marcin
#! /usr/bin/perl -w
#
# (c)2003 Peter Radcliffe.
# Released under the BSD Licence.
#
# Check the status of an APC(tm) UPS via SNMP.
#
require 5.004;
use POSIX;
#use diagnostics;
#use strict;
use Net::SNMP;
use Getopt::Long;
use lib "/usr/lib/nagios/plugins";
use utils qw($TIMEOUT %ERRORS &support);
my $PROGNAME="check_apc_ups_snmp";
my $VERSION="0.02";
sub print_help ();
sub print_usage ();
sub print_local_version ();
#$ENV{'PATH'}='';
$ENV{'BASH_ENV'}='';
$ENV{'ENV'}='';
# defaults
my $community="public";
my $port="161";
my $battcaperror="80";
my $batttemperror="38";
my $battstatgood="2";
my $outputstatgood="2";
my $battreplacegood="1";
my $outvoltlow="235";
my $outvolthigh="245";
my $loadhigh="45";
my $runtimelow="200";
Getopt::Long::Configure ("bundling");
GetOptions(
"V" => \$versionopt, "version" => \$versionopt,
"h" => \$help, "help" => \$help,
"c=s" => \$community, "community=s" => \$community,
"p=i" => \$port, "port=i" => \$port,
"r=i" => \$runtimelow, "runtimelow=i" => \$runtimelow,
"l=i" => \$loadhigh, "loadhigh=i" => \$loadhigh,
"H=s" => \$hostname, "hostname=s" => \$hostname,
"battcaperror=i" => \$battcaperror,
"batttemperror=i" => \$batttemperror,
"battstatgood=i" => \$battstatgood,
"outputstatgood=i" => \$outputstatgood,
"battreplacegood=i" => \$battreplacegood,
"outvoltlow=i" => \$outvoltlow,
"outvolthigh=i" => \$outvolthigh
);
if ($versionopt) {
print_local_version;
exit $ERRORS{'UNKNOWN'};
}
if ($help) {
print_help();
exit $ERRORS{'UNKNOWN'};
}
.........
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
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
More information about the Users
mailing list