summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-11-19 12:19:11 +0100
committerDaniel Friesel <derf@finalrewind.org>2010-11-19 12:19:11 +0100
commitfe50af6721b170e0929b4e79dfc289452530e242 (patch)
treedba39e39ea5ec0427280c3058d21e46aa32115ee /bin
parent8e664173a28defcd81ec48fccf9b9cd6787c338e (diff)
icli: Add D filter to skip services on Down/Unreachable hosts
Diffstat (limited to 'bin')
-rwxr-xr-xbin/icli18
1 files changed, 16 insertions, 2 deletions
diff --git a/bin/icli b/bin/icli
index 357f8de..2fff1e9 100755
--- a/bin/icli
+++ b/bin/icli
@@ -79,6 +79,14 @@ sub check_is_soft {
return ($x->{'last_hard_state'} != $x->{'current_state'});
}
+sub check_is_host_down {
+ my ($s) = @_;
+
+ return (
+ $data->{'hosts'}->{ $s->{'host_name'} }->{'current_state'} != 0
+ );
+}
+
sub filter_generic {
my ($x) = @_;
@@ -92,6 +100,8 @@ sub filter_generic {
if (
($f eq 'A' and $x->{'problem_has_been_acknowledged'}) or
($f eq '!A' and not $x->{'problem_has_been_acknowledged'}) or
+ ($f eq 'D' and check_is_host_down($x)) or
+ ($f eq '!D' and not check_is_host_down($x)) or
($f eq 'F' and $x->{'is_flapping'}) or
($f eq '!F' and not $x->{'is_flapping'}) or
($f eq 'P' and $x->{'passive_checks_enabled'}
@@ -663,6 +673,10 @@ non-acknowledged services.
Check state has been acknowledged
+=item B<D>
+
+The host this service belongs to is Down or Unreachable
+
=item B<F>
Service is flapping between states
@@ -740,10 +754,10 @@ Schedule a check of the "APT Updates" service on all hosts having it
List check queue for all hosts in the hostgroup "chaosdorf-hosts", plus the
host aneurysm
-=item C<< icli -z!o,!A,!S >>
+=item C<< icli -z!o,!A,!S,!D >>
Show all service problems which are already hard states and have not yet been
-acknowledged
+acknowledged. Also weed out problem services on hosts which are down anyways
=back