summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/icli20
1 files changed, 11 insertions, 9 deletions
diff --git a/bin/icli b/bin/icli
index fa3d4aa..c4e63b6 100755
--- a/bin/icli
+++ b/bin/icli
@@ -417,7 +417,9 @@ sub enhance_status {
}
sub service_state {
- my ( $checked, $digit ) = @_;
+ my ($s) = @_;
+ my $checked = $s->{has_been_checked};
+ my $digit = $s->{current_state};
if ( not $checked ) {
return 'PENDING ';
@@ -433,7 +435,9 @@ sub service_state {
}
sub host_state {
- my ( $checked, $digit ) = @_;
+ my ( $h ) = @_;
+ my $checked = $h->{has_been_checked};
+ my $digit = $h->{current_state};
if ( not $checked ) {
return ' PENDING ';
@@ -516,9 +520,7 @@ sub display_x_verbose {
printf(
"%-16s : %s (for %s)%s\n",
'Status',
- service_state(
- $x->{'has_been_checked'}, $x->{'current_state'}
- ),
+ service_state($x),
pretty_duration( $x->{'last_state_change'} ),
(
$x->{'problem_has_been_acknowledged'}
@@ -531,7 +533,7 @@ sub display_x_verbose {
printf(
"%-16s : %s (for %s)%s\n",
'Status',
- host_state( $x->{'has_been_checked'}, $x->{'current_state'} ),
+ host_state( $x ),
pretty_duration( $x->{'last_state_change'} ),
(
$x->{'problem_has_been_acknowledged'}
@@ -669,7 +671,7 @@ sub display_service {
}
printf( ' %s',
- service_state( $s->{'has_been_checked'}, $s->{'current_state'} ) );
+ service_state( $s) );
if ( $v >= 2 ) {
printf( ' %d/%d', $s->{'current_attempt'}, $s->{'max_attempts'} );
@@ -735,7 +737,7 @@ sub display_host_single {
printf( '%-32.32s %s',
$h->{host_name},
- host_state( $h->{'has_been_checked'}, $h->{'current_state'} ) );
+ host_state( $h ) );
if ( $v >= 2 ) {
printf( ' %d/%d', $h->{'current_attempt'}, $h->{'max_attempts'} );
@@ -779,7 +781,7 @@ sub display_host_overview {
printf('%-32.32s %s',
$h->{host_name},
- host_state($h->{has_been_checked}, $h->{current_state} ) );
+ host_state($h ) );
printf(' %s %s %s %s',
pretty_state($ok, 'ok'),