App-Icli
view release on metacpan or search on metacpan
my $format = "%-10s : %s\n";
if ( $v > 2 ) {
printf( $format, 'Host', $d->{host_name} );
if ( $d->{service_description} ) {
printf( $format, 'Service', $d->{service_description} );
}
printf( $format,
'Start',
$d->{is_in_effect}
? with_colour( pretty_date( $d->{start_time} ), 'bold' )
: pretty_date( $d->{start_time} ) );
printf( $format,
'End',
$d->{is_in_effect}
? with_colour( pretty_date( $d->{end_time} ), 'bold' )
: pretty_date( $d->{end_time} ) );
printf( $format,
'Duration',
$d->{fixed} ? 'Fixed' : pretty_duration_abs( $d->{duration} ) );
if ( $v > 3 ) {
printf( $format, 'ID', $d->{downtime_id} );
if ( $d->{trigger_time} ) {
printf( $format,
'Trigger',
$d->{triggered_by}
printf( '%-25.25s', $d->{'host_name'} );
}
if ( $v >= 3 ) {
printf( ' %s %-10.10s',
pretty_date( $d->{'entry_time'} ),
$d->{'author'}, );
}
if ( $d->{is_in_effect} ) {
printf( ' %-28s %-28s',
with_colour( pretty_date( $d->{'start_time'} ), 'bold' ),
with_colour( pretty_date( $d->{'end_time'} ), 'bold' ),
);
}
else {
printf(
' %-20.20s %-20.20s',
pretty_date( $d->{'start_time'} ),
pretty_date( $d->{'end_time'} ),
);
}
if ( $v >= 2 ) {
}
if (
not( $s->{'active_checks_enabled'}
or $s->{'passive_checks_enabled'} )
)
{
$flags .= '!';
}
$flags = sprintf( ' %-3s', $flags );
print with_colour( $flags, 'bold' );
}
printf( ' %s', service_state($s) );
if ( $v >= 2 ) {
printf( ' %d/%d', $s->{'current_attempt'}, $s->{'max_attempts'} );
$n_width += 4;
}
print ' ';
( run in 0.749 second using v1.01-cache-2.11-cpan-39bf76dae61 )