diff --git a/check_iostat b/check_iostat index e4f8978..106f8ca 100644 --- a/check_iostat +++ b/check_iostat @@ -171,38 +171,47 @@ close (IOSTAT); my $msg = "OK"; my $status = 0; +my @reasons; # Comparing the result and setting the correct level: if ($tps >= $warn_tps || $kbread >= $warn_read || $kbwritten >= $warn_written) { $msg = "WARNING"; + push @reasons, "throughput"; $status = 1; } if ($warn_iowait && $iowait >= $warn_iowait) { $msg = "WARNING"; + push @reasons, "iowait"; $status = 1; } if ($warn_util && $util >= $warn_util) { $msg = "WARNING"; + push @reasons, "util"; $status = 1; } if ($tps >= $crit_tps || $kbread >= $crit_read || $kbwritten >= $crit_written) { $msg = "CRITICAL"; + push @reasons, "throughput"; $status = 2; } if ($crit_iowait && $iowait >= $crit_iowait) { $msg = "CRITICAL"; + push @reasons, "iowait"; $status = 2; } if ($crit_util && $util >= $crit_util) { $msg = "CRITICAL"; + push @reasons, "util"; $status = 2; } +$msg .= " (".join(",",@reasons).")"; + my $p_tps = $tps; if ($warn_tps) { $p_tps .= ";$warn_tps"; diff --git a/monitoring-plugins-sar-perf.changes b/monitoring-plugins-sar-perf.changes index 8b19d71..c9dd452 100644 --- a/monitoring-plugins-sar-perf.changes +++ b/monitoring-plugins-sar-perf.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Feb 28 15:41:17 CET 2020 - ro@suse.de + +- check_iostat: add reasons why state is warning or critical + to the output + ------------------------------------------------------------------- Wed Dec 11 18:10:48 CET 2019 - ro@suse.de diff --git a/monitoring-plugins-sar-perf.spec b/monitoring-plugins-sar-perf.spec index cd4ad79..f6b06b9 100644 --- a/monitoring-plugins-sar-perf.spec +++ b/monitoring-plugins-sar-perf.spec @@ -1,7 +1,7 @@ # # spec file for package monitoring-plugins-sar-perf # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed