Module: check_mk
Branch: master
Commit: 6d1cb096fae43b0c7ab86cd58a8f4c0f3460ec7b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d1cb096fae43b…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri May 20 13:42:34 2016 +0200
Fetched livestatus from downstream.
---
livestatus/src/Store.h | 1 +
livestatus/src/TableEventConsoleEvents.cc | 71 ++++++++++++++++++++--------
livestatus/src/TableEventConsoleEvents.h | 2 +
livestatus/src/TableEventConsoleHistory.cc | 42 +++++++---------
4 files changed, 70 insertions(+), 46 deletions(-)
diff --git a/livestatus/src/Store.h b/livestatus/src/Store.h
index 88893f0..26f6a2c 100644
--- a/livestatus/src/Store.h
+++ b/livestatus/src/Store.h
@@ -92,6 +92,7 @@ private:
TableEventConsoleStatus _table_eventconsolestatus;
std::map<std::string, Table *> _tables;
+
std::mutex _command_mutex;
void addTable(Table *table);
diff --git a/livestatus/src/TableEventConsoleEvents.cc
b/livestatus/src/TableEventConsoleEvents.cc
index ef20056..1361de1 100644
--- a/livestatus/src/TableEventConsoleEvents.cc
+++ b/livestatus/src/TableEventConsoleEvents.cc
@@ -24,27 +24,56 @@
#include "TableEventConsoleEvents.h"
-TableEventConsoleEvents::TableEventConsoleEvents() {
- addColumn(new StringEventConsoleColumn("event_id", "blah"));
- addColumn(new StringEventConsoleColumn("event_count", "blah"));
- addColumn(new StringEventConsoleColumn("event_text", "blah"));
- addColumn(new StringEventConsoleColumn("event_first", "blah"));
- addColumn(new StringEventConsoleColumn("event_last", "blah"));
- addColumn(new StringEventConsoleColumn("event_comment",
"blah"));
- addColumn(new StringEventConsoleColumn("event_sl", "blah"));
- addColumn(new StringEventConsoleColumn("event_host", "blah"));
- addColumn(new StringEventConsoleColumn("event_contact",
"blah"));
- addColumn(new StringEventConsoleColumn("event_application",
"blah"));
- addColumn(new StringEventConsoleColumn("event_pid", "blah"));
- addColumn(new StringEventConsoleColumn("event_priority",
"blah"));
- addColumn(new StringEventConsoleColumn("event_facility",
"blah"));
- addColumn(new StringEventConsoleColumn("event_rule_id",
"blah"));
- addColumn(new StringEventConsoleColumn("event_state", "blah"));
- addColumn(new StringEventConsoleColumn("event_phase", "blah"));
- addColumn(new StringEventConsoleColumn("event_owner", "blah"));
- addColumn(new StringEventConsoleColumn("event_match_groups",
"blah"));
- addColumn(new StringEventConsoleColumn("event_contact_groups",
"blah"));
- addColumn(new StringEventConsoleColumn("event_ipaddress",
"blah"));
+TableEventConsoleEvents::TableEventConsoleEvents() { addColumns(this); }
+
+// static
+void TableEventConsoleEvents::addColumns(Table *table) {
+ table->addColumn(
+ new IntEventConsoleColumn("event_id", "The unique ID for this
event"));
+ table->addColumn(new IntEventConsoleColumn(
+ "event_count",
+ "The number of occurrences of this event within period"));
+ table->addColumn(new StringEventConsoleColumn(
+ "event_text", "The textual description of the event"));
+ table->addColumn(new TimeEventConsoleColumn(
+ "event_first",
+ "Time of the first occurrence of the event (Unix timestamp)"));
+ table->addColumn(new TimeEventConsoleColumn(
+ "event_last",
+ "Time of the last occurrence of this event (Unix timestamp)"));
+ table->addColumn(
+ new StringEventConsoleColumn("event_comment", "Event
comment"));
+ table->addColumn(new IntEventConsoleColumn(
+ "event_sl", "The service level for this event"));
+ table->addColumn(
+ new StringEventConsoleColumn("event_host", "Host name for this
event"));
+ table->addColumn(
+ new StringEventConsoleColumn("event_contact", "Contact
information"));
+ table->addColumn(new StringEventConsoleColumn("event_application",
+ "Syslog tag/application"));
+ table->addColumn(new IntEventConsoleColumn(
+ "event_pid", "The process ID of the originating process"));
+ table->addColumn(
+ new IntEventConsoleColumn("event_priority", "Syslog
priority"));
+ table->addColumn(
+ new IntEventConsoleColumn("event_facility", "Syslog
facility"));
+ table->addColumn(
+ new StringEventConsoleColumn("event_rule_id", "The ID of the
rule"));
+ table->addColumn(new IntEventConsoleColumn(
+ "event_state", "The state of the event (0/1/2/3)"));
+ table->addColumn(
+ new StringEventConsoleColumn("event_phase",
+ "The phase the event is currently in (one
"
+ "of open/closed/delayed/counting/ack)"));
+ table->addColumn(
+ new StringEventConsoleColumn("event_owner", "The owner of the
event"));
+ table->addColumn(new StringEventConsoleColumn(
+ "event_match_groups",
+ "Text groups from regular expression match")); // list
+ table->addColumn(new StringEventConsoleColumn("event_contact_groups",
+ "Contact groups")); // list
+ table->addColumn(new StringEventConsoleColumn(
+ "event_ipaddress", "The IP address where the event
originated"));
}
const char *TableEventConsoleEvents::name() const {
diff --git a/livestatus/src/TableEventConsoleEvents.h
b/livestatus/src/TableEventConsoleEvents.h
index d345adb..80b174c 100644
--- a/livestatus/src/TableEventConsoleEvents.h
+++ b/livestatus/src/TableEventConsoleEvents.h
@@ -33,6 +33,8 @@ public:
TableEventConsoleEvents();
const char *name() const override;
const char *namePrefix() const override;
+
+ static void addColumns(Table *table);
};
#endif // TableEventConsoleEvents_h
diff --git a/livestatus/src/TableEventConsoleHistory.cc
b/livestatus/src/TableEventConsoleHistory.cc
index a76c32a..9ba3e1b 100644
--- a/livestatus/src/TableEventConsoleHistory.cc
+++ b/livestatus/src/TableEventConsoleHistory.cc
@@ -23,33 +23,25 @@
// Boston, MA 02110-1301 USA.
#include "TableEventConsoleHistory.h"
+#include "TableEventConsoleEvents.h"
TableEventConsoleHistory::TableEventConsoleHistory() {
- addColumn(new StringEventConsoleColumn("history_line", "blah"));
- addColumn(new StringEventConsoleColumn("history_time", "blah"));
- addColumn(new StringEventConsoleColumn("history_what", "blah"));
- addColumn(new StringEventConsoleColumn("history_who", "blah"));
- addColumn(new StringEventConsoleColumn("history_addinfo",
"blah"));
- addColumn(new StringEventConsoleColumn("event_id", "blah"));
- addColumn(new StringEventConsoleColumn("event_count", "blah"));
- addColumn(new StringEventConsoleColumn("event_text", "blah"));
- addColumn(new StringEventConsoleColumn("event_first", "blah"));
- addColumn(new StringEventConsoleColumn("event_last", "blah"));
- addColumn(new StringEventConsoleColumn("event_comment",
"blah"));
- addColumn(new StringEventConsoleColumn("event_sl", "blah"));
- addColumn(new StringEventConsoleColumn("event_host", "blah"));
- addColumn(new StringEventConsoleColumn("event_contact",
"blah"));
- addColumn(new StringEventConsoleColumn("event_application",
"blah"));
- addColumn(new StringEventConsoleColumn("event_pid", "blah"));
- addColumn(new StringEventConsoleColumn("event_priority",
"blah"));
- addColumn(new StringEventConsoleColumn("event_facility",
"blah"));
- addColumn(new StringEventConsoleColumn("event_rule_id",
"blah"));
- addColumn(new StringEventConsoleColumn("event_state", "blah"));
- addColumn(new StringEventConsoleColumn("event_phase", "blah"));
- addColumn(new StringEventConsoleColumn("event_owner", "blah"));
- addColumn(new StringEventConsoleColumn("event_match_groups",
"blah"));
- addColumn(new StringEventConsoleColumn("event_contact_groups",
"blah"));
- addColumn(new StringEventConsoleColumn("event_ipaddress",
"blah"));
+ addColumn(new IntEventConsoleColumn(
+ "history_line", "The line number of the event in the history
file"));
+ addColumn(new TimeEventConsoleColumn("history_time",
+ "Time when the event was written into
"
+ "the history file (Unix
timestamp)"));
+ addColumn(new StringEventConsoleColumn(
+ "history_what",
+ "What happened (one of "
+ "ARCHIVED/AUTODELETE/CANCELLED/CHANGESTATE/COUNTFAILED/COUNTREACHED/"
+
"DELAYOVER/DELETE/EMAIL/EXPIRED/NEW/NOCOUNT/ORPHANED/SCRIPT/UPDATE)"));
+ addColumn(new StringEventConsoleColumn(
+ "history_who", "The user who triggered the command"));
+ addColumn(new StringEventConsoleColumn(
+ "history_addinfo",
+ "Additional information, like email recipient/subject or action ID"));
+ TableEventConsoleEvents::addColumns(this);
}
const char *TableEventConsoleHistory::name() const {