Commit 14d71348 authored by Alexander Wirt's avatar Alexander Wirt

Imported Upstream version 1.6.0~beta

parent 932cd5ee
...@@ -2,9 +2,11 @@ Bernd Arnold ...@@ -2,9 +2,11 @@ Bernd Arnold
Hendrik Baecker Hendrik Baecker
Ricardo Bartels Ricardo Bartels
Jochen Bern Jochen Bern
Gunnar Beutner
Matthew Brooks Matthew Brooks
Rune Darrud Rune Darrud
Karl DeBisschop Karl DeBisschop
Thomas Dressler
Carsten Emde Carsten Emde
Andreas Ericsson Andreas Ericsson
Duncan Ferguson Duncan Ferguson
......
####################### #######################
Icinga 1.5.x Change Log Icinga 1.6.x Change Log
####################### #######################
Thanks to all contributers, testers and developers. Please read AUTHORS and THANKS for a detailed list :-) Thanks to all contributers, testers and developers. Please read AUTHORS and THANKS for a detailed list :-)
1.5.1 - 09/09/2011 1.6.0 - 30/11/2011
ENHANCEMENTS ENHANCEMENTS
* core: acknowledgements can now expire by providing an end_time through commands #770
* core: allow startup with no hosts/services/contacts defined, only warn #2015
* core: log error on non-existing host/service/contact/*group when sending a command to the core #1737
* core: reduce notification load by moving notification viability check into notification list creation (Opsview Team) #1744
* core: protect downtime and comment list modification with a lock (Andreas Ericsson) #2025
* core: determine last_program_stop from creation of retention.dat and use that for decision if passive checks are fresh or not (Andreas Ericsson) #2027
* core: add icinga startup delay checks to example configs, including perfdata #1937
* core: indicate event loop start in logs #2036
* core: add notifications to stalking hosts/services, not only logging/event handlers #1367
* core: add eventloop mutex, will be used by IcingaMQ #2040
* classic ui: add expiry option and end_time to acknowledgements on cmd.cgi #770
* classic ui: Acknowledge child hosts from on blocking outages #1858
* classic ui: add opt-in extinfo_show_child_hosts to show child hosts in extinfo.cgi #1820
* classic ui: add complete command line to config.cgi #1329
** if resource.cfg readable by webserver for $USERn$ macros
** adds host/service params to config.cgi to process their macros
* classic ui: Add more info of (ack, downtime, ... ) status to json export in status.cgi (ivo) #1988
* classic ui: add hostgroup and servicegroup summary to menu.html #2007
* classic ui: Change markup color for unreachable hosts in statusmap.c #1464
* idoutils: add SLA monitoring via opt-in enable_sla cfg option #2037
** pgsql timestamp with timezone changes remain experimental in SLA table
* idoutils: added end_time column for acknowledgelemts expiry #770
* idoutils: add Indices for notification queries for Icinga Web #1964
* idoutils: add option to format debug log timestamp like locale %c (debug_readable_timestamp in ido2db.cfg) #2033
* idoutils: add max_notifications_age, max_contactnotifications_age, max_contactnotificationmethods_age as housekeeping for notification tables #2051
* idoutils: use local timestamp datatype instead of date/datetime, store icinga timestamps as UTC #1954
* idoutils: change timestamp to use time zone by default in postgresql (thx Florian Helmberger) #2106
* config: add config examples for local monitoring - check_procs for ido2db #1870
FIXES
* core: fix downtime and comments delete with wrong loop pointers causing segfaults #1979
* core: fix $NOTIFICATIONRECIPIENTS$ macro contains all contacts assigned to host|service, not only notified contacts #2023
* core: plug memory leak in downtimes comment add (Dorian Guillois) #1979
* core: make first_notification_delay depend on the first !OK hard state change and don't reset timer for new hard states which would replace it (Rogerio F Cunha) #1918
* core: fix memory leak in xodtemplate.c (thx Dorian Guillois)
* classic ui: fix for Classic-UI displays bad timeperiods #1989
* classic ui: fixed wrong color in histogram and trends for unknown/unreachable #2042
* classic ui: fixed search not returning all results, only first match (without * at the end) #844
* classic ui: fixed wrong output from status.cgi with option hostservicedetail #2019
* classic ui: fix typo in histogram.c (thanks Sven-Göran Bergh)
* idoutils: host state change last_hard_state overrides last_state, last_hard_state always -1 #1932
* idoutils: extend conninfo.agent_version field to varchar(16) #2104
* idoutils: terminate threads cleanly, including db connection
* install: rework the version updates in icinga and idoutils
CHANGES
* package: complete remove icinga-api as module #1935
** Development is being discontinued for now, 1.5.0 was last combined release.
** remove files in module/icinga-api
** update configure and mark options deprecated
** mark as deprecated in Makefile, install-api spits out warning
** remove build from icinga.spec
** add module/icinga-api/README for further instructions for non Changelog readers
* core: new commands and event
** CMD_ACKNOWLEDGE_HOST_PROBLEM_EXPIRE 174
** CMD_ACKNOWLEDGE_SVC_PROBLEM_EXPIRE 175
** EVENT_EXPIRE_ACKNOWLEDGEMENT
* core: new notification type (internal and macros)
** NOTIFICATION_STALKING
* classic ui: "showlog_initial_states" and "showlog_current_states" are now disabled by default to prevent browser freezes #1172
* classic ui: highlight_table_rows is now enabled by default #1777
* classic ui: removed unused javascript libraries
** html/js/: builder.js, controls.js, dragdrop.js, effects.js, slider.js, sound.js, mootools.js
* classicui: new regex search uses 'search_string' instead of 'navbarsearch=1&host=', both are kept for compatibility reasons #844
* icinga.cfg: stalking_notifications_for_hosts=0 stalking_notifications_for_services=0
* cgi.cfg: default_expiring_acknowledgement_duration=86400
* cgi.cfg: extinfo_show_child_hosts=0 added
* cgi.cfg: authorized_for_full_command_resolution and authorized_contactgroup_for_full_command_resolution added
* add objects/ido2db_check_proc.cfg (not included by default) #1870
* ido2db.cfg
** enable_sla=0
** debug_readable_timestamp=0
** max_notifications_age, max_contactnotifications_age, max_contactnotificationmethods_age
1.5.1 - 09/09/2011
FIXES FIXES
* core: free memory allocated notification macros right after sending the notification, not in next notification * core: free memory allocated notification macros right after sending the notification, not in next notification
* classic ui: fix Localization: Form validation message could be improved (thx Mario Rimann) #1849 * classic ui: fix Localization: Form validation message could be improved (thx Mario Rimann) #1849
* classic ui: fix wrong titles in list of scheduled downtimes (thx Mario Rimann) #1848 * classic ui: fix wrong titles in list of scheduled downtimes (thx Mario Rimann) #1848
* classic ui: fix host and service names are not allowed to have a '+' included #1843 * classic ui: fix host and service names are not allowed to have a '+' included #1843
* claasic ui: fix service overview for single hostgroups when show_partial_hostgroups is switched on #1013
* claasic ui: fix authorized_for_all_hosts/authorized_for_all_services retruns true for historical data #1166
* idoutils: idomod: change stacked memory allocation for broker_data IDO_MAX_BUFLEN #1879 * idoutils: idomod: change stacked memory allocation for broker_data IDO_MAX_BUFLEN #1879
* idoutils: fix idomod should log more verbose on errors, asking for a running ido2db process #1885 * idoutils: fix idomod should log more verbose on errors, asking for a running ido2db process #1885
...@@ -23,6 +113,7 @@ FIXES ...@@ -23,6 +113,7 @@ FIXES
CHANGES CHANGES
1.5.0 - 24/08/2011 1.5.0 - 24/08/2011
ENHANCEMENTS ENHANCEMENTS
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
Classic-UI JSON Change Log Classic-UI JSON Change Log
####################### #######################
1.6.0 - only values added, no existing values changed
* add more info of (ack, downtime, ... ) status to json export in status.cgi (ivo) #1988
1.5.0 - only values added, no existing values changed 1.5.0 - only values added, no existing values changed
* added service breakdowns in hosts to avail.cgi * added service breakdowns in hosts to avail.cgi
......
...@@ -19,7 +19,6 @@ SRC_IDOUTILS=@srcdir@/module/idoutils ...@@ -19,7 +19,6 @@ SRC_IDOUTILS=@srcdir@/module/idoutils
SRC_TTAP=@srcdir@/t-tap SRC_TTAP=@srcdir@/t-tap
SRC_TAP=@srcdir@/tap SRC_TAP=@srcdir@/tap
SRC_T=@srcdir@/t SRC_T=@srcdir@/t
SRC_ICINGAAPI=@srcdir@/module/icinga-api
SRC_DOCBOOK=@srcdir@/docbook SRC_DOCBOOK=@srcdir@/docbook
SRC_DOCBOOK_DE=@srcdir@/docbook/de SRC_DOCBOOK_DE=@srcdir@/docbook/de
SRC_DOCBOOK_EN=@srcdir@/docbook/en SRC_DOCBOOK_EN=@srcdir@/docbook/en
...@@ -78,7 +77,7 @@ MKDIR=/bin/mkdir ...@@ -78,7 +77,7 @@ MKDIR=/bin/mkdir
############################### ###############################
# Global # Global
############################### ###############################
ICINGA_VERSION=1.5.1 ICINGA_VERSION=1.6.0-beta
CP=@CP@ CP=@CP@
...@@ -104,7 +103,7 @@ none: ...@@ -104,7 +103,7 @@ none:
@printf "\t%-23s - %s\n" "idoutils" "icinga idoutils" @printf "\t%-23s - %s\n" "idoutils" "icinga idoutils"
@printf "\nInstall targets:\n" @printf "\nInstall targets:\n"
@printf "\t%-23s - %s\n" "install" "install core, cgis, api, html" @printf "\t%-23s - %s\n" "install" "install core, cgis, html"
@printf "\t%-23s - %s\n" "install-base" "install core" @printf "\t%-23s - %s\n" "install-base" "install core"
@printf "\t%-23s - %s\n" "install-cgis" "install classical web" @printf "\t%-23s - %s\n" "install-cgis" "install classical web"
@printf "\t%-23s - %s\n" "install-html" "install html files" @printf "\t%-23s - %s\n" "install-html" "install html files"
...@@ -113,7 +112,7 @@ none: ...@@ -113,7 +112,7 @@ none:
@printf "\t%-23s - %s\n" "install-init" "install init script" @printf "\t%-23s - %s\n" "install-init" "install init script"
@printf "\t%-23s - %s\n" "install-commandmode" "install external command file" @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-idoutils" "install idoutils module"
@printf "\t%-23s - %s\n" "install-api" "install php api" @printf "\t%-23s - %s\n" "install-api" "install php api !!DEPRECATED!!" # FIXME remove in 1.7.0
@printf "\t%-23s - %s\n" "install-dev-docu" "install doxygen development documentation" @printf "\t%-23s - %s\n" "install-dev-docu" "install doxygen development documentation"
...@@ -145,7 +144,7 @@ all: ...@@ -145,7 +144,7 @@ all:
@echo "" @echo ""
@echo " make install" @echo " make install"
@echo " - This installs the main program (Icinga Core), CGIs" @echo " - This installs the main program (Icinga Core), CGIs"
@echo " (Classical Web), API, and HTML files" @echo " (Classical Web), and HTML files"
@echo "" @echo ""
@echo " make install-init" @echo " make install-init"
@echo " - This installs the init script in $(DESTDIR)$(INIT_DIR)" @echo " - This installs the init script in $(DESTDIR)$(INIT_DIR)"
...@@ -159,7 +158,7 @@ all: ...@@ -159,7 +158,7 @@ all:
@echo " destination directory" @echo " destination directory"
@echo "" @echo ""
@echo " make install-api" @echo " make install-api"
@echo " - This installs the Icinga API in $(DESTDIR)$(HTMLDIR)" @echo " - This installs the Icinga API !!DEPRECATED!!" # FIXME remove in 1.7.0
@echo "" @echo ""
@echo " make install-config" @echo " make install-config"
@echo " - This installs *SAMPLE* config files in $(DESTDIR)$(CFGDIR)" @echo " - This installs *SAMPLE* config files in $(DESTDIR)$(CFGDIR)"
...@@ -252,9 +251,6 @@ clean: ...@@ -252,9 +251,6 @@ clean:
@if [ x$(USE_LIBTAP) = xyes ]; then \ @if [ x$(USE_LIBTAP) = xyes ]; then \
cd $(SRC_TAP) && $(MAKE) $@; \ cd $(SRC_TAP) && $(MAKE) $@; \
fi fi
@if [ x$(USE_ICINGAAPI) = xyes ]; then \
cd $(SRC_ICINGAAPI) && $(MAKE) $@; \
fi
rm -f *.cfg core rm -f *.cfg core
rm -f *~ *.*~ */*~ */*.*~ */*/*.*~ rm -f *~ *.*~ */*~ */*.*~ */*/*.*~
...@@ -274,9 +270,6 @@ distclean: clean ...@@ -274,9 +270,6 @@ distclean: clean
@if [ x$(USE_LIBTAP) = xyes ]; then \ @if [ x$(USE_LIBTAP) = xyes ]; then \
cd $(SRC_TAP) && $(MAKE) $@; \ cd $(SRC_TAP) && $(MAKE) $@; \
fi fi
@if [ x$(USE_ICINGAAPI) = xyes ]; then \
cd $(SRC_ICINGAAPI) && $(MAKE) $@; \
fi
rm -f sample-config/*.cfg sample-config/*.conf sample-config/template-object/*.cfg rm -f sample-config/*.cfg sample-config/*.conf sample-config/template-object/*.cfg
rm -f daemon-init pkginfo rc.ido2db daemon-init-redhat rm -f daemon-init pkginfo rc.ido2db daemon-init-redhat
...@@ -338,15 +331,13 @@ create-doxygen: ...@@ -338,15 +331,13 @@ create-doxygen:
submodule-init: submodule-init:
git submodule init docbook git submodule init docbook
git submodule init module/icinga-api
submodule-update: submodule-update:
git submodule update git submodule update
submodule-update-latest: submodule-update-latest:
cd ${SRC_DOCBOOK} && git checkout master && git pull origin master cd ${SRC_DOCBOOK} && git checkout master && git pull origin master
cd ${SRC_ICINGAAPI} && git checkout master && git pull origin master @echo "pulled latest docbook :)"
@echo "pulled latest docbook & icinga-api :)"
############################### ###############################
...@@ -371,7 +362,6 @@ install: ...@@ -371,7 +362,6 @@ install:
cd $(SRC_CGI) && $(MAKE) $@ cd $(SRC_CGI) && $(MAKE) $@
cd $(SRC_HTM) && $(MAKE) $@ cd $(SRC_HTM) && $(MAKE) $@
$(MAKE) install-api
$(MAKE) install-basic $(MAKE) install-basic
install-unstripped: install-unstripped:
...@@ -379,7 +369,6 @@ install-unstripped: ...@@ -379,7 +369,6 @@ install-unstripped:
cd $(SRC_CGI) && $(MAKE) $@ cd $(SRC_CGI) && $(MAKE) $@
cd $(SRC_HTM) && $(MAKE) $@ cd $(SRC_HTM) && $(MAKE) $@
$(MAKE) install-api
$(MAKE) install-basic $(MAKE) install-basic
install-basic: install-basic:
...@@ -467,18 +456,10 @@ install-idoutils: ...@@ -467,18 +456,10 @@ install-idoutils:
fi fi
install-api: install-api:
@if [ x$(USE_ICINGAAPI) = xyes ]; then \ echo "Sorry, Icinga PHP API was removed from package prior 1.6.0!" ;\
cd $(SRC_ICINGAAPI) && $(MAKE) install; \ echo "Please keep in mind that Icinga-Web uses its own db layer starting with 1.5.0" ;\
echo "" ;\ echo "In case please look for a seperated package and/or icinga-api.git" ;\
echo "*** API installed ***" ;\ echo "" ;\
echo "" ;\
else \
echo "" ;\
echo "Sorry, Icinga API not available!" ;\
echo "Check md5 and source in $(SRC_ICINGAAPI)" ;\
echo "If using GIT, try # git submodule init ; git submodule update" ;\
echo "" ;\
fi
install-init: install-daemoninit install-init: install-daemoninit
......
...@@ -72,6 +72,7 @@ in various ways. If we missed your name, let us know. ...@@ -72,6 +72,7 @@ in various ways. If we missed your name, let us know.
* Jim Crilley * Jim Crilley
* Joel Crisp * Joel Crisp
* Jean-Eric Cuendet * Jean-Eric Cuendet
* Rogerio F Cunha
* Ahmon Dancy * Ahmon Dancy
* Rune Darrud * Rune Darrud
* Jan David * Jan David
...@@ -123,6 +124,7 @@ in various ways. If we missed your name, let us know. ...@@ -123,6 +124,7 @@ in various ways. If we missed your name, let us know.
* Martin Green * Martin Green
* Todd Green * Todd Green
* Sebastian Guarino * Sebastian Guarino
* Dorian Guillois
* Thomas Guyot-Sionnest * Thomas Guyot-Sionnest
* Sergio Guzman * Sergio Guzman
* Hugo Hallqvist * Hugo Hallqvist
...@@ -131,6 +133,7 @@ in various ways. If we missed your name, let us know. ...@@ -131,6 +133,7 @@ in various ways. If we missed your name, let us know.
* Lars Hecking * Lars Hecking
* Jason Hedden * Jason Hedden
* Karl Hegbloom * Karl Hegbloom
* Florian Helmberger
* Thomas Hepper * Thomas Hepper
* Bret Hermsen * Bret Hermsen
* Daniel Heule * Daniel Heule
......
...@@ -906,9 +906,14 @@ void broker_retention_data(int type, int flags, int attr, struct timeval *timest ...@@ -906,9 +906,14 @@ void broker_retention_data(int type, int flags, int attr, struct timeval *timest
return; return;
} }
/* wrapper function to stay compatible */
void broker_acknowledgement_data(int type, int flags, int attr, int acknowledgement_type, void *data, char *ack_author, char *ack_data, int subtype, int notify_contacts, int persistent_comment, struct timeval *timestamp) {
broker_acknowledgement_data_expire(type, flags, attr, acknowledgement_type, data, ack_author, ack_data, subtype, notify_contacts, persistent_comment, (time_t)0, timestamp);
return;
}
/* send acknowledgement data to broker */ /* send acknowledgement data to broker */
void broker_acknowledgement_data(int type, int flags, int attr, int acknowledgement_type, void *data, char *ack_author, char *ack_data, int subtype, int notify_contacts, int persistent_comment, struct timeval *timestamp) { void broker_acknowledgement_data_expire(int type, int flags, int attr, int acknowledgement_type, void *data, char *ack_author, char *ack_data, int subtype, int notify_contacts, int persistent_comment, time_t end_time, struct timeval *timestamp) {
nebstruct_acknowledgement_data ds; nebstruct_acknowledgement_data ds;
host *temp_host = NULL; host *temp_host = NULL;
service *temp_service = NULL; service *temp_service = NULL;
...@@ -940,6 +945,7 @@ void broker_acknowledgement_data(int type, int flags, int attr, int acknowledgem ...@@ -940,6 +945,7 @@ void broker_acknowledgement_data(int type, int flags, int attr, int acknowledgem
ds.is_sticky = (subtype == ACKNOWLEDGEMENT_STICKY) ? TRUE : FALSE; ds.is_sticky = (subtype == ACKNOWLEDGEMENT_STICKY) ? TRUE : FALSE;
ds.notify_contacts = notify_contacts; ds.notify_contacts = notify_contacts;
ds.persistent_comment = persistent_comment; ds.persistent_comment = persistent_comment;
ds.end_time = end_time;
/* make callbacks */ /* make callbacks */
neb_make_callbacks(NEBCALLBACK_ACKNOWLEDGEMENT_DATA, (void *)&ds); neb_make_callbacks(NEBCALLBACK_ACKNOWLEDGEMENT_DATA, (void *)&ds);
......
...@@ -100,7 +100,10 @@ extern int child_processes_fork_twice; ...@@ -100,7 +100,10 @@ extern int child_processes_fork_twice;
extern int stalking_event_handlers_for_hosts; extern int stalking_event_handlers_for_hosts;
extern int stalking_event_handlers_for_services; extern int stalking_event_handlers_for_services;
extern int stalking_notifications_for_hosts;
extern int stalking_notifications_for_services;
extern time_t last_program_stop;
extern time_t program_start; extern time_t program_start;
extern time_t event_start; extern time_t event_start;
...@@ -1738,9 +1741,16 @@ int handle_async_service_check_result(service *temp_service, check_result *queue ...@@ -1738,9 +1741,16 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
schedule_service_check(temp_service, temp_service->next_check, CHECK_OPTION_NONE); schedule_service_check(temp_service, temp_service->next_check, CHECK_OPTION_NONE);
} }
/* if we're stalking this state type and state was not already logged AND the plugin output changed since last check, log it now.. */
/* STALKING
* if we're stalking this state type and state was
* not already logged AND the plugin output changed
* since last check, log it or run event handlers or
* notify now..
*/
if (temp_service->state_type == HARD_STATE && state_change == FALSE && state_was_logged == FALSE && compare_strings(old_plugin_output, temp_service->plugin_output)) { if (temp_service->state_type == HARD_STATE && state_change == FALSE && state_was_logged == FALSE && compare_strings(old_plugin_output, temp_service->plugin_output)) {
/* OK */
if ((temp_service->current_state == STATE_OK && temp_service->stalk_on_ok == TRUE)) { if ((temp_service->current_state == STATE_OK && temp_service->stalk_on_ok == TRUE)) {
log_service_event(temp_service); log_service_event(temp_service);
...@@ -1749,6 +1759,11 @@ int handle_async_service_check_result(service *temp_service, check_result *queue ...@@ -1749,6 +1759,11 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
if (stalking_event_handlers_for_services == TRUE) if (stalking_event_handlers_for_services == TRUE)
handle_service_event(temp_service); handle_service_event(temp_service);
/* should we notify all contacts ? */
if (stalking_notifications_for_services == TRUE)
service_notification(temp_service, NOTIFICATION_STALKING, NULL, NULL, NOTIFICATION_OPTION_NONE);
/* WARNING */
} else if ((temp_service->current_state == STATE_WARNING && temp_service->stalk_on_warning == TRUE)) { } else if ((temp_service->current_state == STATE_WARNING && temp_service->stalk_on_warning == TRUE)) {
log_service_event(temp_service); log_service_event(temp_service);
...@@ -1757,6 +1772,10 @@ int handle_async_service_check_result(service *temp_service, check_result *queue ...@@ -1757,6 +1772,10 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
if (stalking_event_handlers_for_services == TRUE) if (stalking_event_handlers_for_services == TRUE)
handle_service_event(temp_service); handle_service_event(temp_service);
/* should we notify all contacts ? */
if (stalking_notifications_for_services == TRUE)
service_notification(temp_service, NOTIFICATION_STALKING, NULL, NULL, NOTIFICATION_OPTION_NONE);
/* UNKNOWN */
} else if ((temp_service->current_state == STATE_UNKNOWN && temp_service->stalk_on_unknown == TRUE)) { } else if ((temp_service->current_state == STATE_UNKNOWN && temp_service->stalk_on_unknown == TRUE)) {
log_service_event(temp_service); log_service_event(temp_service);
...@@ -1765,6 +1784,10 @@ int handle_async_service_check_result(service *temp_service, check_result *queue ...@@ -1765,6 +1784,10 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
if (stalking_event_handlers_for_services == TRUE) if (stalking_event_handlers_for_services == TRUE)
handle_service_event(temp_service); handle_service_event(temp_service);
/* should we notify all contacts ? */
if (stalking_notifications_for_services == TRUE)
service_notification(temp_service, NOTIFICATION_STALKING, NULL, NULL, NOTIFICATION_OPTION_NONE);
/* CRITICAL */
} else if ((temp_service->current_state == STATE_CRITICAL && temp_service->stalk_on_critical == TRUE)) { } else if ((temp_service->current_state == STATE_CRITICAL && temp_service->stalk_on_critical == TRUE)) {
log_service_event(temp_service); log_service_event(temp_service);
...@@ -1773,6 +1796,9 @@ int handle_async_service_check_result(service *temp_service, check_result *queue ...@@ -1773,6 +1796,9 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
if (stalking_event_handlers_for_services == TRUE) if (stalking_event_handlers_for_services == TRUE)
handle_service_event(temp_service); handle_service_event(temp_service);
/* should we notify all contacts ? */
if (stalking_notifications_for_services == TRUE)
service_notification(temp_service, NOTIFICATION_STALKING, NULL, NULL, NOTIFICATION_OPTION_NONE);
} }
} }
...@@ -2225,18 +2251,58 @@ int is_service_result_fresh(service *temp_service, time_t current_time, int log_ ...@@ -2225,18 +2251,58 @@ int is_service_result_fresh(service *temp_service, time_t current_time, int log_
log_debug_info(DEBUGL_CHECKS, 2, "Freshness thresholds: service=%d, use=%d\n", temp_service->freshness_threshold, freshness_threshold); log_debug_info(DEBUGL_CHECKS, 2, "Freshness thresholds: service=%d, use=%d\n", temp_service->freshness_threshold, freshness_threshold);
/* calculate expiration time */ /* calculate expiration time */
/* CHANGED 11/10/05 EG - program start is only used in expiration time calculation if > last check AND active checks are enabled, so active checks can become stale immediately upon program startup */ /*
/* CHANGED 02/25/06 SG - passive checks also become stale, so remove dependence on active check logic */ * CHANGED 11/10/05 EG
* program start is only used in expiration time calculation
* if > last check AND active checks are enabled, so active checks
* can become stale immediately upon program startup
*/
/*
* CHANGED 02/25/06 SG
* passive checks also become stale, so remove dependence on active
* check logic
*/
if (temp_service->has_been_checked == FALSE) if (temp_service->has_been_checked == FALSE)
expiration_time = (time_t)(event_start + freshness_threshold); expiration_time = (time_t)(event_start + freshness_threshold);
/* CHANGED 06/19/07 EG - Per Ton's suggestion (and user requests), only use program start time over last check if no specific threshold has been set by user. Otheriwse use it. Problems can occur if Icinga is restarted more frequently that freshness threshold intervals (services never go stale). */ /*
/* CHANGED 10/07/07 EG - Only match next condition for services that have active checks enabled... */ * CHANGED 06/19/07 EG
/* CHANGED 10/07/07 EG - Added max_service_check_spread to expiration time as suggested by Altinity */ * Per Ton's suggestion (and user requests), only use program start
* time over last check if no specific threshold has been set by user.
* Otheriwse use it. Problems can occur if Icinga is restarted more
* frequently that freshness threshold intervals (services never go stale).
*/
/*
* CHANGED 10/07/07 EG
* Only match next condition for services that have active checks
* enabled...
*/
/*
* CHANGED 10/07/07 EG
* Added max_service_check_spread to expiration time as suggested
* by Altinity
*/
else if (temp_service->checks_enabled == TRUE && event_start > temp_service->last_check && temp_service->freshness_threshold == 0) else if (temp_service->checks_enabled == TRUE && event_start > temp_service->last_check && temp_service->freshness_threshold == 0)
expiration_time = (time_t)(event_start + freshness_threshold + (max_service_check_spread * interval_length)); expiration_time = (time_t)(event_start + freshness_threshold + (max_service_check_spread * interval_length));
else else
expiration_time = (time_t)(temp_service->last_check + freshness_threshold); expiration_time = (time_t)(temp_service->last_check + freshness_threshold);
/*
* ADDED 22-10-2011 MF, Patch by Andreas Ericsson
* If the check was last done passively, we assume it's going
* to continue that way and we need to handle the fact that
* Icinga might have been shut off for quite a long time. If so,
* we mustn't spam freshness notifications but use program_start_time
* instead of last_check to determine freshness expiration time.
* The threshold for "long time" is determined as 61.8% of the normal
* freshness threshold based on vast heuristical research (ie, "some
* guy once told me the golden ratio is good for loads of stuff").
*/
if (temp_service->check_type == SERVICE_CHECK_PASSIVE) {
if (event_start < program_start + 60 && event_start - last_program_stop < (freshness_threshold * 0.618)) {
expiration_time = event_start + freshness_threshold;
}
}
log_debug_info(DEBUGL_CHECKS, 2, "HBC: %d, PS: %lu, ES: %lu, LC: %lu, CT: %lu, ET: %lu\n", temp_service->has_been_checked, (unsigned long)program_start, (unsigned long)event_start, (unsigned long)temp_service->last_check, (unsigned long)current_time, (unsigned long)expiration_time); log_debug_info(DEBUGL_CHECKS, 2, "HBC: %d, PS: %lu, ES: %lu, LC: %lu, CT: %lu, ET: %lu\n", temp_service->has_been_checked, (unsigned long)program_start, (unsigned long)event_start, (unsigned long)temp_service->last_check, (unsigned long)current_time, (unsigned long)expiration_time);
/* the results for the last check of this service are stale */ /* the results for the last check of this service are stale */
...@@ -2615,16 +2681,50 @@ int is_host_result_fresh(host *temp_host, time_t current_time, int log_this) { ...@@ -2615,16 +2681,50 @@ int is_host_result_fresh(host *temp_host, time_t current_time, int log_this) {
log_debug_info(DEBUGL_CHECKS, 2, "Freshness thresholds: host=%d, use=%d\n", temp_host->freshness_threshold, freshness_threshold); log_debug_info(DEBUGL_CHECKS, 2, "Freshness thresholds: host=%d, use=%d\n", temp_host->freshness_threshold, freshness_threshold);
/* calculate expiration time */ /* calculate expiration time */
/* CHANGED 11/10/05 EG - program start is only used in expiration time calculation if > last check AND active checks are enabled, so active checks can become stale immediately upon program startup */ /*
* CHANGED 11/10/05 EG