[icinga-checkins] icinga.org: icinga-core/master: Added cgi argument 'nodaemoncheck'

git at icinga.org git at icinga.org
Sat Jan 23 22:21:08 CET 2010


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

Author: Hendrik Baecker <andurin at process-zero.de>
Date:   Sun Jan 17 20:17:34 2010 +0100

Added cgi argument 'nodaemoncheck'

---

 cgi/avail.c     |    8 +++++++-
 cgi/extinfo.c   |    9 ++++++++-
 cgi/histogram.c |    7 ++++++-
 cgi/outages.c   |    8 +++++++-
 cgi/status.c    |    7 ++++++-
 cgi/statusmap.c |    7 ++++++-
 cgi/statuswml.c |    9 +++++++--
 cgi/statuswrl.c |    7 ++++++-
 cgi/tac.c       |    7 ++++++-
 cgi/trends.c    |    7 ++++++-
 10 files changed, 65 insertions(+), 11 deletions(-)

diff --git a/cgi/avail.c b/cgi/avail.c
index 8831873..92e20b5 100644
--- a/cgi/avail.c
+++ b/cgi/avail.c
@@ -260,6 +260,8 @@ int earliest_archive=0;
 
 int embedded=FALSE;
 int display_header=TRUE;
+int daemon_check=TRUE;
+
 
 timeperiod *current_timeperiod=NULL;
 
@@ -318,7 +320,7 @@ int main(int argc, char **argv){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		document_header(FALSE);
 		status_data_error();
 		document_footer();
@@ -1644,6 +1646,10 @@ int process_cgivars(void){
 			        }
 		        }
 
+		/* we found the nodaemoncheck option */
+		else if(!strcmp(variables[x],"nodaemoncheck"))
+			daemon_check=FALSE;
+
 	        }
 
 	/* free memory allocated to the CGI variables */
diff --git a/cgi/extinfo.c b/cgi/extinfo.c
index bcb19cd..12bdbd1 100644
--- a/cgi/extinfo.c
+++ b/cgi/extinfo.c
@@ -127,6 +127,7 @@ int sort_option=SORT_NEXTCHECKTIME;
 
 int embedded=FALSE;
 int display_header=TRUE;
+int daemon_check=TRUE;
 
 
 
@@ -177,7 +178,7 @@ int main(void){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		document_header(FALSE);
 		status_data_error();
 		document_footer();
@@ -765,8 +766,14 @@ int process_cgivars(void){
 		/* we found the noheader option */
 		else if(!strcmp(variables[x],"noheader"))
 			display_header=FALSE;
+
+		/* we found the nodaemoncheck option */
+		else if(!strcmp(variables[x],"nodaemoncheck"))
+			daemon_check=FALSE;
+
 	        }
 
+
 	/* free memory allocated to the CGI variables */
 	free_cgivars(variables);
 
diff --git a/cgi/histogram.c b/cgi/histogram.c
index 722e949..3f742ce 100644
--- a/cgi/histogram.c
+++ b/cgi/histogram.c
@@ -204,6 +204,7 @@ int graph_statetypes=GRAPH_HARD_STATETYPES;
 
 int embedded=FALSE;
 int display_header=TRUE;
+int daemon_check=TRUE;
 
 char *host_name="";
 char *svc_description="";
@@ -293,7 +294,7 @@ int main(int argc, char **argv){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		if(mode==CREATE_HTML){
 			document_header(FALSE);
 			status_data_error();
@@ -1395,6 +1396,10 @@ int process_cgivars(void){
 		else if(!strcmp(variables[x],"noheader"))
 			display_header=FALSE;
 
+                /* we found the nodaemoncheck option */
+                else if(!strcmp(variables[x],"nodaemoncheck"))
+                        daemon_check=FALSE;
+
 		/* we found the input option */
 		else if(!strcmp(variables[x],"input")){
 			x++;
diff --git a/cgi/outages.c b/cgi/outages.c
index 6acdfa6..399d1c1 100644
--- a/cgi/outages.c
+++ b/cgi/outages.c
@@ -96,6 +96,7 @@ int service_severity_divisor=4;            /* default = services are 1/4 as impo
 
 int embedded=FALSE;
 int display_header=TRUE;
+int daemon_check=TRUE;
 
 
 
@@ -139,7 +140,7 @@ int main(void){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		document_header(FALSE);
 		status_data_error();
 		document_footer();
@@ -293,6 +294,11 @@ int process_cgivars(void){
 		/* we found the noheader option */
 		else if(!strcmp(variables[x],"noheader"))
 			display_header=FALSE;
+
+		/* we found the nodaemoncheck option */
+                else if(!strcmp(variables[x],"nodaemoncheck"))
+                        daemon_check=FALSE;
+
 	        }
 
 	/* free memory allocated to the CGI variables */
diff --git a/cgi/status.c b/cgi/status.c
index c6393a2..aecd8ff 100644
--- a/cgi/status.c
+++ b/cgi/status.c
@@ -178,6 +178,7 @@ int problem_services_unknown=0;
 
 int embedded=FALSE;
 int display_header=TRUE;
+int daemon_check=TRUE;
 
 
 
@@ -227,7 +228,7 @@ int main(void){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		document_header(FALSE);
 		status_data_error();
 		document_footer();
@@ -755,6 +756,10 @@ int process_cgivars(void){
 		else if(!strcmp(variables[x],"noheader"))
 			display_header=FALSE;
 
+		/* we found the nodaemoncheck option */
+		else if(!strcmp(variables[x],"nodaemoncheck"))
+			daemon_check=FALSE;
+
 		/* servicefilter cgi var */
                 else if(!strcmp(variables[x],"servicefilter")){
                         x++;
diff --git a/cgi/statusmap.c b/cgi/statusmap.c
index 8502fed..6684036 100644
--- a/cgi/statusmap.c
+++ b/cgi/statusmap.c
@@ -179,6 +179,7 @@ char *host_name="all";
 
 int embedded=FALSE;
 int display_header=TRUE;
+int daemon_check=TRUE;
 int display_popups=TRUE;
 int use_links=TRUE;
 int use_text=TRUE;
@@ -274,7 +275,7 @@ int main(int argc, char **argv){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		document_header(FALSE);
 		if(create_type==CREATE_HTML)
 			status_data_error();
@@ -580,6 +581,10 @@ int process_cgivars(void){
 			strip_html_brackets(variables[x]);
 			add_layer(variables[x]);
 		        }
+		/* we found the nodaemoncheck option */
+		else if(!strcmp(variables[x],"nodaemoncheck"))
+			daemon_check=FALSE;
+
 	        }
 
 	/* free memory allocated to the CGI variables */
diff --git a/cgi/statuswml.c b/cgi/statuswml.c
index 7f6c669..fad0ad0 100644
--- a/cgi/statuswml.c
+++ b/cgi/statuswml.c
@@ -94,6 +94,7 @@ char *ping_address="";
 char *traceroute_address="";
 
 int show_all_hostgroups=TRUE;
+int daemon_check=TRUE;
 
 
 authdata current_authdata;
@@ -144,7 +145,7 @@ int main(void){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		printf("<P>Error: Could not read host and service status information!</P>\n");
 		document_footer();
 		free_memory();
@@ -336,7 +337,11 @@ int process_cgivars(void){
 			strip_html_brackets(traceroute_address);
 		        }
 
-	        }
+		/* we found the nodaemoncheck option */
+                else if(!strcmp(variables[x],"nodaemoncheck"))
+			daemon_check=FALSE;
+
+		}
 
 	/* free memory allocated to the CGI variables */
 	free_cgivars(variables);
diff --git a/cgi/statuswrl.c b/cgi/statuswrl.c
index 6bba8f8..bc22d14 100644
--- a/cgi/statuswrl.c
+++ b/cgi/statuswrl.c
@@ -130,6 +130,7 @@ int layout_method=LAYOUT_USER_SUPPLIED;
 
 int coordinates_were_specified=FALSE;   /* were drawing coordinates specified with extended host info entries? */
 
+int daemon_check=TRUE;
 
 
 
@@ -167,7 +168,7 @@ int main(int argc, char **argv){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		free_memory();
 		return ERROR;
                 }
@@ -296,6 +297,10 @@ int process_cgivars(void){
 			custom_viewpoint=TRUE;
 		        }
 
+		/* we found the nodaemoncheck option */
+                else if(!strcmp(variables[x],"nodaemoncheck"))
+                        daemon_check=FALSE;
+
 	        }
 
 	/* free memory allocated to the CGI variables */
diff --git a/cgi/tac.c b/cgi/tac.c
index df48372..52f73c3 100644
--- a/cgi/tac.c
+++ b/cgi/tac.c
@@ -96,6 +96,7 @@ authdata current_authdata;
 
 int embedded=FALSE;
 int display_header=FALSE;
+int daemon_check=TRUE;
 
 hostoutage *hostoutage_list=NULL;
 
@@ -249,7 +250,7 @@ int main(void){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		document_header(FALSE);
 		status_data_error();
 		document_footer();
@@ -446,6 +447,10 @@ int process_cgivars(void){
 		else if(!strcmp(variables[x],"noheader"))
 			display_header=FALSE;
 
+		/* we found the nodaemoncheck option */
+		else if(!strcmp(variables[x],"nodaemoncheck"))
+			daemon_check=FALSE;
+
 		/* we received an invalid argument */
 		else
 			error=TRUE;
diff --git a/cgi/trends.c b/cgi/trends.c
index c5b7ab4..c3fc353 100644
--- a/cgi/trends.c
+++ b/cgi/trends.c
@@ -148,6 +148,7 @@ int use_map=TRUE;
 int small_image=FALSE;
 int embedded=FALSE;
 int display_header=TRUE;
+int daemon_check=TRUE;
 
 int assume_initial_states=TRUE;
 int assume_state_retention=TRUE;
@@ -335,7 +336,7 @@ int main(int argc, char **argv){
 
 	/* read all status data */
 	result=read_all_status_data(get_cgi_config_location(),READ_ALL_STATUS_DATA);
-	if(result==ERROR){
+	if(result==ERROR && daemon_check==TRUE){
 		if(mode==CREATE_HTML){
 			document_header(FALSE);
 			status_data_error();
@@ -1640,6 +1641,10 @@ int process_cgivars(void){
 		else if(!strcmp(variables[x],"smallimage"))
 			small_image=TRUE;
 
+		/* we found the nodaemoncheck option */
+		else if(!strcmp(variables[x],"nodaemoncheck"))
+			daemon_check=FALSE;
+
 	        }
 
 	/* free memory allocated to the CGI variables */





More information about the icinga-checkins mailing list