summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2010-11-20 03:24:19 +0100
committerDaniel Friesel <derf@finalrewind.org>2010-11-20 03:24:19 +0100
commitb0d074ea5ef30212c83e4848f2122dc988d7f467 (patch)
treee6dcc8587baa2c2c21f609bbb5edece489dbd667 /bin
parent0eab1e66dfce62d603d4ccde50bcee9378bd620d (diff)
Show DOWN/UNREACHABBLE hosts in service list
Diffstat (limited to 'bin')
-rwxr-xr-xbin/icli16
1 files changed, 15 insertions, 1 deletions
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) {