From b0d074ea5ef30212c83e4848f2122dc988d7f467 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 20 Nov 2010 03:24:19 +0100 Subject: Show DOWN/UNREACHABBLE hosts in service list --- bin/icli | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/icli b/bin/icli index eb84fdb..2c5d15a 100755 --- a/bin/icli +++ b/bin/icli @@ -374,11 +374,25 @@ sub display_service { sub display_host_services { my ($host, $all) = @_; my @services; + my $h = $data->{'hosts'}->{$host}; @services = grep { filter_service($_) } @{$data->{'services'}->{$host}}; if ($all and @services) { - say "\n$host"; + + print "\n$host"; + + if ($h->{'current_state'}) { + print q{ }; + } + if ($h->{'current_state'} == 1) { + print colored('DOWN', 'white on_red'); + } + elsif ($h->{'current_state'} == 2) { + print colored('UNREACHABLE', 'white on_blue'); + } + + print "\n"; } foreach my $service (@services) { -- cgit v1.2.3