- check_iostat: add reasons why state is warning or critical

to the output

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=22
This commit is contained in:
Ruediger Oertel 2020-02-28 14:41:50 +00:00 committed by Git OBS Bridge
parent 2f4e862ed2
commit 2be02b9d41
3 changed files with 16 additions and 1 deletions

View File

@ -171,38 +171,47 @@ close (IOSTAT);
my $msg = "OK"; my $msg = "OK";
my $status = 0; my $status = 0;
my @reasons;
# Comparing the result and setting the correct level: # Comparing the result and setting the correct level:
if ($tps >= $warn_tps || $kbread >= $warn_read || $kbwritten >= $warn_written) { if ($tps >= $warn_tps || $kbread >= $warn_read || $kbwritten >= $warn_written) {
$msg = "WARNING"; $msg = "WARNING";
push @reasons, "throughput";
$status = 1; $status = 1;
} }
if ($warn_iowait && $iowait >= $warn_iowait) { if ($warn_iowait && $iowait >= $warn_iowait) {
$msg = "WARNING"; $msg = "WARNING";
push @reasons, "iowait";
$status = 1; $status = 1;
} }
if ($warn_util && $util >= $warn_util) { if ($warn_util && $util >= $warn_util) {
$msg = "WARNING"; $msg = "WARNING";
push @reasons, "util";
$status = 1; $status = 1;
} }
if ($tps >= $crit_tps || $kbread >= $crit_read || $kbwritten >= $crit_written) { if ($tps >= $crit_tps || $kbread >= $crit_read || $kbwritten >= $crit_written) {
$msg = "CRITICAL"; $msg = "CRITICAL";
push @reasons, "throughput";
$status = 2; $status = 2;
} }
if ($crit_iowait && $iowait >= $crit_iowait) { if ($crit_iowait && $iowait >= $crit_iowait) {
$msg = "CRITICAL"; $msg = "CRITICAL";
push @reasons, "iowait";
$status = 2; $status = 2;
} }
if ($crit_util && $util >= $crit_util) { if ($crit_util && $util >= $crit_util) {
$msg = "CRITICAL"; $msg = "CRITICAL";
push @reasons, "util";
$status = 2; $status = 2;
} }
$msg .= " (".join(",",@reasons).")";
my $p_tps = $tps; my $p_tps = $tps;
if ($warn_tps) { if ($warn_tps) {
$p_tps .= ";$warn_tps"; $p_tps .= ";$warn_tps";

View File

@ -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 Wed Dec 11 18:10:48 CET 2019 - ro@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package monitoring-plugins-sar-perf # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed