diff options
| author | Daniel Friesel <derf@finalrewind.org> | 2010-11-20 03:24:19 +0100 | 
|---|---|---|
| committer | Daniel Friesel <derf@finalrewind.org> | 2010-11-20 03:24:19 +0100 | 
| commit | b0d074ea5ef30212c83e4848f2122dc988d7f467 (patch) | |
| tree | e6dcc8587baa2c2c21f609bbb5edece489dbd667 | |
| parent | 0eab1e66dfce62d603d4ccde50bcee9378bd620d (diff) | |
Show DOWN/UNREACHABBLE hosts in service list
| -rwxr-xr-x | bin/icli | 16 | ||||
| -rw-r--r-- | t/out/filter_.A.o | 2 | ||||
| -rw-r--r-- | t/out/filter_.o | 2 | ||||
| -rw-r--r-- | t/out/filter_D | 4 | ||||
| -rw-r--r-- | t/out/filter_S | 2 | ||||
| -rw-r--r-- | t/out/filter_c | 2 | ||||
| -rw-r--r-- | t/out/filter_u | 2 | ||||
| -rw-r--r-- | t/out/list_services_nc | 4 | ||||
| -rw-r--r-- | t/out/services_group_local | 4 | ||||
| -rw-r--r-- | t/out/services_short | 2 | ||||
| -rw-r--r-- | t/out/standard | 4 | 
11 files changed, 29 insertions, 15 deletions
| @@ -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) { diff --git a/t/out/filter_.A.o b/t/out/filter_.A.o index f6396c5..f570a57 100644 --- a/t/out/filter_.A.o +++ b/t/out/filter_.A.o @@ -1,5 +1,5 @@ -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Load                 [37;41mCRITICAL[0m OK - load average: 0.17, 0.13, 0.09  	Processes            [37;44m UNKNOWN[0m PROCS OK: 118 processes diff --git a/t/out/filter_.o b/t/out/filter_.o index f6396c5..f570a57 100644 --- a/t/out/filter_.o +++ b/t/out/filter_.o @@ -1,5 +1,5 @@ -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Load                 [37;41mCRITICAL[0m OK - load average: 0.17, 0.13, 0.09  	Processes            [37;44m UNKNOWN[0m PROCS OK: 118 processes diff --git a/t/out/filter_D b/t/out/filter_D index 105ebbe..601e69c 100644 --- a/t/out/filter_D +++ b/t/out/filter_D @@ -1,8 +1,8 @@ -alpha +alpha [37;41mDOWN[0m  	HTTP                 [30;42m   OK   [0m HTTP OK: HTTP/1.0 200 OK - 2333 bytes in 0.019 second response time -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Disk: /              [30;42m   OK   [0m DISK OK - free space: / 4846 MB (75% inode=90%):  	Disk: /boot          [30;42m   OK   [0m DISK OK - free space: /boot 119 MB (53% inode=99%):  	Disk: /data          [30;42m   OK   [0m DISK OK - free space: /data 60091 MB (48% inode=99%): diff --git a/t/out/filter_S b/t/out/filter_S index f6396c5..f570a57 100644 --- a/t/out/filter_S +++ b/t/out/filter_S @@ -1,5 +1,5 @@ -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Load                 [37;41mCRITICAL[0m OK - load average: 0.17, 0.13, 0.09  	Processes            [37;44m UNKNOWN[0m PROCS OK: 118 processes diff --git a/t/out/filter_c b/t/out/filter_c index acc5847..46a6433 100644 --- a/t/out/filter_c +++ b/t/out/filter_c @@ -1,3 +1,3 @@ -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Load                 [37;41mCRITICAL[0m OK - load average: 0.17, 0.13, 0.09 diff --git a/t/out/filter_u b/t/out/filter_u index ba2b691..b2f93fa 100644 --- a/t/out/filter_u +++ b/t/out/filter_u @@ -1,3 +1,3 @@ -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Processes            [37;44m UNKNOWN[0m PROCS OK: 118 processes diff --git a/t/out/list_services_nc b/t/out/list_services_nc index 2ff7487..df0529f 100644 --- a/t/out/list_services_nc +++ b/t/out/list_services_nc @@ -1,8 +1,8 @@ -alpha +alpha [37;41mDOWN[0m  	HTTP                    OK    HTTP OK: HTTP/1.0 200 OK - 2333 bytes in 0.019 second response time -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Disk: /                 OK    DISK OK - free space: / 4846 MB (75% inode=90%):  	Disk: /boot             OK    DISK OK - free space: /boot 119 MB (53% inode=99%):  	Disk: /data             OK    DISK OK - free space: /data 60091 MB (48% inode=99%): diff --git a/t/out/services_group_local b/t/out/services_group_local index 105ebbe..601e69c 100644 --- a/t/out/services_group_local +++ b/t/out/services_group_local @@ -1,8 +1,8 @@ -alpha +alpha [37;41mDOWN[0m  	HTTP                 [30;42m   OK   [0m HTTP OK: HTTP/1.0 200 OK - 2333 bytes in 0.019 second response time -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Disk: /              [30;42m   OK   [0m DISK OK - free space: / 4846 MB (75% inode=90%):  	Disk: /boot          [30;42m   OK   [0m DISK OK - free space: /boot 119 MB (53% inode=99%):  	Disk: /data          [30;42m   OK   [0m DISK OK - free space: /data 60091 MB (48% inode=99%): diff --git a/t/out/services_short b/t/out/services_short index f6396c5..f570a57 100644 --- a/t/out/services_short +++ b/t/out/services_short @@ -1,5 +1,5 @@ -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Load                 [37;41mCRITICAL[0m OK - load average: 0.17, 0.13, 0.09  	Processes            [37;44m UNKNOWN[0m PROCS OK: 118 processes diff --git a/t/out/standard b/t/out/standard index d9a3cd1..815ca3b 100644 --- a/t/out/standard +++ b/t/out/standard @@ -1,8 +1,8 @@ -alpha +alpha [37;41mDOWN[0m  	HTTP                 [30;42m   OK   [0m HTTP OK: HTTP/1.0 200 OK - 2333 bytes in 0.019 second response time -aneurysm +aneurysm [37;44mUNREACHABLE[0m  	Disk: /              [30;42m   OK   [0m DISK OK - free space: / 4846 MB (75% inode=90%):  	Disk: /boot          [30;42m   OK   [0m DISK OK - free space: /boot 119 MB (53% inode=99%):  	Disk: /data          [30;42m   OK   [0m DISK OK - free space: /data 60091 MB (48% inode=99%): | 
