[Nagios-checkins] SF.net SVN: nagios:[2063] nagioscore/trunk

ageric at users.sourceforge.net ageric at users.sourceforge.net
Mon Aug 13 15:19:56 UTC 2012


Revision: 2063
          http://nagios.svn.sourceforge.net/nagios/?rev=2063&view=rev
Author:   ageric
Date:     2012-08-13 15:19:56 +0000 (Mon, 13 Aug 2012)
Log Message:
-----------
Janitor patch: Clear up global and unused variable

A lot of global variables are declared in files that doesn't use
them, and a lot of variables were set but not used, leading to
wasted cycles when using less clever compilers than gcc 4.x.

This patch clears up the cruft, and manages to kill some of the
(very many) global variables.

Signed-off-by: Andreas Ericsson <ae at op5.se>

Modified Paths:
--------------
    nagioscore/trunk/base/broker.c
    nagioscore/trunk/base/checks.c
    nagioscore/trunk/base/commands.c
    nagioscore/trunk/base/config.c
    nagioscore/trunk/base/events.c
    nagioscore/trunk/base/logging.c
    nagioscore/trunk/base/nagios.c
    nagioscore/trunk/base/notifications.c
    nagioscore/trunk/base/sehandlers.c
    nagioscore/trunk/base/utils.c
    nagioscore/trunk/cgi/avail.c
    nagioscore/trunk/cgi/cgiauth.c
    nagioscore/trunk/cgi/cgiutils.c
    nagioscore/trunk/cgi/extinfo.c
    nagioscore/trunk/cgi/history.c
    nagioscore/trunk/cgi/notifications.c
    nagioscore/trunk/cgi/outages.c
    nagioscore/trunk/cgi/status.c
    nagioscore/trunk/cgi/statuswrl.c
    nagioscore/trunk/cgi/summary.c
    nagioscore/trunk/cgi/tac.c
    nagioscore/trunk/common/macros.c
    nagioscore/trunk/common/objects.c
    nagioscore/trunk/t-tap/test_commands.c
    nagioscore/trunk/t-tap/test_nagios_config.c
    nagioscore/trunk/t-tap/test_timeperiods.c
    nagioscore/trunk/xdata/xsddefault.c

Modified: nagioscore/trunk/base/broker.c
===================================================================
--- nagioscore/trunk/base/broker.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/broker.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -49,7 +49,6 @@
 extern int enable_flap_detection;
 extern int enable_failure_prediction;
 extern int process_performance_data;
-extern int aggregate_status_updates;
 extern unsigned long modified_host_process_attributes;
 extern unsigned long modified_service_process_attributes;
 extern char *global_host_event_handler;

Modified: nagioscore/trunk/base/checks.c
===================================================================
--- nagioscore/trunk/base/checks.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/checks.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -42,16 +42,10 @@
 #include "../include/neberrors.h"
 #endif
 
-extern int      sigshutdown;
-extern int      sigrestart;
-
-extern char     *temp_file;
-extern char     *temp_path;
 extern char     *check_result_path;
 
 extern int      interval_length;
 
-extern int      log_initial_states;
 extern int      log_passive_checks;
 extern int      log_host_retries;
 
@@ -59,7 +53,6 @@
 extern int      host_check_timeout;
 
 extern int      check_reaper_interval;
-extern int      max_check_reaper_time;
 
 extern int      use_aggressive_host_checking;
 extern unsigned long cached_host_check_horizon;
@@ -73,11 +66,8 @@
 extern int      currently_running_host_checks;
 
 extern int      accept_passive_service_checks;
-extern int      execute_service_checks;
 extern int      accept_passive_host_checks;
-extern int      execute_host_checks;
 extern int      obsess_over_services;
-extern int      obsess_over_hosts;
 
 extern int      translate_passive_host_checks;
 extern int      passive_host_checks_are_soft;
@@ -89,10 +79,6 @@
 extern int      max_host_check_spread;
 extern int      max_service_check_spread;
 
-extern int      use_large_installation_tweaks;
-extern int      free_child_process_memory;
-extern int      child_processes_fork_twice;
-
 extern time_t   last_program_stop;
 extern time_t   program_start;
 extern time_t   event_start;
@@ -107,11 +93,8 @@
 extern unsigned long   next_event_id;
 extern unsigned long   next_problem_id;
 
-extern unsigned long max_debug_file_size;
 
 
-
-
 /******************************************************************/
 /********************** CHECK REAPER FUNCTIONS ********************/
 /******************************************************************/

Modified: nagioscore/trunk/base/commands.c
===================================================================
--- nagioscore/trunk/base/commands.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/commands.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -32,21 +32,6 @@
 #include "../include/broker.h"
 #include "../include/nagios.h"
 
-extern char     *config_file;
-extern char	*log_file;
-extern char     *command_file;
-extern char     *temp_file;
-extern char     *temp_path;
-
-extern int      sigshutdown;
-extern int      sigrestart;
-
-extern int      check_external_commands;
-
-extern int      ipc_pipe[2];
-
-extern time_t   last_command_status_update;
-
 extern int      enable_notifications;
 extern int      execute_service_checks;
 extern int      accept_passive_service_checks;
@@ -74,9 +59,6 @@
 extern host     *host_list;
 extern service  *service_list;
 
-extern FILE     *command_file_fp;
-extern int      command_file_fd;
-
 /******************************************************************/
 /****************** EXTERNAL COMMAND PROCESSING *******************/
 /******************************************************************/

Modified: nagioscore/trunk/base/config.c
===================================================================
--- nagioscore/trunk/base/config.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/config.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -186,7 +186,6 @@
 extern hostgroup	*hostgroup_list;
 extern service          *service_list;
 extern servicegroup     *servicegroup_list;
-extern notification     *notification_list;
 extern command          *command_list;
 extern timeperiod       *timeperiod_list;
 extern serviceescalation *serviceescalation_list;

Modified: nagioscore/trunk/base/events.c
===================================================================
--- nagioscore/trunk/base/events.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/events.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -33,8 +33,6 @@
 #include "../lib/squeue.h"
 
 
-extern char	*config_file;
-
 extern int      test_scheduling;
 
 extern time_t   program_start;
@@ -54,9 +52,7 @@
 extern int      service_freshness_check_interval;
 extern int      host_freshness_check_interval;
 extern int      auto_rescheduling_interval;
-extern int      auto_rescheduling_window;
 
-extern int      check_external_commands;
 extern int      check_orphaned_services;
 extern int      check_orphaned_hosts;
 extern int      check_service_freshness;
@@ -74,13 +70,9 @@
 
 extern int      log_rotation_method;
 
-extern int      service_check_timeout;
-
 extern int      execute_service_checks;
 extern int      execute_host_checks;
 
-extern int      child_processes_fork_twice;
-
 extern int      time_change_threshold;
 
 squeue_t *nagios_squeue = NULL; /* our scheduling queue */

Modified: nagioscore/trunk/base/logging.c
===================================================================
--- nagioscore/trunk/base/logging.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/logging.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -31,7 +31,6 @@
 
 
 extern char	*log_file;
-extern char     *temp_file;
 extern char	*log_archive_path;
 
 extern host     *host_list;

Modified: nagioscore/trunk/base/nagios.c
===================================================================
--- nagioscore/trunk/base/nagios.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/nagios.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -135,7 +135,6 @@
 char            *last_program_version = NULL;
 char            *new_program_version = NULL;
 
-time_t          last_command_status_update = 0L;
 time_t          last_log_rotation = 0L;
 time_t          last_program_stop = 0L;
 
@@ -175,8 +174,6 @@
 int             caught_signal = FALSE;
 int             sig_id = 0;
 
-int             restarting = FALSE;
-
 int             verify_config = FALSE;
 int             verify_object_relationships = TRUE;
 int             verify_circular_paths = TRUE;
@@ -250,8 +247,6 @@
 check_result    check_result_info;
 unsigned long	max_check_result_file_age = DEFAULT_MAX_CHECK_RESULT_AGE;
 
-dbuf            check_result_dbuf;
-
 check_stats     check_statistics[MAX_CHECK_STATS_TYPES];
 
 char            *debug_file;

Modified: nagioscore/trunk/base/notifications.c
===================================================================
--- nagioscore/trunk/base/notifications.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/notifications.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -45,8 +45,6 @@
 
 extern int             enable_notifications;
 
-extern int             notification_timeout;
-
 extern unsigned long   next_notification_id;
 
 extern char            *generic_summary;

Modified: nagioscore/trunk/base/sehandlers.c
===================================================================
--- nagioscore/trunk/base/sehandlers.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/sehandlers.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -43,9 +43,6 @@
 
 extern int             log_event_handlers;
 
-extern unsigned long   next_event_id;
-extern unsigned long   next_problem_id;
-
 extern int             event_handler_timeout;
 extern int             ocsp_timeout;
 extern int             ochp_timeout;
@@ -60,10 +57,7 @@
 extern command         *ocsp_command_ptr;
 extern command         *ochp_command_ptr;
 
-extern time_t          program_start;
 
-
-
 /******************************************************************/
 /************* OBSESSIVE COMPULSIVE HANDLER FUNCTIONS *************/
 /******************************************************************/

Modified: nagioscore/trunk/base/utils.c
===================================================================
--- nagioscore/trunk/base/utils.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/base/utils.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -36,13 +36,11 @@
 #include "../include/workers.h"
 
 
-extern char	*config_file;
 extern char	*log_file;
 extern char     *command_file;
 extern char     *temp_file;
 extern char     *temp_path;
 extern char     *check_result_path;
-extern char     *check_result_path;
 extern char     *lock_file;
 extern char	*log_archive_path;
 
@@ -101,7 +99,6 @@
 extern unsigned long      syslog_options;
 
 extern int      service_check_timeout;
-extern int      service_check_timeout_state;
 extern int      host_check_timeout;
 extern int      event_handler_timeout;
 extern int      notification_timeout;
@@ -174,7 +171,6 @@
 
 extern time_t   program_start;
 
-extern time_t	last_command_status_update;
 extern time_t   last_log_rotation;
 
 extern int      verify_config;
@@ -189,7 +185,6 @@
 extern int      execute_service_checks;
 extern int      accept_passive_service_checks;
 extern int      execute_host_checks;
-extern int      accept_passive_host_checks;
 extern int      enable_event_handlers;
 extern int      obsess_over_services;
 extern int      obsess_over_hosts;
@@ -222,15 +217,10 @@
 
 extern int      date_format;
 
-extern contact		*contact_list;
-extern contactgroup	*contactgroup_list;
 extern host             *host_list;
-extern hostgroup	*hostgroup_list;
 extern service          *service_list;
 extern servicegroup     *servicegroup_list;
 extern notification     *notification_list;
-extern command          *command_list;
-extern timeperiod       *timeperiod_list;
 
 extern squeue_t *nagios_squeue;
 
@@ -248,8 +238,6 @@
 
 extern unsigned long   max_check_result_file_age;
 
-extern dbuf            check_result_dbuf;
-
 extern check_stats     check_statistics[MAX_CHECK_STATS_TYPES];
 
 extern char            *debug_file;
@@ -3509,7 +3497,6 @@
 
 	log_rotation_method = LOG_ROTATION_NONE;
 
-	last_command_status_update = 0L;
 	last_log_rotation = 0L;
 
 	max_parallel_service_checks = DEFAULT_MAX_PARALLEL_SERVICE_CHECKS;

Modified: nagioscore/trunk/cgi/avail.c
===================================================================
--- nagioscore/trunk/cgi/avail.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/avail.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -1679,7 +1679,6 @@
 	int have_some_real_data = FALSE;
 	hoststatus *hststatus = NULL;
 	servicestatus *svcstatus = NULL;
-	int first_real_state = AS_NO_DATA;
 	time_t initial_assumed_time;
 	int initial_assumed_state = AS_NO_DATA;
 	int error;
@@ -1723,9 +1722,6 @@
 
 					/* add a dummy archived state item, so something can get graphed */
 					add_archived_state(subject->last_known_state, AS_HARD_STATE, t1, "Current Host State Assumed (Faked Log Entry)", subject);
-
-					/* use the current state as the last known real state */
-					first_real_state = subject->last_known_state;
 					}
 				}
 			}
@@ -1747,9 +1743,6 @@
 
 					/* add a dummy archived state item, so something can get graphed */
 					add_archived_state(subject->last_known_state, AS_HARD_STATE, t1, "Current Service State Assumed (Faked Log Entry)", subject);
-
-					/* use the current state as the last known real state */
-					first_real_state = subject->last_known_state;
 					}
 				}
 			}
@@ -1981,7 +1974,6 @@
 /* computes availability times */
 void compute_subject_availability_times(int first_state, int last_state, time_t real_start_time, time_t start_time, time_t end_time, avail_subject *subject, archived_state *as) {
 	int start_state;
-	int end_state;
 	unsigned long state_duration;
 	struct tm *t;
 	unsigned long midnight_today;
@@ -2116,12 +2108,6 @@
 		subject->last_known_state = first_state;
 		}
 
-	/* special case if last entry was program stop */
-	if(last_state == AS_PROGRAM_END)
-		end_state = first_state;
-	else
-		end_state = last_state;
-
 	/* save "processed state" info */
 	as->processed_state = start_state;
 
@@ -2257,7 +2243,6 @@
 /* computes downtime times */
 void compute_subject_downtime_times(time_t start_time, time_t end_time, avail_subject *subject, archived_state *sd) {
 	archived_state *temp_as = NULL;
-	time_t part_start_time = 0L;
 	time_t part_subject_state = 0L;
 	int saved_status = 0;
 	int saved_stamp = 0;
@@ -2302,7 +2287,6 @@
 		}
 
 	/* initialize values */
-	part_start_time = start_time;
 	if(temp_as == NULL)
 		part_subject_state = AS_NO_DATA;
 	else if(temp_as->processed_state == AS_PROGRAM_START || temp_as->processed_state == AS_PROGRAM_END || temp_as->processed_state == AS_NO_DATA) {
@@ -3886,8 +3870,6 @@
 
 	char time_indeterminate_scheduled_string[48];
 	char time_indeterminate_unscheduled_string[48];
-	double percent_time_indeterminate_scheduled = 0.0;
-	double percent_time_indeterminate_unscheduled = 0.0;
 	char time_indeterminate_notrunning_string[48];
 	char time_indeterminate_nodata_string[48];
 	double percent_time_indeterminate_notrunning = 0.0;
@@ -3996,8 +3978,6 @@
 			percent_time_unreachable_scheduled = (double)(((double)temp_subject->scheduled_time_unreachable * 100.0) / (double)total_time);
 			percent_time_unreachable_unscheduled = percent_time_unreachable - percent_time_unreachable_scheduled;
 			percent_time_indeterminate = (double)(((double)time_indeterminate * 100.0) / (double)total_time);
-			percent_time_indeterminate_scheduled = (double)(((double)temp_subject->scheduled_time_indeterminate * 100.0) / (double)total_time);
-			percent_time_indeterminate_unscheduled = percent_time_indeterminate - percent_time_indeterminate_scheduled;
 			percent_time_indeterminate_notrunning = (double)(((double)temp_subject->time_indeterminate_notrunning * 100.0) / (double)total_time);
 			percent_time_indeterminate_nodata = (double)(((double)temp_subject->time_indeterminate_nodata * 100.0) / (double)total_time);
 			if(time_determinate > 0) {
@@ -4216,8 +4196,6 @@
 			percent_time_unreachable_scheduled = 0.0;
 			percent_time_unreachable_unscheduled = 0.0;
 			percent_time_indeterminate = 0.0;
-			percent_time_indeterminate_scheduled = 0.0;
-			percent_time_indeterminate_unscheduled = 0.0;
 			percent_time_indeterminate_notrunning = 0.0;
 			percent_time_indeterminate_nodata = 0.0;
 			percent_time_up_known = 0.0;
@@ -4241,8 +4219,6 @@
 				percent_time_unreachable_scheduled = (double)(((double)temp_subject->scheduled_time_unreachable * 100.0) / (double)total_time);
 				percent_time_unreachable_unscheduled = percent_time_unreachable - percent_time_unreachable_scheduled;
 				percent_time_indeterminate = (double)(((double)time_indeterminate * 100.0) / (double)total_time);
-				percent_time_indeterminate_scheduled = (double)(((double)temp_subject->scheduled_time_indeterminate * 100.0) / (double)total_time);
-				percent_time_indeterminate_unscheduled = percent_time_indeterminate - percent_time_indeterminate_scheduled;
 				percent_time_indeterminate_notrunning = (double)(((double)temp_subject->time_indeterminate_notrunning * 100.0) / (double)total_time);
 				percent_time_indeterminate_nodata = (double)(((double)temp_subject->time_indeterminate_nodata * 100.0) / (double)total_time);
 				if(time_determinate > 0) {
@@ -4386,8 +4362,6 @@
 
 	char time_indeterminate_scheduled_string[48];
 	char time_indeterminate_unscheduled_string[48];
-	double percent_time_indeterminate_scheduled = 0.0;
-	double percent_time_indeterminate_unscheduled = 0.0;
 	char time_indeterminate_notrunning_string[48];
 	char time_indeterminate_nodata_string[48];
 	double percent_time_indeterminate_notrunning = 0.0;
@@ -4486,8 +4460,6 @@
 			percent_time_critical_scheduled = (double)(((double)temp_subject->scheduled_time_critical * 100.0) / (double)total_time);
 			percent_time_critical_unscheduled = percent_time_critical - percent_time_critical_scheduled;
 			percent_time_indeterminate = (double)(((double)time_indeterminate * 100.0) / (double)total_time);
-			percent_time_indeterminate_scheduled = (double)(((double)temp_subject->scheduled_time_indeterminate * 100.0) / (double)total_time);
-			percent_time_indeterminate_unscheduled = percent_time_indeterminate - percent_time_indeterminate_scheduled;
 			percent_time_indeterminate_notrunning = (double)(((double)temp_subject->time_indeterminate_notrunning * 100.0) / (double)total_time);
 			percent_time_indeterminate_nodata = (double)(((double)temp_subject->time_indeterminate_nodata * 100.0) / (double)total_time);
 			if(time_determinate > 0) {
@@ -4547,10 +4519,7 @@
 
 
 		printf("<tr CLASS='dataEven'><td CLASS='dataEven' rowspan=3>Undetermined</td>");
-		/*
-		printf("<td CLASS='dataEven'>Unscheduled</td><td CLASS='dataEven'>%s</td><td CLASS='dataEven'>%2.3f%%</td><td CLASS='dataEven'></td></tr>\n",time_indeterminate_unscheduled_string,percent_time_indeterminate_unscheduled);
-		printf("<tr CLASS='dataEven'><td CLASS='dataEven'>Scheduled</td><td CLASS='dataEven'>%s</td><td CLASS='dataEven'>%2.3f%%</td><td CLASS='dataEven'></td></tr>\n",time_indeterminate_scheduled_string,percent_time_indeterminate_scheduled);
-		*/
+
 		printf("<td CLASS='dataEven'>Nagios Not Running</td><td CLASS='dataEven'>%s</td><td CLASS='dataEven'>%2.3f%%</td><td CLASS='dataEven'></td></tr>\n", time_indeterminate_notrunning_string, percent_time_indeterminate_notrunning);
 		printf("<tr CLASS='dataEven'><td CLASS='dataEven'>Insufficient Data</td><td CLASS='dataEven'>%s</td><td CLASS='dataEven'>%2.3f%%</td><td CLASS='dataEven'></td></tr>\n", time_indeterminate_nodata_string, percent_time_indeterminate_nodata);
 		printf("<tr CLASS='dataEven'><td CLASS='dataEven'>Total</td><td CLASS='dataEven'>%s</td><td CLASS='dataEven'>%2.3f%%</td><td CLASS='dataEven'></td></tr>\n", time_indeterminate_string, percent_time_indeterminate);
@@ -4626,8 +4595,6 @@
 			percent_time_critical_scheduled = 0.0;
 			percent_time_critical_unscheduled = 0.0;
 			percent_time_indeterminate = 0.0;
-			percent_time_indeterminate_scheduled = 0.0;
-			percent_time_indeterminate_unscheduled = 0.0;
 			percent_time_indeterminate_notrunning = 0.0;
 			percent_time_indeterminate_nodata = 0.0;
 			percent_time_ok_known = 0.0;
@@ -4657,8 +4624,6 @@
 				percent_time_critical_scheduled = (double)(((double)temp_subject->scheduled_time_critical * 100.0) / (double)total_time);
 				percent_time_critical_unscheduled = percent_time_critical - percent_time_critical_scheduled;
 				percent_time_indeterminate = (double)(((double)time_indeterminate * 100.0) / (double)total_time);
-				percent_time_indeterminate_scheduled = (double)(((double)temp_subject->scheduled_time_indeterminate * 100.0) / (double)total_time);
-				percent_time_indeterminate_unscheduled = percent_time_indeterminate - percent_time_indeterminate_scheduled;
 				percent_time_indeterminate_notrunning = (double)(((double)temp_subject->time_indeterminate_notrunning * 100.0) / (double)total_time);
 				percent_time_indeterminate_nodata = (double)(((double)temp_subject->time_indeterminate_nodata * 100.0) / (double)total_time);
 				if(time_determinate > 0) {

Modified: nagioscore/trunk/cgi/cgiauth.c
===================================================================
--- nagioscore/trunk/cgi/cgiauth.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/cgiauth.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -31,7 +31,6 @@
 
 extern char            main_config_file[MAX_FILENAME_LENGTH];
 
-extern hostgroup       *hostgroup_list;
 extern servicegroup    *servicegroup_list;
 
 extern int             use_authentication;

Modified: nagioscore/trunk/cgi/cgiutils.c
===================================================================
--- nagioscore/trunk/cgi/cgiutils.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/cgiutils.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -72,16 +72,8 @@
 int             lock_author_names = TRUE;
 
 extern time_t   program_start;
-extern int      nagios_pid;
-extern int      daemon_mode;
 extern int      enable_notifications;
 extern int      execute_service_checks;
-extern int      accept_passive_service_checks;
-extern int      enable_event_handlers;
-extern int      obsess_over_services;
-extern int      enable_failure_prediction;
-extern int      process_performance_data;
-extern time_t   last_log_rotation;
 
 int             check_external_commands = 0;
 
@@ -119,13 +111,6 @@
 int		color_transparency_index_g = 255;
 int		color_transparency_index_b = 255;
 
-extern hostgroup       *hostgroup_list;
-extern contactgroup    *contactgroup_list;
-extern command         *command_list;
-extern timeperiod      *timeperiod_list;
-extern contact         *contact_list;
-extern serviceescalation *serviceescalation_list;
-
 extern hoststatus      *hoststatus_list;
 extern servicestatus   *servicestatus_list;
 
@@ -1496,7 +1481,6 @@
 	char cgi_ssi_file[MAX_INPUT_BUFFER];
 	char raw_cgi_name[MAX_INPUT_BUFFER];
 	char *stripped_cgi_name;
-	int x;
 
 	/* common header or footer */
 	snprintf(common_ssi_file, sizeof(common_ssi_file) - 1, "%scommon-%s.ssi", physical_ssi_path, (type == SSI_HEADER) ? "header" : "footer");

Modified: nagioscore/trunk/cgi/extinfo.c
===================================================================
--- nagioscore/trunk/cgi/extinfo.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/extinfo.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -65,7 +65,6 @@
 extern char url_docs_path[MAX_FILENAME_LENGTH];
 extern char url_images_path[MAX_FILENAME_LENGTH];
 extern char url_logo_images_path[MAX_FILENAME_LENGTH];
-extern char log_file[MAX_FILENAME_LENGTH];
 
 extern int              enable_splunk_integration;
 

Modified: nagioscore/trunk/cgi/history.c
===================================================================
--- nagioscore/trunk/cgi/history.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/history.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -57,8 +57,6 @@
 extern char url_images_path[MAX_FILENAME_LENGTH];
 extern char url_stylesheets_path[MAX_FILENAME_LENGTH];
 
-extern int log_rotation_method;
-
 extern int enable_splunk_integration;
 
 authdata current_authdata;

Modified: nagioscore/trunk/cgi/notifications.c
===================================================================
--- nagioscore/trunk/cgi/notifications.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/notifications.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -37,9 +37,7 @@
 extern char url_docs_path[MAX_FILENAME_LENGTH];
 extern char url_stylesheets_path[MAX_FILENAME_LENGTH];
 
-extern int    log_rotation_method;
 
-
 #define FIND_HOST		1
 #define FIND_CONTACT		2
 #define FIND_SERVICE		3

Modified: nagioscore/trunk/cgi/outages.c
===================================================================
--- nagioscore/trunk/cgi/outages.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/outages.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -44,7 +44,6 @@
 extern char url_stylesheets_path[MAX_FILENAME_LENGTH];
 extern char url_images_path[MAX_FILENAME_LENGTH];
 extern char url_logo_images_path[MAX_FILENAME_LENGTH];
-extern char log_file[MAX_FILENAME_LENGTH];
 
 
 /* HOSTOUTAGE structure */

Modified: nagioscore/trunk/cgi/status.c
===================================================================
--- nagioscore/trunk/cgi/status.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/status.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -44,7 +44,6 @@
 extern char url_logo_images_path[MAX_FILENAME_LENGTH];
 extern char url_media_path[MAX_FILENAME_LENGTH];
 extern char url_js_path[MAX_FILENAME_LENGTH];
-extern char log_file[MAX_FILENAME_LENGTH];
 
 extern char *service_critical_sound;
 extern char *service_warning_sound;
@@ -5390,18 +5389,14 @@
 void create_pagenumbers(int total_entries,int visible_entries,char *temp_url,int type_service) {
 
 	int pages = 1;	 
-	int leftovers = 0; 
 	int tmp_start; 
 	int i;
-	int next_page;
 	int previous_page; 
 
 	/* do page numbers if applicable */ 
 	if(result_limit > 0 && total_entries > result_limit) {
 		pages = (total_entries / result_limit);  
-		leftovers = (total_entries % result_limit); 
 		previous_page = (page_start-result_limit) > 0 ? (page_start-result_limit) : 0;
-		next_page = (page_start+result_limit) > total_entries ? page_start : (page_start+result_limit);
 		printf("<div id='bottom_page_numbers'>\n");
 		printf("<div class='inner_numbers'>\n");		
 		printf("<a href='%s&start=0&limit=%i' class='pagenumber' title='First Page'><img src='%s%s' height='15' width='15' alt='<<' /></a>\n",temp_url,result_limit,url_images_path,FIRST_PAGE_ICON); 
@@ -5415,8 +5410,8 @@
 				printf("<a class='pagenumber' href='%s&start=%i&limit=%i' title='Page %i'> %i </a>\n",temp_url,tmp_start,result_limit,(i+1),(i+1));
 			}
 			
-		printf("<a href='%s&start=%i&limit=%i' class='pagenumber' title='Next Page'><img src='%s%s' height='15' width='10' alt='>' /></a>\n",temp_url,(page_start+result_limit),result_limit,url_images_path,NEXT_PAGE_ICON); 
-		printf("<a href='%s&start=%i&limit=%i' class='pagenumber' title='Last Page'><img src='%s%s' height='15' width='15' alt='>>' /></a>\n",temp_url,((pages)*result_limit),result_limit,url_images_path,LAST_PAGE_ICON);				
+		printf("<a href='%s&start=%i&limit=%i' class='pagenumber' title='Next Page'><img src='%s%s' height='15' width='10' alt='>' /></a>\n",temp_url,(page_start+result_limit),result_limit,url_images_path,NEXT_PAGE_ICON);
+		printf("<a href='%s&start=%i&limit=%i' class='pagenumber' title='Last Page'><img src='%s%s' height='15' width='15' alt='>>' /></a>\n",temp_url,((pages)*result_limit),result_limit,url_images_path,LAST_PAGE_ICON);
 		printf("</div> <!-- end inner_page_numbers div -->\n");
 		if(type_service == TRUE)
 			printf("<br /><div class='itemTotalsTitle'>Results %i - %i of %d Matching Services</div>\n</div>\n",page_start,((page_start+result_limit) > total_entries ? total_entries :(page_start+result_limit) ),total_entries );

Modified: nagioscore/trunk/cgi/statuswrl.c
===================================================================
--- nagioscore/trunk/cgi/statuswrl.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/statuswrl.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -1229,7 +1229,6 @@
 	double this_drawing_angle = 0.0;
 	double available_angle = 0.0;
 	double clipped_available_angle = 0.0;
-	double average_child_angle = 0.0;
 	double x_coord = 0.0;
 	double y_coord = 0.0;
 	host *temp_host;
@@ -1245,9 +1244,6 @@
 	/* calculate total drawing "width" of parent host */
 	parent_drawing_width = max_child_host_drawing_width(parent);
 
-	/* calculate average angle given to each child host */
-	average_child_angle = (double)(useable_angle / (double)immediate_children);
-
 	/* calculate initial drawing angle */
 	current_drawing_angle = start_angle;
 

Modified: nagioscore/trunk/cgi/summary.c
===================================================================
--- nagioscore/trunk/cgi/summary.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/summary.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -42,9 +42,7 @@
 extern service *service_list;
 extern servicegroup *servicegroup_list;
 
-extern int       log_rotation_method;
 
-
 /* output types */
 #define HTML_OUTPUT             0
 #define CSV_OUTPUT              1

Modified: nagioscore/trunk/cgi/tac.c
===================================================================
--- nagioscore/trunk/cgi/tac.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/cgi/tac.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -62,7 +62,6 @@
 extern char *normal_sound;
 
 extern host *host_list;
-extern hostgroup *hostgroup_list;
 extern hoststatus *hoststatus_list;
 extern servicestatus *servicestatus_list;
 

Modified: nagioscore/trunk/common/macros.c
===================================================================
--- nagioscore/trunk/common/macros.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/common/macros.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -41,14 +41,9 @@
 
 extern char     *illegal_output_chars;
 
-extern contact		*contact_list;
-extern contactgroup	*contactgroup_list;
 extern host             *host_list;
-extern hostgroup	*hostgroup_list;
 extern service          *service_list;
 extern servicegroup     *servicegroup_list;
-extern command          *command_list;
-extern timeperiod       *timeperiod_list;
 
 char *macro_x_names[MACRO_X_COUNT]; /* the macro names */
 char *macro_user[MAX_USER_MACROS]; /* $USERx$ macros */
@@ -1473,8 +1468,8 @@
 int grab_datetime_macro_r(nagios_macros *mac, int macro_type, char *arg1, char *arg2, char **output) {
 	time_t current_time = 0L;
 	timeperiod *temp_timeperiod = NULL;
-	time_t test_time = 0L;
 #ifdef NSCORE
+	time_t test_time = 0L;
 	time_t next_valid_time = 0L;
 #endif
 
@@ -1495,10 +1490,12 @@
 				return ERROR;
 
 			/* what timestamp should we use? */
+#ifdef NSCORE
 			if(arg2)
 				test_time = (time_t)strtoul(arg2, NULL, 0);
 			else
 				test_time = current_time;
+#endif
 			break;
 
 		default:

Modified: nagioscore/trunk/common/objects.c
===================================================================
--- nagioscore/trunk/common/objects.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/common/objects.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -60,7 +60,6 @@
 
 #ifdef NSCORE
 int __nagios_object_structure_version = CURRENT_OBJECT_STRUCTURE_VERSION;
-extern int use_precached_objects;
 #endif
 
 

Modified: nagioscore/trunk/t-tap/test_commands.c
===================================================================
--- nagioscore/trunk/t-tap/test_commands.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/t-tap/test_commands.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -48,7 +48,6 @@
 host *host_list;
 service *service_list;
 int accept_passive_service_checks;
-time_t last_command_status_update;
 int check_host_freshness;
 int check_service_freshness;
 int check_external_commands;

Modified: nagioscore/trunk/t-tap/test_nagios_config.c
===================================================================
--- nagioscore/trunk/t-tap/test_nagios_config.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/t-tap/test_nagios_config.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -126,7 +126,6 @@
 char            *last_program_version = NULL;
 char            *new_program_version = NULL;
 
-time_t          last_command_status_update = 0L;
 time_t          last_log_rotation = 0L;
 
 int             use_aggressive_host_checking = DEFAULT_AGGRESSIVE_HOST_CHECKING;
@@ -241,8 +240,6 @@
 check_result    check_result_info;
 unsigned long	max_check_result_file_age = DEFAULT_MAX_CHECK_RESULT_AGE;
 
-dbuf            check_result_dbuf;
-
 check_stats     check_statistics[MAX_CHECK_STATS_TYPES];
 
 char            *debug_file;

Modified: nagioscore/trunk/t-tap/test_timeperiods.c
===================================================================
--- nagioscore/trunk/t-tap/test_timeperiods.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/t-tap/test_timeperiods.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -126,7 +126,6 @@
 char            *last_program_version = NULL;
 char            *new_program_version = NULL;
 
-time_t          last_command_status_update = 0L;
 time_t          last_log_rotation = 0L;
 
 int             use_aggressive_host_checking = DEFAULT_AGGRESSIVE_HOST_CHECKING;
@@ -240,8 +239,6 @@
 check_result    check_result_info;
 unsigned long	max_check_result_file_age = DEFAULT_MAX_CHECK_RESULT_AGE;
 
-dbuf            check_result_dbuf;
-
 check_stats     check_statistics[MAX_CHECK_STATS_TYPES];
 
 char            *debug_file;

Modified: nagioscore/trunk/xdata/xsddefault.c
===================================================================
--- nagioscore/trunk/xdata/xsddefault.c	2012-08-13 15:18:17 UTC (rev 2062)
+++ nagioscore/trunk/xdata/xsddefault.c	2012-08-13 15:19:56 UTC (rev 2063)
@@ -89,8 +89,6 @@
 extern int enable_flap_detection;
 extern int enable_failure_prediction;
 extern int process_performance_data;
-extern int aggregate_status_updates;
-extern int check_external_commands;
 
 extern time_t         last_update_check;
 extern char           *last_program_version;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Nagios-commits mailing list