Commit a61eb361 authored by Alexander Wirt's avatar Alexander Wirt

Imported Upstream version 1.4.0

parent 9543d5f7

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
......@@ -2,6 +2,7 @@ Bernd Arnold
Hendrik Baecker
Ricardo Bartels
Jochen Bern
Matthew Brooks
Rune Darrud
Karl DeBisschop
Carsten Emde
......@@ -20,6 +21,7 @@ Petya Kohts
Julius Kriukas
Joerg Linge
Opsera Ltd
Opsview Team
Michael Luebben
Christoph Maser
Bill McGonigle
......
#######################
Icinga 1.3.x Change Log
Icinga 1.4.x Change Log
#######################
1.3.1 - ??/??/2011
1.4.0 - 11/05/2011
ENHANCEMENTS
* core: re-allow perfdata with empty results being put on perfdata channel, disable via opt-in cfg option #1413
* core: add downtime delete commands made "distributable" by deleting by host group name, host name or start time/comment (Opsview team) #1344
* core: add 'module' as object config, allowing cfg_dir usage loading multiple modules without touching broker_module in icinga.cfg #162
* classic ui: merged reading of logfiles into one function. It's easier now to add enhancements. #972
* classic ui: Adding some more icons to showlog.cgi #1239
* classic ui: adding entry time of comments in tooltip's in status.cgi #1244
* classic ui: Searching in the Icinga Logfile #516
* classic ui: changed print_generic_error() function to support csv output #1270
* classic ui: Added parameter to get_log_entries() function to use beginning and end timestamp #1271
* classic ui: Show downtime in host detail and service detail view #1141
* classic ui: Store cmd.cgi submissions in log #1161
* classic ui: enforce a need for comment for action taken in cmd.cgi #610
* classic ui: Add config option to set start of week (sunday/monday) #1269
* classic ui: Allow display of Network Outages for authorized hosts #1320 (thx mjbrooks)
* classic ui: remove useless memory allocation when reading logfiles reverse (lifo) #1387
* classic ui: speed up data processing in summary.cgi #1392
* classic ui: Add an alternative CGI driven view for the top frame (Matthew Brooks) #1406
** hosts/services counts with active unack, passiv unack, acked, totals (title tooltip)
** performance information on the right
** added urls and appropriate url filters
* classic ui: Added json output "&jsonoutput" to nearly all pages in classic ui #1217
* classic ui: allow searching for host display_name normal and via regexp #1393
* classic ui: display host/service dependencies in host/service details in extinfo.cgi #1300
* classic ui: add module object definition for viewing with config.cgi including csv+json output #162
* idoutils: add db socket as config option in ido2db.cfg for mysql and postgresql #1107
* idoutils: reduce housekeeping cycle to every 3600s, set housekeeping thread startup delay to 300s #1157
* idoutils: introduce schema version and check against that instead of program version #1368
* idoutils: install sample (commented) config in modules/idoutils.cfg using new 'module' object config #162
* idoutils: add configure flag to set ido instance_name other than 'default' in idomod.cfg #1167
* config: increase default debug file size to 100M #1316
* install: add --with-ext-cmd-file-dir= to configure, allowing icinga.cmd dir to be altered #1268
* install: add make option to install doxygen development docu "install-dev-docu" #1309
FIXES
* core: fix flexible downtime on service hard state change doesn't get triggered/activated #1128
* core: fix timeperiods daylight saving time problem (Luca Di Stefano) #1370
* classic ui: fixed csv export link to make it XSS save (IE) #1275
* classic ui: statusmap.cgi: fixed XSS vulnerability #1281
* classic ui: Fixing tooltip's in status.cgi, not showing messages with carriage return #1244
* classic ui: fixed csv export link to make it XSS save (IE) #1275
* classic ui: cmd.cgi: acknowledgement multiline comment -> command not being processed #1257
* classic ui: statusmap.cgi: fixed XSS vulnerability #1281
* classic ui: fix display_name survive reconfiguration and is use instead of host_name in classic ui #1282
* classic ui: don't show pause/continue urls on non-refreshable pages
* classic ui: fix segfaults if no default_user_name= given in cgi.cfg #1289
* classic ui: Prevent statusmap.cgi markup from drawing when host should not be drawn (Matthew Brooks) #1383
* idoutils: update oracle hints in ido2db.cfg with tnsnames.ora and port cfg #1283
* idoutils: fix rdbms reconnect after connection error #1313
* idoutils: idomod: larger buffer size (by Opsview) #1286
* idoutils: fix rdbms deconnect after connection error #1313
* idoutils: fix race condition when issueing multiple reloads results in hanging IDO2DB processes #1410
* idoutils: fix postgresql: integer not big enough for bytes_processed (Stig Sandbeck) #1401
* install: use *.so instead of *.o for solaris, patch in contrib/solaris/ #524
1.3.0 - 16/02/2011
......
......@@ -35,6 +35,7 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
LOGDIR=@localstatedir@
CHECKRESULTDIR=@CHECKRESULTDIR@
EXTCMDFILEDIR=@EXTCMDFILEDIR@
CFGDIR=@sysconfdir@
BINDIR=@bindir@
CGIDIR=@sbindir@
......@@ -74,7 +75,7 @@ MKDIR=/bin/mkdir
###############################
# Global
###############################
ICINGA_VERSION=1.3.1
ICINGA_VERSION=1.4.0
CP=@CP@
......@@ -110,6 +111,7 @@ none:
@printf "\t%-23s - %s\n" "install-commandmode" "install external command file"
@printf "\t%-23s - %s\n" "install-idoutils" "install idoutils module"
@printf "\t%-23s - %s\n" "install-api" "install php api"
@printf "\t%-23s - %s\n" "install-dev-docu" "install doxygen development documentation"
# FreeBSD make does not support -C option, so we'll use the Apache style... (patch by Stanley Hopcroft 12/27/1999)
......@@ -352,6 +354,9 @@ submodule-update-latest:
install-html:
cd $(SRC_HTM) && $(MAKE) install
install-dev-docu:
cd $(SRC_HTM) && $(MAKE) install-dev-docu
install-base:
cd $(SRC_BASE) && $(MAKE) install
......@@ -411,6 +416,7 @@ install-basic:
install-config:
$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)/objects
$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)/modules
$(INSTALL) -b -m 664 $(INSTALL_OPTS) sample-config/icinga.cfg $(DESTDIR)$(CFGDIR)/icinga.cfg
$(INSTALL) -b -m 660 $(INSTALL_OPTS) sample-config/resource.cfg $(DESTDIR)$(CFGDIR)/resource.cfg
$(INSTALL) -b -m 664 $(INSTALL_OPTS) sample-config/cgi.cfg $(DESTDIR)$(CFGDIR)/cgi.cfg
......@@ -485,8 +491,8 @@ install-daemoninit:
install-commandmode:
$(INSTALL) -m 775 $(COMMAND_OPTS) -d $(DESTDIR)$(LOGDIR)/rw
chmod g+s $(DESTDIR)$(LOGDIR)/rw
$(INSTALL) -m 775 $(COMMAND_OPTS) -d $(DESTDIR)$(EXTCMDFILEDIR)
chmod g+s $(DESTDIR)$(EXTCMDFILEDIR)
@echo ""
@echo "*** External command directory configured ***"
......@@ -511,36 +517,56 @@ fullinstall:
# Solaris pkgmk
PACKDIR=@PACKDIR@
VERSION=@VERSION@
SOL_PKG_NAME=@SOL_PKG_NAME@
SUN_OS_RELEASE=$(shell uname -r | cut -f2 -d. )
SUN_PLATFORM=$(shell uname -p)
Prototype:
if [ ! -d $(PACKDIR) ] ; then mkdir $(PACKDIR); fi
if [ ! -d $(PACKDIR)/etc ] ; then mkdir $(PACKDIR)/etc; fi
if [ ! -d $(PACKDIR)/etc/init.d ] ; then mkdir $(PACKDIR)/etc/init.d; fi
if [ ! -d $(PACKDIR)/etc/icinga ] ; then mkdir $(PACKDIR)/etc/icinga; fi
rm -rf $(PACKDIR)
mkdir -p $(PACKDIR)
mkdir -p $(PACKDIR)/$(CFGDIR)/objects
$(MAKE) all
$(MAKE) DESTDIR=$(PACKDIR) INIT_OPTS='' INSTALL_OPTS='' COMMAND_OPTS='' icinga_grp='' icinga_usr='' fullinstall
$(INSTALL) -m 644 sample-config/icinga.cfg $(PACKDIR)$(CFGDIR)/icinga.cfg.$(VERSION)
$(INSTALL) -m 644 sample-config/cgi.cfg $(PACKDIR)$(CFGDIR)/cgi.cfg.$(VERSION)
$(INSTALL) -m 640 sample-config/resource.cfg $(PACKDIR)$(CFGDIR)/resource.cfg.$(VERSION)
$(INSTALL) -m 664 sample-config/template-object/bigger.cfg $(PACKDIR)$(CFGDIR)/bigger.cfg.$(VERSION)
$(INSTALL) -m 664 sample-config/template-object/minimal.cfg $(PACKDIR)$(CFGDIR)/minimal.cfg.$(VERSION)
$(INSTALL) -m 664 sample-config/template-object/checkcommands.cfg $(PACKDIR)$(CFGDIR)/checkcommands.cfg.$(VERSION)
$(INSTALL) -m 664 sample-config/template-object/misccommands.cfg $(PACKDIR)$(CFGDIR)/misccommands.cfg.$(VERSION)
cd contrib; $(MAKE) all; $(MAKE) DESTDIR=$(PACKDIR) INIT_OPTS='' INSTALL_OPTS='' COMMAND_OPTS='' icinga_grp='' icinga_usr='' install
echo i pkginfo> Prototype
if [ -f checkinstall ] ; then echo i checkinstall>> Prototype; fi
if [ -f preinstall ] ; then echo i preinstall>> Prototype; fi
if [ -f postinstall ] ; then echo i postinstall>> Prototype; fi
pkgproto $(PACKDIR)=/ | sed -e "s|$(LOGNAME) $(GROUP)$$|root root|" | egrep -v "(s|d) none (/|/etc|/var|/usr|/usr/local) " >> Prototype
$(MAKE) DESTDIR=$(PACKDIR) INIT_OPTS='' INSTALL_OPTS='' COMMAND_OPTS='' icinga_grp='' icinga_usr='' \
install install-commandmode install-webconf install-idoutils
cd sample-config; \
for file in *.cfg; \
do \
$(INSTALL) -m 644 $$file $(PACKDIR)/$(CFGDIR)/$$file.$(VERSION); \
done
chmod 640 $(PACKDIR)/$(CFGDIR)/resource.cfg.$(VERSION)
cd sample-config/template-object; \
for file in *.cfg; \
do \
$(INSTALL) -m 644 $$file $(PACKDIR)/$(CFGDIR)/objects/$$file.$(VERSION); \
done
mkdir -p $(PACKDIR)/lib/svc/method/
$(INSTALL) -o root -g bin -m 555 daemon-init $(PACKDIR)/lib/svc/method/icinga
mkdir -p $(PACKDIR)/var/svc/manifest/application/
$(INSTALL) -m 444 -o root -g root solaris/icinga.xml $(PACKDIR)/var/svc/manifest/application/
#cd contrib; $(MAKE) all; $(MAKE) DESTDIR=$(PACKDIR) INIT_OPTS='' INSTALL_OPTS='' COMMAND_OPTS='' icinga_grp='' icinga_usr='' install
echo i pkginfo > solaris/Prototype
if [ -f solaris/checkinstall.in ] ; then cat solaris/checkinstall.in | sed 's/!SUN_PLATFORM!/$(SUN_PLATFORM)/g' > solaris/checkinstall; fi
cd solaris; \
for file in checkinstall preinstall postinstall preremove postremove depend i.manifest r.manifest; \
do \
if [ -f $$file ] ; then echo i $$file >> Prototype; fi ; \
done
pkgproto $(PACKDIR)=/ | sed -e "s|$(LOGNAME) $(GROUP)$$|root root|" | egrep -v "(s|d) none (/ |/var|/usr|/etc|/lib)" >> solaris/Prototype
pkg/icinga/pkgmap: Prototype
mkdir $(PACKDIR)/icinga
pkgmk -o -r / -f Prototype -d $(PACKDIR) icinga
mkdir $(PACKDIR)/$(SOL_PKG_NAME)
cd solaris; pkgmk -o -r / -f Prototype -d $(PACKDIR) $(SOL_PKG_NAME)
icinga.sun.pkg.tar.gz: pkg/icinga/pkgmap
cd $(PACKDIR) && tar -cf - icinga | gzip -9 -c > ../icinga-$(VERSION)-Sol$(SUN_OS_RELEASE)-$(SUN_PLATFORM).pkg.tar.gz
icinga.SPARC.pkg.tar.gz: pkg/icinga/pkgmap
cd $(PACKDIR) && tar -cf - icinga | gzip -9 -c > ../icinga.SPARC.pkg.tar.gz
icinga.sun.pkg: pkg/icinga/pkgmap
pkgtrans -s $(PACKDIR) ../icinga-$(VERSION)-Sol$(SUN_OS_RELEASE)-$(SUN_PLATFORM).pkg $(SOL_PKG_NAME)
pkgset: icinga.SPARC.pkg.tar.gz
pkgsettar: icinga.sun.pkg.tar.gz
pkgset: icinga.sun.pkg
pkgclean:
rm -rf pkg Prototype icinga.SPARC.pkg.tar.gz
rm -rf solaris_pkg solaris/Prototype icinga-$(VERSION)-$(SUN_PLATFORM).pkg.tar.gz icinga-$(VERSION)-$(SUN_PLATFORM).pkg
......@@ -79,6 +79,7 @@ in various ways. If we missed your name, let us know.
* Karl DeBisschop
* Tom De Blende
* Mark DeTrano
* Luca Di Stefano
* Thomas Dohl
* Mike Dorman
* Albrecht Dress
......@@ -282,6 +283,7 @@ in various ways. If we missed your name, let us know.
* Gordon Smith
* Lou Sneddon
* Mark Spieth
* Stig Sandbeck
* Tim Starling
* Thomas Stolle
* Kevin Stone
......
......@@ -125,6 +125,7 @@ extern unsigned long max_debug_file_size;
extern int use_embedded_perl;
#endif
int dummy; /* reduce compiler warnings */
/******************************************************************/
/********************* MISCELLANEOUS FUNCTIONS ********************/
......@@ -638,7 +639,7 @@ int run_async_service_check(service *svc, int check_options, double latency, int
/* open a temp file for storing check output */
old_umask=umask(new_umask);
asprintf(&output_file,"%s/checkXXXXXX",temp_path);
dummy=asprintf(&output_file,"%s/checkXXXXXX",temp_path);
check_result_info.output_file_fd=mkstemp(output_file);
if(check_result_info.output_file_fd>=0)
check_result_info.output_file_fp=fdopen(check_result_info.output_file_fd,"w");
......@@ -1153,11 +1154,11 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
else if(queued_check_result->return_code<0 || queued_check_result->return_code>3){
if ( queued_check_result->return_code==126 ) {
asprintf(&temp_service->plugin_output,"The command defined for service %s is not an executable\n", queued_check_result->service_description);
dummy=asprintf(&temp_service->plugin_output,"The command defined for service %s is not an executable\n", queued_check_result->service_description);
} else if ( queued_check_result->return_code==127 ) {
asprintf(&temp_service->plugin_output,"The command defined for service %s does not exist\n", queued_check_result->service_description);
dummy=asprintf(&temp_service->plugin_output,"The command defined for service %s does not exist\n", queued_check_result->service_description);
} else {
asprintf(&temp_service->plugin_output, "Return code of %d is out of bounds", queued_check_result->return_code);
dummy=asprintf(&temp_service->plugin_output, "Return code of %d is out of bounds", queued_check_result->return_code);
}
logit(NSLOG_RUNTIME_WARNING,TRUE,"%s",temp_service->plugin_output);
......@@ -2900,7 +2901,7 @@ int execute_sync_host_check_3x(host *hst){
if(early_timeout==TRUE){
my_free(temp_plugin_output);
asprintf(&temp_plugin_output,"Host check timed out after %d seconds\n",host_check_timeout);
dummy=asprintf(&temp_plugin_output,"Host check timed out after %d seconds\n",host_check_timeout);
/* log the timeout */
logit(NSLOG_RUNTIME_WARNING,TRUE,"Warning: Host check command '%s' for host '%s' timed out after %d seconds\n",processed_command,hst->name,host_check_timeout);
......@@ -3156,7 +3157,7 @@ int run_async_host_check_3x(host *hst, int check_options, double latency, int sc
/* open a temp file for storing check output */
old_umask=umask(new_umask);
asprintf(&output_file,"%s/checkXXXXXX",temp_path);
dummy=asprintf(&output_file,"%s/checkXXXXXX",temp_path);
check_result_info.output_file_fd=mkstemp(output_file);
if(check_result_info.output_file_fd>=0)
check_result_info.output_file_fp=fdopen(check_result_info.output_file_fd,"w");
......@@ -3534,7 +3535,7 @@ int handle_async_host_check_result_3x(host *temp_host, check_result *queued_chec
my_free(temp_host->long_plugin_output);
my_free(temp_host->perf_data);
asprintf(&temp_host->plugin_output,"(Return code of %d is out of bounds%s)",queued_check_result->return_code,(queued_check_result->return_code==126 || queued_check_result->return_code==127)?" - plugin may be missing":"");
dummy=asprintf(&temp_host->plugin_output,"(Return code of %d is out of bounds%s)",queued_check_result->return_code,(queued_check_result->return_code==126 || queued_check_result->return_code==127)?" - plugin may be missing":"");
result=STATE_CRITICAL;
}
......
......@@ -89,7 +89,7 @@ extern pthread_t worker_threads[TOTAL_WORKER_THREADS];
extern circular_buffer external_command_buffer;
extern int external_command_buffer_slots;
int dummy; /* reduce compiler warnings */
/******************************************************************/
/****************** EXTERNAL COMMAND PROCESSING *******************/
......@@ -449,6 +449,13 @@ int process_external_command1(char *cmd){
command_type=CMD_SCHEDULE_HOST_SVC_DOWNTIME;
else if(!strcmp(command_id,"DEL_HOST_DOWNTIME"))
command_type=CMD_DEL_HOST_DOWNTIME;
else if(!strcmp(command_id,"DEL_DOWNTIME_BY_HOST_NAME"))
command_type=CMD_DEL_DOWNTIME_BY_HOST_NAME;
else if(!strcmp(command_id,"DEL_DOWNTIME_BY_HOSTGROUP_NAME"))
command_type=CMD_DEL_DOWNTIME_BY_HOSTGROUP_NAME;
else if(!strcmp(command_id,"DEL_DOWNTIME_BY_START_TIME_COMMENT"))
command_type=CMD_DEL_DOWNTIME_BY_START_TIME_COMMENT;
else if(!strcmp(command_id,"ENABLE_HOST_FLAP_DETECTION"))
command_type=CMD_ENABLE_HOST_FLAP_DETECTION;
......@@ -753,9 +760,9 @@ int process_external_command1(char *cmd){
/* log the external command */
if(log_external_commands_user==TRUE){
asprintf(&temp_buffer,"EXTERNAL COMMAND: %s;%s;%s\n",command_id,username,args);
dummy=asprintf(&temp_buffer,"EXTERNAL COMMAND: %s;%s;%s\n",command_id,username,args);
} else {
asprintf(&temp_buffer,"EXTERNAL COMMAND: %s;%s\n",command_id,args);
dummy=asprintf(&temp_buffer,"EXTERNAL COMMAND: %s;%s\n",command_id,args);
}
if(command_type==CMD_PROCESS_SERVICE_CHECK_RESULT || command_type==CMD_PROCESS_HOST_CHECK_RESULT){
......@@ -1115,6 +1122,18 @@ int process_external_command2(int cmd, time_t entry_time, char *args){
cmd_delete_downtime(cmd,args);
break;
case CMD_DEL_DOWNTIME_BY_HOST_NAME:
cmd_delete_downtime_by_host_name(cmd,args);
break;
case CMD_DEL_DOWNTIME_BY_HOSTGROUP_NAME:
cmd_delete_downtime_by_hostgroup_name(cmd,args);
break;
case CMD_DEL_DOWNTIME_BY_START_TIME_COMMENT:
cmd_delete_downtime_by_start_time_comment(cmd,args);
break;
case CMD_CANCEL_ACTIVE_HOST_SVC_DOWNTIME:
case CMD_CANCEL_PENDING_HOST_SVC_DOWNTIME:
break;
......@@ -2651,8 +2670,171 @@ int cmd_delete_downtime(int cmd, char *args){
unschedule_downtime(SERVICE_DOWNTIME,downtime_id);
return OK;
}
}
/* Opsview enhancements: some of these commands are now "distributable" as no downtime ids are used */
/* Deletes scheduled host and service downtime based on hostname and optionally other filter arguments */
int cmd_delete_downtime_by_host_name(int cmd, char *args){
char *temp_ptr=NULL;
char *end_ptr=NULL;
char *hostname=NULL;
char *service_description=NULL;
char *downtime_comment=NULL;
time_t downtime_start_time=0L;
int deleted=0;
/* get the host name of the downtime to delete */
temp_ptr=my_strtok(args,";");
if(temp_ptr==NULL)
return ERROR;
hostname=temp_ptr;
/* get the optional service name */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
if(*temp_ptr!='\0')
service_description=temp_ptr;
/* get the optional start time */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
downtime_start_time=strtoul(temp_ptr,&end_ptr,10);
/* get the optional comment */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
if(*temp_ptr!='\0')
downtime_comment=temp_ptr;
}
}
}
deleted=delete_downtime_by_hostname_service_description_start_time_comment(hostname, service_description, downtime_start_time, downtime_comment);
if (deleted==0)
return ERROR;
return OK;
}
/* Opsview enhancement: Deletes scheduled host and service downtime based on hostgroup and optionally other filter arguments */
int cmd_delete_downtime_by_hostgroup_name(int cmd, char *args){
char *temp_ptr=NULL;
char *end_ptr=NULL;
host *temp_host=NULL;
hostgroup *temp_hostgroup=NULL;
hostsmember *temp_member=NULL;
char *service_description=NULL;
char *downtime_comment=NULL;
char *host_name=NULL;
time_t downtime_start_time=0L;
int deleted=0;
/* get the host group name of the downtime to delete */
temp_ptr=my_strtok(args,";");
if(temp_ptr==NULL)
return ERROR;
temp_hostgroup=find_hostgroup(temp_ptr);
if(temp_hostgroup==NULL)
return ERROR;
/* get the optional host name */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
if(*temp_ptr!='\0')
host_name=temp_ptr;
/* get the optional service name */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
if(*temp_ptr!='\0')
service_description=temp_ptr;
/* get the optional start time */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
downtime_start_time=strtoul(temp_ptr,&end_ptr,10);
/* get the optional comment */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
if(*temp_ptr!='\0')
downtime_comment=temp_ptr;
}
}
}
/* get the optional service name */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
if(*temp_ptr!='\0')
service_description=temp_ptr;
/* get the optional start time */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
downtime_start_time=strtoul(temp_ptr,&end_ptr,10);
/* get the optional comment */
temp_ptr=my_strtok(NULL,";");
if(temp_ptr!=NULL) {
if(*temp_ptr!='\0')
downtime_comment=temp_ptr;
}
}
}
}
for(temp_member=temp_hostgroup->members;temp_member!=NULL;temp_member=temp_member->next){
if((temp_host=(host *)temp_member->host_ptr)==NULL)
continue;
if(host_name!=NULL && strcmp(temp_host->name,host_name)!=0)
continue;
deleted=+delete_downtime_by_hostname_service_description_start_time_comment(temp_host->name, service_description, downtime_start_time, downtime_comment);
}
if (deleted==0)
return ERROR;
return OK;
}
/* Opsview enhancement: Delete downtimes based on start time and/or comment */
int cmd_delete_downtime_by_start_time_comment(int cmd, char *args){
time_t downtime_start_time=0L;
char *downtime_comment=NULL;
char *temp_ptr=NULL;
char *end_ptr=NULL;
int deleted=0;
/* Get start time if set */
temp_ptr=my_strtok(args,";");
if(temp_ptr!=NULL){
/* This will be set to 0 if no start_time is entered or data is bad */
downtime_start_time=strtoul(temp_ptr,&end_ptr,10);
}
/* Get comment - not sure if this should be also tokenised by ; */
temp_ptr=my_strtok(NULL,"\n");
if(temp_ptr!=NULL && *temp_ptr!='\0'){
downtime_comment=temp_ptr;
}
/* No args should give an error */
if(downtime_start_time==0 && downtime_comment==NULL)
return ERROR;
deleted=delete_downtime_by_hostname_service_description_start_time_comment(NULL,NULL,downtime_start_time,downtime_comment);
if (deleted==0)
return ERROR;
return OK;
}
/* changes a host or service (integer) variable */
......@@ -5022,7 +5204,7 @@ void process_passive_checks(void){
/* open a temp file for storing check result(s) */
old_umask=umask(new_umask);
asprintf(&checkresult_file,"%s/checkXXXXXX",temp_path);
dummy=asprintf(&checkresult_file,"%s/checkXXXXXX",temp_path);
checkresult_file_fd=mkstemp(checkresult_file);
umask(old_umask);
......
This diff is collapsed.
......@@ -48,6 +48,7 @@ extern service *service_list;
extern unsigned long modified_host_process_attributes;
extern unsigned long modified_service_process_attributes;
int dummy; /* reduce compiler warnings */
/******************************************************************/
/******************** FLAP DETECTION FUNCTIONS ********************/
......@@ -335,7 +336,7 @@ void set_service_flap(service *svc, double percent_change, double high_threshold
logit(NSLOG_RUNTIME_WARNING,FALSE,"SERVICE FLAPPING ALERT: %s;%s;STARTED; Service appears to have started flapping (%2.1f%% change >= %2.1f%% threshold)\n",svc->host_name,svc->description,percent_change,high_threshold);
/* add a non-persistent comment to the service */
asprintf(&temp_buffer,"Notifications for this service are being suppressed because it was detected as having been flapping between different states (%2.1f%% change >= %2.1f%% threshold). When the service state stabilizes and the flapping stops, notifications will be re-enabled.",percent_change,high_threshold);
dummy=asprintf(&temp_buffer,"Notifications for this service are being suppressed because it was detected as having been flapping between different states (%2.1f%% change >= %2.1f%% threshold). When the service state stabilizes and the flapping stops, notifications will be re-enabled.",percent_change,high_threshold);
add_new_service_comment(FLAPPING_COMMENT,svc->host_name,svc->description,time(NULL),"(Icinga Process)",temp_buffer,0,COMMENTSOURCE_INTERNAL,FALSE,(time_t)0,&(svc->flapping_comment_id));
my_free(temp_buffer);
......@@ -416,7 +417,7 @@ void set_host_flap(host *hst, double percent_change, double high_threshold, doub
logit(NSLOG_RUNTIME_WARNING,FALSE,"HOST FLAPPING ALERT: %s;STARTED; Host appears to have started flapping (%2.1f%% change > %2.1f%% threshold)\n",hst->name,percent_change,high_threshold);
/* add a non-persistent comment to the host */
asprintf(&temp_buffer,"Notifications for this host are being suppressed because it was detected as having been flapping between different states (%2.1f%% change > %2.1f%% threshold). When the host state stabilizes and the flapping stops, notifications will be re-enabled.",percent_change,high_threshold);
dummy=asprintf(&temp_buffer,"Notifications for this host are being suppressed because it was detected as having been flapping between different states (%2.1f%% change > %2.1f%% threshold). When the host state stabilizes and the flapping stops, notifications will be re-enabled.",percent_change,high_threshold);
add_new_host_comment(FLAPPING_COMMENT,hst->name,time(NULL),"(Icinga Process)",temp_buffer,0,COMMENTSOURCE_INTERNAL,FALSE,(time_t)0,&(hst->flapping_comment_id));
my_free(temp_buffer);
......
......@@ -3,7 +3,7 @@
* ICINGA.C - Core Program Code For Icinga
*
* Program: Icinga
* Version: 1.3.1
* Version: 1.4.0
* License: GPL
* Copyright (c) 1999-2009 Ethan Galstad (http://www.nagios.org)
* Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
......@@ -260,6 +260,7 @@ extern hostgroup *hostgroup_list;
extern command *command_list;
extern timeperiod *timeperiod_list;
extern serviceescalation *serviceescalation_list;
extern module *module_list;
notification *notification_list;
......@@ -281,7 +282,7 @@ int debug_level=DEFAULT_DEBUG_LEVEL;
int debug_verbosity=DEFAULT_DEBUG_VERBOSITY;
unsigned long max_debug_file_size=DEFAULT_MAX_DEBUG_FILE_SIZE;
int dummy; /* reduce compiler warnings */
/* Following main() declaration required by older versions of Perl ut 5.00503 */
......@@ -289,6 +290,7 @@ int main(int argc, char **argv, char **env){
int result;
int error=FALSE;
char *buffer=NULL;
char *dummy_c=NULL;
int display_license=FALSE;
int display_help=FALSE;
int c=0;
......@@ -474,7 +476,7 @@ int main(int argc, char **argv, char **env){
}
/* get absolute path of current working directory */
getcwd(config_file,MAX_FILENAME_LENGTH);
dummy_c=getcwd(config_file,MAX_FILENAME_LENGTH);
/* append a forward slash */
strncat(config_file,"/",1);
......@@ -671,11 +673,17 @@ int main(int argc, char **argv, char **env){
/* read in the configuration files (main and resource config files) */
result=read_main_config_file(config_file);
/* we need to read the modules in the first place as object configuration before neb modules are initialized/loaded */