mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-22 10:23:46 +01:00
IP address added to output
This commit is contained in:
parent
c8efe374fd
commit
075bd2e20b
@ -338,26 +338,29 @@ my $cmp_warn=0; # compteur de disques en avertissement
|
|||||||
my $cmp_crit=0; # compteur de disques critiques
|
my $cmp_crit=0; # compteur de disques critiques
|
||||||
my $perf_data=""; # Donnees de perf
|
my $perf_data=""; # Donnees de perf
|
||||||
|
|
||||||
|
my $critical_disks = "";
|
||||||
|
my $warning_disks = "";
|
||||||
|
my $ok_disks = "";
|
||||||
|
|
||||||
# Tests Warn et Crit de tous les fs et creation de l'output
|
# Tests Warn et Crit de tous les fs et creation de l'output
|
||||||
foreach my $f (keys %checkdisks) {
|
foreach my $f (keys %checkdisks) {
|
||||||
|
if ($opt_v) { $output .= "\n"; }
|
||||||
if($checkdisks{$f}->{pfree} < $checkdisks{$f}->{critical}) {
|
if($checkdisks{$f}->{pfree} < $checkdisks{$f}->{critical}) {
|
||||||
|
$critical_disks .= " " . $f ;
|
||||||
$cmp_crit++;
|
$cmp_crit++;
|
||||||
$output .= "[$f " . byte2human($checkdisks{$f}->{free}) .
|
|
||||||
" (" . $checkdisks{$f}->{pfree} . '% free)] ';
|
|
||||||
$output .= "<br>" if ($opt_html);
|
|
||||||
}
|
}
|
||||||
elsif ($checkdisks{$f}->{pfree} < $checkdisks{$f}->{warning}) {
|
elsif ($checkdisks{$f}->{pfree} < $checkdisks{$f}->{warning}) {
|
||||||
|
$warning_disks .= " " . $f ;
|
||||||
$cmp_warn++;
|
$cmp_warn++;
|
||||||
$output .= "[$f " . byte2human($checkdisks{$f}->{free}) .
|
|
||||||
" (" . $checkdisks{$f}->{pfree} . '% free)] ';
|
|
||||||
$output .= "<br>" if ($opt_html);
|
|
||||||
} else {
|
} else {
|
||||||
if ($opt_v) {
|
$ok_disks .= " " . $f ;
|
||||||
$output .= "\n[$f " . byte2human($checkdisks{$f}->{free}) .
|
}
|
||||||
" (" . $checkdisks{$f}->{pfree} . '% free)] ' ;
|
$output .= "[$f " . byte2human($checkdisks{$f}->{free}) .
|
||||||
|
" (" . $checkdisks{$f}->{pfree} . '% free) ;' .
|
||||||
|
"warning=" . $checkdisks{$f}->{warning} . "% " .
|
||||||
|
"critical=" . $checkdisks{$f}->{critical} . "% " .
|
||||||
|
'] ' ;
|
||||||
$output .= "<br>" if ($opt_html);
|
$output .= "<br>" if ($opt_html);
|
||||||
}
|
|
||||||
}
|
|
||||||
#$output .= "\n";
|
#$output .= "\n";
|
||||||
|
|
||||||
# Donnees de Perfs
|
# Donnees de Perfs
|
||||||
@ -403,7 +406,7 @@ if (-d $opt_srvperf) {
|
|||||||
|
|
||||||
# Sortie du plugin : sans donnees de perfs qui sont stockes
|
# Sortie du plugin : sans donnees de perfs qui sont stockes
|
||||||
# dans d'autres fichiers
|
# dans d'autres fichiers
|
||||||
print "DISK $retour $output | $perf_data\n";
|
print "DISK $retour $critical_disks $warning_disks ... $output | $perf_data\n";
|
||||||
exit $EXIT_CODES{$retour};
|
exit $EXIT_CODES{$retour};
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
Loading…
Reference in New Issue
Block a user