summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/icli15
1 files changed, 12 insertions, 3 deletions
diff --git a/bin/icli b/bin/icli
index 3f52193..e5277a6 100755
--- a/bin/icli
+++ b/bin/icli
@@ -54,9 +54,6 @@ sub read_status_line {
}
when('servicestatus') {
push(@{$data->{services}->{$cache->{host_name}}}, $cache);
- if ($cache->{current_state} != 0) {
- $extra->{$cache->{host_name}}->{service_problem} = 1;
- }
}
when('contactstatus') {
push(@{$data->{contacts}}, $cache);
@@ -78,6 +75,17 @@ sub read_status {
close($fh);
}
+sub enhance_status {
+ HOST: for my $h (keys %{$data->{services}}) {
+ for my $s (@{$data->{services}->{$h}}) {
+ if ($s->{current_state} != 0) {
+ $extra->{$h}->{service_problem} = 1;
+ next HOST;
+ }
+ }
+ }
+}
+
sub service_state {
my ($digit) = @_;
given ($digit) {
@@ -166,6 +174,7 @@ GetOptions(
);
read_status();
+enhance_status();
if ($for_host) {
if (have_host($for_host)) {