summaryrefslogtreecommitdiff
path: root/bin/icli
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-08-09 20:22:10 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-08-09 20:22:10 +0200
commit2731255c0cabc52896eece32f8d054d199aef1c6 (patch)
tree49d6dffd8d1cf3ef2b5b4a540faa1d3ce92dc7ad /bin/icli
parent41a91ab4d484b795492c38cd794c008584302ecf (diff)
Don't ignore unknown fields
Diffstat (limited to 'bin/icli')
-rwxr-xr-xbin/icli22
1 files changed, 14 insertions, 8 deletions
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;