Subject: | serviceescalation doesn't allow hostgroup_name (nagios 3 feature) |
Nagios3 configurations allow hostgroup_name to be part of serviceescalation
fields. There are probably many more examples of this sort of change,
but this is the change that was killing my project.
I changed the defition to allow this attribute, and updated the tests.
I'm not sure how to make this a 3.0 only change; the parser doesn't seem
to be very strict about this (or perhaps I just missed how to do it; if
so, I apologize for missing it)
Here is a patch of the changes:
diff -r -U 3 Nagios-Object-0.21.6/lib/Nagios/Object.pm
Nagios-Object-0.21.6.new/lib/Nagios/Object.pm
--- Nagios-Object-0.21.6/lib/Nagios/Object.pm 2009-07-17
09:36:29.000000000 -0400
+++ Nagios-Object-0.21.6.new/lib/Nagios/Object.pm 2009-07-28
20:38:35.000000000 -0400
@@ -248,6 +248,7 @@
ServiceEscalation => {
use =>
['Nagios::ServiceEscalation',280],
host_name => ['Nagios::Host',
280],
+ hostgroup_name => [['Nagios::HostGroup'],
280],
service_description => ['Nagios::Service',
280],
contacts => [['Nagios::Contact'], 280],
contact_groups => [['Nagios::ContactGroup'], 280],
diff -r -U 3 Nagios-Object-0.21.6/t/hostgroup_hostgroups.cfg
Nagios-Object-0.21.6.new/t/hostgroup_hostgroups.cfg
--- Nagios-Object-0.21.6/t/hostgroup_hostgroups.cfg 2009-07-17
09:36:29.000000000 -0400
+++ Nagios-Object-0.21.6.new/t/hostgroup_hostgroups.cfg 2009-07-28
20:37:18.000000000 -0400
@@ -255,8 +255,19 @@
alias THE Service Group
}
+define hostgroup {
+ hostgroup_name testhostgroup1
+ alias Test Host Group
+}
+
+define hostgroup {
+ hostgroup_name testhostgroup2
+ alias Test Host Group
+}
+
define serviceescalation {
host_name localhost
+ hostgroup_name testhostgroup2, testhostgroup2
service_description Current Load
contact_groups admindude
first_notification 3