Patch to fix some 2.0 duplication issues with objects using servicegroup_name lines
Christopher Gurnee
gurnec at gis.net
Thu Mar 25 20:10:16 CET 2004
Hi, all.
It looks like there are some issues in Nagios 2.0 in the
xodtemplate_duplicate_objects function with regards to duplicating
service escalations and service dependencies which use
"servicegroup_name" to specify the services to use. The attached patch
fixes most of these issues (but I think that a few may remain).
!! A WORD OF CAUTION: this patch is POORLY TESTED....
With service escalations, if you use both
host/hostgroup/service_descriptions AND servicegroups to specify
services in the same escalation definition, it would be possible to end
up with multiple escalations duplicates which are exactly the same.
After the patch, this is still possible, but it happens under fewer
circumstances (only if multiple hosts are specified AND a servicegroup
which has multiple services). This may not even be harmful to other
Nagios internals, I'm not sure....
With service dependencies, if you use both
host/hostgroup/service_descriptions AND servicegroups to specify the
master (or dependent) services, there existed a problem where sometimes
the wrong service got duplicated (a service with its host_name take from
the host/hostgroups, and its service_description from the servicegroups,
which may not even be an existent service). This is fixed, but the same
issue that exists with service escalations described above still exists
with service dependencies.
Lastly, with service dependencies, it was not possible to specify the
master service(s) using host/hostgroup/service_descriptions, and the
dependent service(s) using servicegroups (or vice versa). In other
words, before the patch, this wasn't allowed:
define servicedependency{
host_name master_host
service_description master_service
dependent_servicegroup_name list_of_dependent_services
}
As for the remaining issues I mentioned, I don't know how to fix them
without significant rewrites. The only thing I can think of doing is
adding host expansion capabilities to the xodtemplate_expand_services
function, and then rewriting xodtemplate_duplicate_objects to make use
of these new capabilities to do host expansion (via calls to
xodtemplate_expand_servicegroups_and_services) instead of doing it
separately with xodtemplate_expand_hostgroups_and_hosts. Maybe there's a
better way I'm not seeing... (and maybe this is too minor a bug to worry
about at this point)
Regards,
Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios-duplication-with-servicegroups.patch
Type: application/octet-stream
Size: 14111 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20040325/42e40f74/attachment.obj>
More information about the Developers
mailing list