Module: check_mk
Branch: master
Commit: 41372a66b6e241e3e88303649da950661e6d9bd9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=41372a66b6e241…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Oct 26 12:03:35 2010 +0200
Table downtimes/comments: new column is_service
---
ChangeLog | 1 +
livestatus/src/DowntimeOrComment.cc | 8 ++++++--
livestatus/src/DowntimeOrComment.h | 1 +
livestatus/src/TableDownComm.cc | 2 ++
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index eead3fc..f870d05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
this in version 1.1.8...)
* Table status: new columns external_commands and external_commands_rate
(also due to Mr. Fiebig - he would have quit our workshop otherwise...)
+ * Table downtimes/comments: new column is_service
Multisite:
* Snapin Performance: show external command per second and usage and
diff --git a/livestatus/src/DowntimeOrComment.cc b/livestatus/src/DowntimeOrComment.cc
index e913afe..87e13cd 100644
--- a/livestatus/src/DowntimeOrComment.cc
+++ b/livestatus/src/DowntimeOrComment.cc
@@ -34,10 +34,14 @@ DowntimeOrComment::DowntimeOrComment(nebstruct_downtime_struct *dt,
, _id(id)
{
_host = find_host(dt->host_name);
- if (dt->service_description)
+ if (dt->service_description) {
_service = find_service(dt->host_name, dt->service_description);
- else
+ _is_service = 1;
+ }
+ else {
_service = 0;
+ _is_service = 0;
+ }
}
diff --git a/livestatus/src/DowntimeOrComment.h b/livestatus/src/DowntimeOrComment.h
index 632d184..615d4ad 100644
--- a/livestatus/src/DowntimeOrComment.h
+++ b/livestatus/src/DowntimeOrComment.h
@@ -92,6 +92,7 @@ struct DowntimeOrComment
char * _author_name;
char* _comment;
unsigned long _id;
+ int _is_service;
DowntimeOrComment(nebstruct_downtime_struct *data, unsigned long id);
virtual ~DowntimeOrComment();
diff --git a/livestatus/src/TableDownComm.cc b/livestatus/src/TableDownComm.cc
index 0f28db7..342a45a 100644
--- a/livestatus/src/TableDownComm.cc
+++ b/livestatus/src/TableDownComm.cc
@@ -56,6 +56,8 @@ TableDownComm::TableDownComm(bool is_downtime)
addColumn(new OffsetIntColumn("type",
is_downtime ? "The type of the downtime: 0 if it is active, 1 if it is
pending" :
"The type of the comment: 1 is host, 2 is service", (char
*)&(ref->_type) - (char *)ref));
+ addColumn(new OffsetIntColumn("is_service",
+ "0, if this entry is for a host, 1 if it is for a service",
(char *)&(ref->_is_service) - (char *)ref));
if (is_downtime)
{