Module: check_mk
Branch: master
Commit: 9eff4edf7bd030742df58cb394bf8809413e685f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9eff4edf7bd030…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Apr 20 15:20:33 2015 +0200
#2208 FIX Add missing Livestatus column service_period
This column was not being accessable due to the fact that it's
prefix is <tt>service_</tt>. This has been fixed.
Conflicts:
ChangeLog
livestatus/src/Table.cc
---
.werks/2208 | 11 +++++++++++
ChangeLog | 3 +++
livestatus/src/Table.cc | 11 +++++++++++
3 files changed, 25 insertions(+)
diff --git a/.werks/2208 b/.werks/2208
new file mode 100644
index 0000000..9877ef0
--- /dev/null
+++ b/.werks/2208
@@ -0,0 +1,11 @@
+Title: Add missing Livestatus column service_period
+Level: 1
+Component: livestatus
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1429535813
+
+This column was not being accessable due to the fact that it's
+prefix is <tt>service_</tt>. This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index be01533..53eb04d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -500,6 +500,9 @@
* 2139 FIX: Fix exception in Event Console when archiving events with match groups
and non ASCII characters
* 2151 FIX: Fixed wrong time in events when forwarding logwatch to EC between
timezones...
+ Livestatus:
+ * 2208 FIX: Add missing Livestatus column service_period...
+
HW/SW-Inventory:
* 1846 Keep track of changes of software and hardware...
* 1855 esx_systeminfo: new inventory plugin to retrieve info about the host operating
system for ESX servers
diff --git a/livestatus/src/Table.cc b/livestatus/src/Table.cc
index d462be2..cb526b6 100644
--- a/livestatus/src/Table.cc
+++ b/livestatus/src/Table.cc
@@ -105,6 +105,17 @@ Column *Table::column(const char *colname)
_columns_t::iterator it = _columns.find(string(colname));
if (it != _columns.end())
return it->second;
+
+ // Now we try to readd the removed prefix. That way we tackle the
+ // problem with the column "service_period". Here the prefix service_
+ // is part of the actual name of the column!
+ string with_prefix(prefixname(), prefix_len - 1);
+ with_prefix += "_";
+ with_prefix += colname;
+
+ it = _columns.find(with_prefix);
+ if (it != _columns.end())
+ return it->second;
else
return 0;
}