summaryrefslogtreecommitdiff
path: root/bin/icli
diff options
context:
space:
mode:
Diffstat (limited to 'bin/icli')
-rwxr-xr-xbin/icli36
1 files changed, 35 insertions, 1 deletions
diff --git a/bin/icli b/bin/icli
index 229d85a..451f359 100755
--- a/bin/icli
+++ b/bin/icli
@@ -186,6 +186,35 @@ sub display_queue {
}
}
+sub display_downtime {
+ my ($d) = @_;
+ my $v = $verbosity;
+
+ printf('%-20.20s', $d->{'host_name'});
+
+ if ($v >= 3) {
+ printf(
+ ' %s %-10.10s',
+ pretty_date($d->{'entry_time'}),
+ $d->{'author'},
+ );
+ }
+ if ($v >= 2) {
+ printf(' %-30.30s', $d->{'comment'});
+ }
+ printf(
+ ' %s %s',
+ pretty_date($d->{'start_time'}),
+ pretty_date($d->{'end_time'}),
+ );
+ if ($v >= 2) {
+ print ($d->{'fixed'} ? ' Fixed' : ' Flexi');
+ }
+
+ print "\n";
+}
+
+
sub display_service {
my ($s) = @_;
@@ -195,7 +224,7 @@ sub display_service {
printf(" %s" , service_state($s->{'has_been_checked'}, $s->{'current_state'}));
if ($v >= 2) {
- printf(" %d/%d", $s->{'current_attempt'}, $s->{'max_attempts'});
+ printf(' %d/%d', $s->{'current_attempt'}, $s->{'max_attempts'});
}
printf(" %s\n", $s->{'plugin_output'});
@@ -305,6 +334,11 @@ elsif ($list_type eq 'h') {
elsif ($list_type eq 'q') {
display_queue();
}
+elsif ($list_type eq 'd') {
+ foreach my $downtime (@{$data->{downtimes}}) {
+ display_downtime($downtime);
+ }
+}
else {
die("See perldoc -F $0\n");
}