1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #ifndef STATUSDATAWRITER_H
4 #define STATUSDATAWRITER_H
6 #include "compat/statusdatawriter-ti.hpp"
7 #include "icinga/customvarobject.hpp"
8 #include "icinga/host.hpp"
9 #include "icinga/service.hpp"
10 #include "icinga/command.hpp"
11 #include "icinga/compatutility.hpp"
12 #include "base/timer.hpp"
13 #include "base/utility.hpp"
22 class StatusDataWriter final : public ObjectImpl<StatusDataWriter>
25 DECLARE_OBJECT(StatusDataWriter);
26 DECLARE_OBJECTNAME(StatusDataWriter);
28 static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
31 void Start(bool runtimeCreated) override;
32 void Stop(bool runtimeRemoved) override;
35 Timer::Ptr m_StatusTimer;
36 bool m_ObjectsCacheOutdated;
38 void DumpCommand(std::ostream& fp, const Command::Ptr& command);
39 void DumpTimePeriod(std::ostream& fp, const TimePeriod::Ptr& tp);
40 void DumpDowntimes(std::ostream& fp, const Checkable::Ptr& owner);
41 void DumpComments(std::ostream& fp, const Checkable::Ptr& owner);
42 void DumpHostStatus(std::ostream& fp, const Host::Ptr& host);
43 void DumpHostObject(std::ostream& fp, const Host::Ptr& host);
45 void DumpCheckableStatusAttrs(std::ostream& fp, const Checkable::Ptr& checkable);
48 void DumpNameList(std::ostream& fp, const T& list)
51 for (const auto& obj : list) {
62 void DumpStringList(std::ostream& fp, const T& list)
65 for (const auto& str : list) {
75 void DumpServiceStatus(std::ostream& fp, const Service::Ptr& service);
76 void DumpServiceObject(std::ostream& fp, const Service::Ptr& service);
78 void DumpCustomAttributes(std::ostream& fp, const CustomVarObject::Ptr& object);
80 void UpdateObjectsCache();
81 void StatusTimerHandler();
84 static String GetNotificationOptions(const Checkable::Ptr& checkable);
89 #endif /* STATUSDATAWRITER_H */