treshold initialisation error fixed
git-svn-id: http://svn.centreon.com/Plugins/Dev@2664 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
parent
ed2340712e
commit
f15b91c114
|
@ -63,7 +63,6 @@ GetOptions
|
||||||
"v=s" => \$opt_v, "snmp=s" => \$opt_v,
|
"v=s" => \$opt_v, "snmp=s" => \$opt_v,
|
||||||
"C=s" => \$opt_C, "community=s" => \$opt_C,
|
"C=s" => \$opt_C, "community=s" => \$opt_C,
|
||||||
"d=s" => \$opt_d, "disk=s" => \$opt_d,
|
"d=s" => \$opt_d, "disk=s" => \$opt_d,
|
||||||
"f" => \$opt_f, "perfparse" => \$opt_f,
|
|
||||||
"n" => \$opt_n, "name" => \$opt_n,
|
"n" => \$opt_n, "name" => \$opt_n,
|
||||||
"w=s" => \$opt_w, "warning=s" => \$opt_w,
|
"w=s" => \$opt_w, "warning=s" => \$opt_w,
|
||||||
"c=s" => \$opt_c, "critical=s" => \$opt_c,
|
"c=s" => \$opt_c, "critical=s" => \$opt_c,
|
||||||
|
@ -117,7 +116,12 @@ if ($opt_d =~ /([0-9]+)/ && !$opt_n){
|
||||||
print "Unknown -d number expected... or it doesn't exist, try another disk - number\n";
|
print "Unknown -d number expected... or it doesn't exist, try another disk - number\n";
|
||||||
exit $ERRORS{'UNKNOWN'};
|
exit $ERRORS{'UNKNOWN'};
|
||||||
}
|
}
|
||||||
|
if (!$opt_c) {
|
||||||
|
$opt_c = 95;
|
||||||
|
}
|
||||||
|
if (!$opt_w) {
|
||||||
|
$opt_w = 90;
|
||||||
|
}
|
||||||
my $critical = 95;
|
my $critical = 95;
|
||||||
if ($opt_c && $opt_c =~ /^[0-9]+$/) {
|
if ($opt_c && $opt_c =~ /^[0-9]+$/) {
|
||||||
$critical = $opt_c;
|
$critical = $opt_c;
|
||||||
|
@ -275,12 +279,10 @@ if (($Size =~ /([0-9]+)/) && ($AllocationUnits =~ /([0-9]+)/)){
|
||||||
print " Go USED: " . $pourcent . "% : ";
|
print " Go USED: " . $pourcent . "% : ";
|
||||||
printf("%.3f", $Used);
|
printf("%.3f", $Used);
|
||||||
print " Go";
|
print " Go";
|
||||||
if ($opt_f){
|
|
||||||
my $size_o = $Used * 1073741824;
|
my $size_o = $Used * 1073741824;
|
||||||
my $warn = $opt_w * $size_o;
|
my $warn = $opt_w * $size_o;
|
||||||
my $crit = $opt_c * $size_o;
|
my $crit = $opt_c * $size_o;
|
||||||
print "|size=".$lastTot."o used=".$size_o.";".$warn.";".$crit;
|
print "|size=".$lastTot."o used=".$size_o.";".$warn.";".$crit;
|
||||||
}
|
|
||||||
print "\n";
|
print "\n";
|
||||||
exit $return_code;
|
exit $return_code;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue