Bug fix : if ($return_result !~ /^[0-9]$/) =>if ($return_result !~ /^[0-9]+$/)

git-svn-id: http://svn.centreon.com/trunk/plugins@3430 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
Mat Sugumaran 2007-11-06 15:24:40 +00:00
parent d541b8cd06
commit 78ef688f0b
1 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ my $return_result = $result->{$opt_o};
#=== Plugin return code ==== #=== Plugin return code ====
if (defined($return_result)){ if (defined($return_result)){
if ($return_result !~ /^[0-9]$/) { if ($return_result !~ /^[0-9]+$/) {
print "Snmp return value isn't numeric.\n"; print "Snmp return value isn't numeric.\n";
exit $ERRORS{'OK'}; exit $ERRORS{'OK'};
} }
@ -176,7 +176,7 @@ if (defined($return_result)){
sub print_usage () { sub print_usage () {
print "\nUsage:\n"; print "Usage:";
print "$PROGNAME\n"; print "$PROGNAME\n";
print " -H (--hostname) Hostname to query - (required)\n"; print " -H (--hostname) Hostname to query - (required)\n";
print " -C (--community) SNMP read community (defaults to public,\n"; print " -C (--community) SNMP read community (defaults to public,\n";