mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-30 00:55:18 +02:00
disable UTF8
git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@3717 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
parent
90dbaa2e38
commit
e1dbfce70f
@ -28,8 +28,7 @@ use strict;
|
||||
use Net::SNMP qw(:snmp);
|
||||
use FindBin;
|
||||
use lib "$FindBin::Bin";
|
||||
use lib "/usr/local/nagios/libexec";
|
||||
#use lib "@NAGIOS_PLUGINS@";
|
||||
use lib "@NAGIOS_PLUGINS@";
|
||||
use utils qw($TIMEOUT %ERRORS &print_revision &support);
|
||||
|
||||
if (eval "require centreon" ) {
|
||||
@ -176,6 +175,8 @@ if (!defined($session)) {
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
}
|
||||
}
|
||||
$session->translate(Net::SNMP->TRANSLATE_NONE) if (defined($session));
|
||||
|
||||
|
||||
#getting partition using its name instead of its oid index
|
||||
if ($opt_n) {
|
||||
@ -209,8 +210,9 @@ if ($opt_s) {
|
||||
# Get description table
|
||||
my $result = $session->get_table(
|
||||
Baseoid => $OID_hrStorageDescr
|
||||
if (!defined($result)) {
|
||||
);
|
||||
|
||||
if (!defined($result)) {
|
||||
printf("ERROR: hrStorageDescr Table : %s.\n", $session->error);
|
||||
$session->close;
|
||||
exit $ERRORS{'UNKNOWN'};
|
||||
@ -219,11 +221,12 @@ if ($opt_s) {
|
||||
foreach my $key ( oid_lex_sort(keys %$result)) {
|
||||
my @oid_list = split (/\./,$key);
|
||||
my $index = pop (@oid_list) ;
|
||||
print "hrStorage $index :: @$result{$key}\n";
|
||||
print "hrStorage $index :: $$result{$key}\n";
|
||||
}
|
||||
exit $ERRORS{'OK'};
|
||||
}
|
||||
|
||||
|
||||
my $result = $session->get_request(
|
||||
-varbindlist => [$OID_hrStorageDescr.".".$partition ,
|
||||
$OID_hrStorageAllocationUnits.".".$partition ,
|
||||
@ -300,7 +303,7 @@ if (($Size =~ /([0-9]+)/) && ($AllocationUnits =~ /([0-9]+)/)){
|
||||
my $size_o = $Used * 1073741824;
|
||||
my $warn = $opt_w * $size_o;
|
||||
my $crit = $opt_c * $size_o;
|
||||
print "|size=".$lastTot."o used=".$size_o.";".$warn.";".$crit;
|
||||
print "|size=".$lastTot."o used=".$size_o."o;".$warn.";".$crit;
|
||||
print "\n";
|
||||
exit $return_code;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user