1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #ifndef LIVESTATUSLISTENER_H
4 #define LIVESTATUSLISTENER_H
6 #include "livestatus/i2-livestatus.hpp"
7 #include "livestatus/livestatuslistener-ti.hpp"
8 #include "livestatus/livestatusquery.hpp"
9 #include "base/socket.hpp"
12 using namespace icinga;
20 class LivestatusListener final : public ObjectImpl<LivestatusListener>
23 DECLARE_OBJECT(LivestatusListener);
24 DECLARE_OBJECTNAME(LivestatusListener);
26 static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
28 static int GetClientsConnected();
29 static int GetConnections();
31 void ValidateSocketType(const Lazy<String>& lvalue, const ValidationUtils& utils) override;
34 void Start(bool runtimeCreated) override;
35 void Stop(bool runtimeRemoved) override;
38 void ServerThreadProc();
39 void ClientHandler(const Socket::Ptr& client);
41 Socket::Ptr m_Listener;
47 #endif /* LIVESTATUSLISTENER_H */