when arguments are missing or are not ok, return UNKNOWN

git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@11008 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
Julien Mathis 2010-11-02 12:34:23 +00:00
parent c507cd1db4
commit 16373ffa48
1 changed files with 4 additions and 4 deletions

View File

@ -118,13 +118,13 @@ if ($opt_w && $opt_w =~ /^([0-9]+),([0-9]+),([0-9]+)$/) {
@warning = ('1', '3', '5');
} else {
print "Specify three warning treshold separated with a coma\n";
exit $ERRORS{'OK'};
exit $ERRORS{'UNKNOWN'};
}
for (my $i = 0; $i < scalar(@warning); $i++) {
if ($warning[$i] >= $critical[$i]) {
print "Critical tresholds must be superior to warning tresholds.\n";
exit $ERRORS{'OK'};
exit $ERRORS{'UNKNOWN'};
}
}
@ -135,10 +135,10 @@ if ($snmp eq "3") {
}
if (!$opt_p && !$opt_k) {
print "Option -k (--key) or -p (--password) is required for snmpV3\n";
exit $ERRORS{'OK'};
exit $ERRORS{'UNKNOWN'};
} elsif ($opt_p && $opt_k) {
print "Only option -k (--key) or -p (--password) is needed for snmpV3\n";
exit $ERRORS{'OK'};
exit $ERRORS{'UNKNOWN'};
}
}