Module: check_mk
Branch: master
Commit: 96dd31f8c093bd7dce54583f56170b7ffd0f3d7a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=96dd31f8c093bd…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Sep 26 16:41:39 2012 +0200
livestatus: Bugfix: do not omit first it_entry
---
livestatus/src/DownCommColumn.cc | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/livestatus/src/DownCommColumn.cc b/livestatus/src/DownCommColumn.cc
index 13fe68e..c77189b 100644
--- a/livestatus/src/DownCommColumn.cc
+++ b/livestatus/src/DownCommColumn.cc
@@ -33,10 +33,13 @@ void DownCommColumn::output(void *data, Query *query)
{
TableDownComm *table = _is_downtime ? g_table_downtimes : g_table_comments;
query->outputBeginList();
+
data = shiftPointer(data); // points to host or service
+
if (data)
{
bool first = true;
+ bool found_match = false;
for (map<unsigned long, DowntimeOrComment *>::iterator it =
table->entriesIteratorBegin();
it != table->entriesIteratorEnd();
@@ -44,8 +47,17 @@ void DownCommColumn::output(void *data, Query *query)
{
unsigned long id = it->first;
DowntimeOrComment *dt = it->second;
- if ((void *)dt->_service == data ||
- (dt->_service == 0 && dt->_host == data))
+
+ found_match = false;
+ if ( dt->_service == 0){
+ if (dt->_host->name == ((host_struct*)data)->name)
+ found_match = true;
+ }
+ else
+ if ( dt->_service->description ==
((service_struct*)data)->description && dt->_service->host_name ==
((service_struct*)data)->host_name )
+ found_match = true;
+
+ if (found_match)
{
if (first)
first = false;