Module: check_mk
Branch: master
Commit: a648d7cd47e50684fa7717c16ae57f6276eee3f5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a648d7cd47e506…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Oct 1 11:47:39 2013 +0200
statehist: fixed bug where entries of vanished services got assigned to hosts
---
livestatus/src/TableStateHistory.cc | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index fa8522e..56bae27 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -414,22 +414,23 @@ void TableStateHistory::answerQuery(Query *query)
in_nagios_initial_states = false;
}
+ key = 0;
+ bool is_service = false;
switch (entry->_type) {
- case DOWNTIME_ALERT_SERVICE:
- case DOWNTIME_ALERT_HOST:
+ case ALERT_SERVICE:
case STATE_SERVICE:
case STATE_SERVICE_INITIAL:
+ case DOWNTIME_ALERT_SERVICE:
+ case FLAPPING_SERVICE:
+ key = entry->_service;
+ is_service = true;
+ case ALERT_HOST:
case STATE_HOST:
case STATE_HOST_INITIAL:
- case ALERT_SERVICE:
- case ALERT_HOST:
+ case DOWNTIME_ALERT_HOST:
case FLAPPING_HOST:
- case FLAPPING_SERVICE:
{
- key = 0;
- if (entry->_service != 0)
- key = entry->_service;
- else if (entry->_host != 0)
+ if (!is_service)
key = entry->_host;
if (key == 0)