remove bug in check_centreon_snmp_cpu : warning and critical level not supported
git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@5472 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
parent
ed37394fd5
commit
3bb21f5e2e
|
@ -82,8 +82,8 @@ if (!$opt_H) {
|
|||
my $snmp = "1";
|
||||
$snmp = $opt_v if ($opt_v && $opt_v =~ /^[0-9]$/);
|
||||
|
||||
$opt_c = 95 if (defined($opt_c) || !$opt_c);
|
||||
$opt_w = 95 if (defined($opt_w) || !$opt_w);
|
||||
$opt_c = 95 if (!defined($opt_c) || !$opt_c);
|
||||
$opt_w = 90 if (!defined($opt_w) || !$opt_w);
|
||||
|
||||
if ($snmp eq "3") {
|
||||
if (!$opt_u) {
|
||||
|
@ -115,13 +115,13 @@ if ($snmp eq "1" || $snmp eq "2") {
|
|||
print("UNKNOWN: SNMP 1 or 2 Session : $error\n");
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
}elsif ($opt_k) {
|
||||
} elsif ($opt_k) {
|
||||
($session, $error) = Net::SNMP->session(-hostname => $opt_H, -version => $snmp, -username => $opt_u, -authkey => $opt_k);
|
||||
if (!defined($session)) {
|
||||
print("UNKNOWN: SNMP Session : $error\n");
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
}elsif ($opt_p) {
|
||||
} elsif ($opt_p) {
|
||||
($session, $error) = Net::SNMP->session(-hostname => $opt_H, -version => $snmp, -username => $opt_u, -authpassword => $opt_p);
|
||||
if (!defined($session)) {
|
||||
print("UNKNOWN: SNMP Session : $error\n");
|
||||
|
@ -171,10 +171,12 @@ exit $ERRORS{$status};
|
|||
sub print_usage () {
|
||||
print "\nUsage:\n";
|
||||
print "$PROGNAME\n";
|
||||
print "This Plugin is design for return CPU percent on windows Serveurs (1 min Average)\n";
|
||||
print "\n";
|
||||
print " -H (--hostname) Hostname to query - (required)\n";
|
||||
print " -C (--community) SNMP read community (defaults to public,\n";
|
||||
print " -c (--critical) Three critical tresholds (defaults : 2,4,6)\n";
|
||||
print " -w (--warning) Three warning tresholds (defaults : 1,3,5)\n";
|
||||
print " -c (--critical) Three critical tresholds (defaults : 95)\n";
|
||||
print " -w (--warning) Three warning tresholds (defaults : 90)\n";
|
||||
print " -v (--snmp_version) 1 for SNMP v1 (default)\n";
|
||||
print " 2 for SNMP v2c\n";
|
||||
print " -k (--key) snmp V3 key\n";
|
||||
|
@ -186,8 +188,8 @@ sub print_usage () {
|
|||
|
||||
sub print_help () {
|
||||
print "##############################################\n";
|
||||
print "# Copyright (c) 2004-2007 Merethis #\n";
|
||||
print "# Bugs to http://bugs.oreon-project.org/ #\n";
|
||||
print "# Copyright (c) 2004-2008 Merethis #\n";
|
||||
print "# Bugs to http://trac.centreon.com/ #\n";
|
||||
print "##############################################\n";
|
||||
print_usage();
|
||||
print "\n";
|
||||
|
|
Loading…
Reference in New Issue