diff -Naur nagios-3.0.6-orig/xdata/xodtemplate.c nagios-3.0.6/xdata/xodtemplate.c
--- nagios-3.0.6-orig/xdata/xodtemplate.c	2009-09-02 17:15:52.000000000 -0400
+++ nagios-3.0.6/xdata/xodtemplate.c	2009-09-02 17:21:55.000000000 -0400
@@ -5247,6 +5247,7 @@
 
 	char *service_descriptions=NULL;
 	int first_item=FALSE;
+	int same_host_servicedependency=FALSE;
 
 
 	/*************************************/
@@ -5725,6 +5726,11 @@
 				my_free(temp_servicedependency->dependent_service_description);
 				my_free(temp_servicedependency->dependent_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;
@@ -5742,6 +5748,10 @@
 
 					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;
@@ -5757,7 +5767,11 @@
 					}
 
 				/* 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){
