[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: core: skip writing status. dat if explicitely set to /dev/null (e.g. when using alternate data retrieval methods like IDOUtils)

git at icinga.org git at icinga.org
Sun Mar 10 20:27:46 CET 2013


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Sun Mar 10 19:40:55 2013 +0100

core: skip writing status.dat if explicitely set to /dev/null (e.g. when using alternate data retrieval methods like IDOUtils)

refs #3819

---

 Changelog                   |    2 ++
 sample-config/icinga.cfg.in |    5 ++++-
 xdata/xsddefault.c          |    4 ++++
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/Changelog b/Changelog
index e83308c..1869ccc 100644
--- a/Changelog
+++ b/Changelog
@@ -23,6 +23,7 @@ ENHANCEMENTS
 * core: keep logfile open, reducing open/close performance decreases (Andreas Ericsson) #3390 - MF
 * core: enhance illegal macro character processing performance (Andreas Ericsson) #3389 - MF
 * core: add the notification type by string to debug logs; set CUSTOM=8, STALKING=9 (Andreas Ericsson) #3818 - MF
+* core: skip writing status.dat if explicitely set to /dev/null (e.g. when using alternate data retrieval methods like IDOUtils) (Andreas Ericsson) #3819 - MF
 
 * classic ui: Add "set_expire_ack_by_default" to cgi configuration #3476 - CF
 * classic ui: Add "send_ack_notifications" to cgi configuration (TheCry) #3467 - CF
@@ -85,6 +86,7 @@ FIXES
 CHANGES
 
 * icinga.cfg - enable_state_based_escalation_ranges=0 (disabled if not set) fix for #3441
+* icinga.cfg - set status_file=/dev/null to disable its creation #3819
 
 * core: -v param can be used more than once #3510
 * core: 'Warning: Host ... has no service associated with it!' now happens only in icinga -vv icinga.cfg #3510
diff --git a/sample-config/icinga.cfg.in b/sample-config/icinga.cfg.in
index 19ea1d9..8c7e116 100644
--- a/sample-config/icinga.cfg.in
+++ b/sample-config/icinga.cfg.in
@@ -109,7 +109,10 @@ resource_file=@sysconfdir@/resource.cfg
 # This is where the current status of all monitored services and
 # hosts is stored.  Its contents are read and processed by the CGIs.
 # The contents of the status file are deleted every time Icinga
-#  restarts.
+# restarts.
+# If you explicitely set it to /dev/null the core will skip writing
+# the status file entirely. This becomes handy when using other methods
+# for data retrieval (e.g. IDOUtils DB)
 
 status_file=@STATEDIR@/status.dat
 
diff --git a/xdata/xsddefault.c b/xdata/xsddefault.c
index 29c5f83..9295d80 100644
--- a/xdata/xsddefault.c
+++ b/xdata/xsddefault.c
@@ -357,6 +357,10 @@ int xsddefault_save_status_data(void) {
 
 	log_debug_info(DEBUGL_FUNCTIONS, 0, "save_status_data()\n");
 
+	/* if this is set to /dev/null, skip it */
+	if (!xsddefault_status_log || !strcmp(xsddefault_status_log, "/dev/null"))
+		return OK;
+
 	/* open a safe temp file for output */
 	if (xsddefault_temp_file == NULL)
 		return ERROR;





More information about the icinga-checkins mailing list