summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-11-19 00:24:32 +0100
committerDaniel Friesel <derf@finalrewind.org>2010-11-19 00:24:32 +0100
commit00efada168075f8bd289d93aa44ab8511cb3c915 (patch)
treec96649df5f72e3a4723998b7a9b9a1da9aa35884 /bin
parentee56111f6396e821d3d4967707aba90df277e1ca (diff)
Add filter for soft states
Diffstat (limited to 'bin')
-rwxr-xr-xbin/icli16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/icli b/bin/icli
index 520aa57..3b2a7a3 100755
--- a/bin/icli
+++ b/bin/icli
@@ -73,6 +73,13 @@ sub pretty_date {
return time2str('%Y-%m-%d %H:%M:%S', $unix);
}
+sub check_is_soft {
+ my ($x) = @_;
+
+ return ($x->{'last_hard_state'} != $x->{'current_state'});
+}
+
+
sub filter_generic {
my ($x) = @_;
my $filters_unfulfilled = @filters;
@@ -90,6 +97,8 @@ sub filter_generic {
($f eq 'P' and $x->{'passive_checks_enabled'}
and not $x->{'active_checks_enabled'}) or
($f eq '!P' and $x->{'active_checks_enabled'}) or
+ ($f eq 'S' and check_is_soft($x)) or
+ ($f eq '!S' and not check_is_soft($x)) or
($f eq 'o' and $x->{'current_state'} == 0) or
($f eq '!o' and $x->{'current_state'} != 0) or
($f eq 'w' and $x->{'current_state'} == 1) or
@@ -663,6 +672,13 @@ Service is flapping between states
Only passive checks are enabled. Note that B<!P> simply means that active
checks are enabled, no matter the status of passive checks
+=item B<S>
+
+Check state is soft. For instance, it used to be OK and is now critical, but
+has not reached its maximum number and caused a notification yet. Good to
+find (or ignore) service problems which might just be temporary, non-critical
+glitches.
+
=item B<o>
Host/Service state is OK