[icinga-checkins] icinga.org: icinga-core/hpatel/core: error out on services without desc in config

git at icinga.org git at icinga.org
Thu May 27 12:50:12 CEST 2010


Module: icinga-core
Branch: hpatel/core
Commit: b8200fc787dc24eb1f41e7008d29fd8223be4ec9
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=b8200fc787dc24eb1f41e7008d29fd8223be4ec9

Author: hirenp <hirenp at firebird.(none)>
Date:   Thu May 27 12:48:57 2010 +0200

error out on services without desc in config

---

 xdata/xodtemplate.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/xdata/xodtemplate.c b/xdata/xodtemplate.c
index deef61d..487e649 100644
--- a/xdata/xodtemplate.c
+++ b/xdata/xodtemplate.c
@@ -650,6 +650,7 @@ int xodtemplate_process_config_file(char *filename, int options){
 	register int x=0;
 	register int y=0;
 	char *ptr=NULL;
+	xodtemplate_service *temp_service=NULL;
 
 
 #ifdef NSCORE
@@ -752,6 +753,20 @@ int xodtemplate_process_config_file(char *filename, int options){
 		/* this is the close of an object definition */
 		else if(!strcmp(input,"}") && in_definition==TRUE){
 
+			switch(xodtemplate_current_object_type){
+				case XODTEMPLATE_SERVICE:{
+					temp_service=(xodtemplate_service *)xodtemplate_current_object;
+					if (temp_service->register_object && (!temp_service->service_description)){
+						logit(NSLOG_CONFIG_ERROR,TRUE,"Error: Ending service definition without description in '%s' on line %d.\n",filename,current_line);
+						result=ERROR;
+						break;
+					}
+					break;
+				}
+				default:
+					break;
+			}
+
 			in_definition=FALSE;
 
 			/* close out current definition */





More information about the icinga-checkins mailing list