From 2731255c0cabc52896eece32f8d054d199aef1c6 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 9 Aug 2010 20:22:10 +0200 Subject: Don't ignore unknown fields --- bin/icli | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/icli b/bin/icli index 1716fed..ee07793 100755 --- a/bin/icli +++ b/bin/icli @@ -54,27 +54,33 @@ sub read_objects_line { $cache->{$+{key}} = $+{value}; } elsif ($line =~ / ^ \t } $ /x) { - given($context) { - when(['info', 'programstatus']) { + given ($context) { + when (['info', 'programstatus']) { ${$ref}->{$context} = $cache; } - when('hoststatus') { + when ('hoststatus') { ${$ref}->{hosts}->{$cache->{host_name}} = $cache; } - when('servicestatus') { + when ('servicestatus') { push(@{${$ref}->{services}->{$cache->{host_name}}}, $cache); } - when('contactstatus') { + when ('contactstatus') { push(@{${$ref}->{contacts}}, $cache); } - when('hostgroup') { + when ('hostgroup') { ${$ref}->{hostgroups}->{$cache->{hostgroup_name}} = $cache; } - when([qw[timeperiod command contactgroup contact host service]]) { + when ('hostcomment') { + # TODO + } + when ('servicecomment') { + # TODO + } + when ([qw[timeperiod command contactgroup contact host service]]) { # skipped for now } default { - die("Unknown field in $status_file: $context\n"); + warn("Unknown field in $status_file: $context\n"); } } $cache = undef; -- cgit v1.2.3