summaryrefslogtreecommitdiff
path: root/bin/icli
diff options
context:
space:
mode:
Diffstat (limited to 'bin/icli')
-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) {