summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-06-01 16:26:18 +0200
committerDaniel Friesel <derf@finalrewind.org>2014-06-01 16:26:18 +0200
commit32582b4d3d01b85cabe2359fd9f490b1eb0255fe (patch)
tree8489101d167fe9fbf5674a51fb21c5a9b252d5f9 /bin
parent733e076bb91606bd6ababf828b2693ca9fefbf9a (diff)
-ld: show service downtimes as well
Diffstat (limited to 'bin')
-rwxr-xr-xbin/icli13
1 files changed, 12 insertions, 1 deletions
diff --git a/bin/icli b/bin/icli
index c28b413..77253f6 100755
--- a/bin/icli
+++ b/bin/icli
@@ -584,7 +584,13 @@ sub display_downtime {
my ($d) = @_;
my $v = $verbosity;
- printf( '%-27.27s', $d->{'host_name'} );
+ if ( $d->{service_description} ) {
+ printf( '%-25.25s %-25.25s',
+ $d->{'host_name'}, $d->{service_description} );
+ }
+ else {
+ printf( '%-25.25s', $d->{'host_name'} );
+ }
if ( $v >= 3 ) {
printf( ' %s %-10.10s',
@@ -1082,9 +1088,14 @@ elsif ( $list_type eq 'q' ) {
display_queue();
}
elsif ( $list_type eq 'd' ) {
+ say "Host downtimes:";
foreach my $downtime ( @{ $data->{hostdowntimes} } ) {
display_downtime($downtime);
}
+ say "\nService downtimes:";
+ foreach my $downtime ( @{ $data->{servicedowntimes} } ) {
+ display_downtime($downtime);
+ }
}
elsif ($action) {