[PATCH] Same host servicegroups dependencies
Mathieu Gagné
mgagne at iweb.com
Thu Oct 21 20:41:52 CEST 2010
---
xdata/xodtemplate.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/xdata/xodtemplate.c b/xdata/xodtemplate.c
index dc81044..dbcbb61 100644
--- a/xdata/xodtemplate.c
+++ b/xdata/xodtemplate.c
@@ -4264,6 +4264,7 @@ int xodtemplate_duplicate_objects(void){
char *service_descriptions=NULL;
int first_item=FALSE;
+ int same_host_servicedependency=FALSE;
/*************************************/
@@ -4554,6 +4555,11 @@ int xodtemplate_duplicate_objects(void){
my_free(temp_servicedependency->hostgroup_name);
}
+ /* MG(20090902): Same host servicegroups dependencies */
+ same_host_servicedependency=FALSE;
+ if(temp_servicedependency->host_name==NULL &&
temp_servicedependency->hostgroup_name==NULL)
+ same_host_servicedependency=TRUE; +
/* duplicate service dependency entries */
first_item=TRUE;
for(temp_masterservice=master_servicelist;temp_masterservice!=NULL;temp_masterservice=temp_masterservice->next){
@@ -4740,6 +4746,10 @@ int xodtemplate_duplicate_objects(void){
my_free(temp_servicedependency->dependent_service_description);
temp_servicedependency->dependent_service_description=(char
*)strdup(temp_dependentservice->name2);
+ /* MG(20090902): Same host servicegroups dependencies */
+ if(same_host_servicedependency==TRUE)
+
temp_servicedependency->host_name=(char*)strdup(temp_dependentservice->name1);
+
/* clear the dependent servicegroup */
temp_servicedependency->have_dependent_servicegroup_name=FALSE;
my_free(temp_servicedependency->dependent_servicegroup_name);
@@ -4754,7 +4764,11 @@ int xodtemplate_duplicate_objects(void){
}
/* duplicate service dependency definition */
-
result=xodtemplate_duplicate_servicedependency(temp_servicedependency,temp_servicedependency->host_name,temp_servicedependency->service_description,NULL,NULL,temp_dependentservice->name1,temp_dependentservice->name2,NULL,NULL);
+ /* MG(20090902): Same host servicegroups dependencies */
+ if(same_host_servicedependency==TRUE)
+
result=xodtemplate_duplicate_servicedependency(temp_servicedependency,temp_dependentservice->name1,temp_servicedependency->service_description,NULL,NULL,temp_dependentservice->name1,temp_dependentservice->name2,NULL,NULL);
+ else
+
result=xodtemplate_duplicate_servicedependency(temp_servicedependency,temp_servicedependency->host_name,temp_servicedependency->service_description,NULL,NULL,temp_dependentservice->name1,temp_dependentservice->name2,NULL,NULL);
/* exit on error */
if(result==ERROR){
--
1.6.3.3
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list