]> granicus.if.org Git - icinga2/blob - lib/livestatus/livestatuslogutility.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / livestatus / livestatuslogutility.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef LIVESTATUSLOGUTILITY_H
4 #define LIVESTATUSLOGUTILITY_H
5
6 #include "livestatus/historytable.hpp"
7
8 using namespace icinga;
9
10 namespace icinga
11 {
12
13 enum LogEntryType {
14         LogEntryTypeHostAlert,
15         LogEntryTypeHostDowntimeAlert,
16         LogEntryTypeHostFlapping,
17         LogEntryTypeHostNotification,
18         LogEntryTypeHostInitialState,
19         LogEntryTypeHostCurrentState,
20         LogEntryTypeServiceAlert,
21         LogEntryTypeServiceDowntimeAlert,
22         LogEntryTypeServiceFlapping,
23         LogEntryTypeServiceNotification,
24         LogEntryTypeServiceInitialState,
25         LogEntryTypeServiceCurrentState,
26         LogEntryTypeTimeperiodTransition,
27         LogEntryTypeVersion,
28         LogEntryTypeInitialStates,
29         LogEntryTypeProgramStarting
30 };
31
32 enum LogEntryClass {
33         LogEntryClassInfo = 0,
34         LogEntryClassAlert = 1,
35         LogEntryClassProgram = 2,
36         LogEntryClassNotification = 3,
37         LogEntryClassPassive = 4,
38         LogEntryClassCommand = 5,
39         LogEntryClassState = 6,
40         LogEntryClassText = 7
41 };
42
43 /**
44  * @ingroup livestatus
45  */
46 class LivestatusLogUtility
47 {
48 public:
49         static void CreateLogIndex(const String& path, std::map<time_t, String>& index);
50         static void CreateLogIndexFileHandler(const String& path, std::map<time_t, String>& index);
51         static void CreateLogCache(std::map<time_t, String> index, HistoryTable *table, time_t from, time_t until, const AddRowFunction& addRowFn);
52         static Dictionary::Ptr GetAttributes(const String& text);
53
54 private:
55         LivestatusLogUtility();
56 };
57
58 }
59
60 #endif /* LIVESTATUSLOGUTILITY_H */