diff options
author | Daniel Friesel <derf@finalrewind.org> | 2010-11-20 03:24:19 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2010-11-20 03:24:19 +0100 |
commit | b0d074ea5ef30212c83e4848f2122dc988d7f467 (patch) | |
tree | e6dcc8587baa2c2c21f609bbb5edece489dbd667 /bin | |
parent | 0eab1e66dfce62d603d4ccde50bcee9378bd620d (diff) |
Show DOWN/UNREACHABBLE hosts in service list
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/icli | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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) { |