From 0915b3ef56dfac3113cce55a59a5765dc94976be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 14:34:54 +0200 Subject: Adding upstream version 2.13.6. Signed-off-by: Daniel Baumann --- lib/livestatus/livestatuslogutility.hpp | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lib/livestatus/livestatuslogutility.hpp (limited to 'lib/livestatus/livestatuslogutility.hpp') diff --git a/lib/livestatus/livestatuslogutility.hpp b/lib/livestatus/livestatuslogutility.hpp new file mode 100644 index 0000000..66d1154 --- /dev/null +++ b/lib/livestatus/livestatuslogutility.hpp @@ -0,0 +1,60 @@ +/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ + +#ifndef LIVESTATUSLOGUTILITY_H +#define LIVESTATUSLOGUTILITY_H + +#include "livestatus/historytable.hpp" + +using namespace icinga; + +namespace icinga +{ + +enum LogEntryType { + LogEntryTypeHostAlert, + LogEntryTypeHostDowntimeAlert, + LogEntryTypeHostFlapping, + LogEntryTypeHostNotification, + LogEntryTypeHostInitialState, + LogEntryTypeHostCurrentState, + LogEntryTypeServiceAlert, + LogEntryTypeServiceDowntimeAlert, + LogEntryTypeServiceFlapping, + LogEntryTypeServiceNotification, + LogEntryTypeServiceInitialState, + LogEntryTypeServiceCurrentState, + LogEntryTypeTimeperiodTransition, + LogEntryTypeVersion, + LogEntryTypeInitialStates, + LogEntryTypeProgramStarting +}; + +enum LogEntryClass { + LogEntryClassInfo = 0, + LogEntryClassAlert = 1, + LogEntryClassProgram = 2, + LogEntryClassNotification = 3, + LogEntryClassPassive = 4, + LogEntryClassCommand = 5, + LogEntryClassState = 6, + LogEntryClassText = 7 +}; + +/** + * @ingroup livestatus + */ +class LivestatusLogUtility +{ +public: + static void CreateLogIndex(const String& path, std::map& index); + static void CreateLogIndexFileHandler(const String& path, std::map& index); + static void CreateLogCache(std::map index, HistoryTable *table, time_t from, time_t until, const AddRowFunction& addRowFn); + static Dictionary::Ptr GetAttributes(const String& text); + +private: + LivestatusLogUtility(); +}; + +} + +#endif /* LIVESTATUSLOGUTILITY_H */ -- cgit v1.2.3