Module: check_mk
Branch: master
Commit: cede101c08feafef766b4e3298fcf7acec7d3910
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cede101c08feaf…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 19:36:27 2013 +0100
FIX Fix semantics of columns num_services_hard_*
In the tables <tt>hosts</tt> and <tt>servicegroups</tt> the
columns
<tt>num_services_hard_warn</tt>, <tt>num_services_hard_crit</tt>
and
<tt>num_services_hard_unknown<tt> did not correctly reflect the
hard status but in most cases just the soft status - effectively
ignoring the <tt>_hard_</tt>. This has now been fixed.
---
.werks/344 | 14 ++++++++++++++
ChangeLog | 1 +
livestatus/src/ServicelistStateColumn.cc | 8 +++++---
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/.werks/344 b/.werks/344
new file mode 100644
index 0000000..36054cf
--- /dev/null
+++ b/.werks/344
@@ -0,0 +1,14 @@
+Title: Fix semantics of columns num_services_hard_*
+Level: 1
+Component: livestatus
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387218771
+Targetversion: future
+
+In the tables <tt>hosts</tt> and <tt>servicegroups</tt> the
columns
+<tt>num_services_hard_warn</tt>, <tt>num_services_hard_crit</tt>
and
+<tt>num_services_hard_unknown<tt> did not correctly reflect the
+hard status but in most cases just the soft status - effectively
+ignoring the <tt>_hard_</tt>. This has now been fixed.
diff --git a/ChangeLog b/ChangeLog
index fc739f0..f49b2a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,6 +90,7 @@
* 0337 New header for limiting the execution time of a query...
* 0335 FIX: Parse state of downtime notification log entries correctly...
* 0336 FIX: Limit the number of lines read from a single logfile...
+ * 0344 FIX: Fix semantics of columns num_services_hard_*...
1.2.3i7:
diff --git a/livestatus/src/ServicelistStateColumn.cc
b/livestatus/src/ServicelistStateColumn.cc
index a4f9064..7565091 100644
--- a/livestatus/src/ServicelistStateColumn.cc
+++ b/livestatus/src/ServicelistStateColumn.cc
@@ -51,22 +51,24 @@ int32_t ServicelistStateColumn::getValue(int logictype, servicesmember
*mem, Que
{
contact *auth_user = query->authUser();
int32_t result = 0;
+ int lt;
while (mem) {
service *svc = mem->service_ptr;
if (!auth_user || g_table_services->isAuthorized(auth_user, svc)) {
+ int lt = logictype;
int state;
int has_been_checked;
if (logictype >= 60) {
state = svc->last_hard_state;
- logictype -= 64;
+ lt -= 64;
}
else
state = svc->current_state;
has_been_checked = svc->has_been_checked;
- switch (logictype) {
+ switch (lt) {
case SLSC_WORST_STATE:
if (svcStateIsWorse(state, result))
result = state;
@@ -79,7 +81,7 @@ int32_t ServicelistStateColumn::getValue(int logictype, servicesmember
*mem, Que
result++;
break;
default:
- if (has_been_checked && state == logictype)
+ if (has_been_checked && state == lt)
result++;
break;
}