mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
parent
1ab5639c9a
commit
7dae41ee98
@ -22,6 +22,7 @@
|
||||
#include "icinga/checkcommand.h"
|
||||
#include "icinga/notification.h"
|
||||
#include "icinga/macroprocessor.h"
|
||||
#include "icinga/externalcommandprocessor.h"
|
||||
#include "config/configcompilercontext.h"
|
||||
#include "base/dynamictype.h"
|
||||
#include "base/objectlock.h"
|
||||
@ -56,6 +57,7 @@ void CompatLogger::Start(void)
|
||||
Service::OnFlappingChanged.connect(bind(&CompatLogger::FlappingHandler, this, _1, _2));
|
||||
Service::OnDowntimeTriggered.connect(boost::bind(&CompatLogger::TriggerDowntimeHandler, this, _1, _2));
|
||||
Service::OnDowntimeRemoved.connect(boost::bind(&CompatLogger::RemoveDowntimeHandler, this, _1, _2));
|
||||
ExternalCommandProcessor::OnNewExternalCommand.connect(bind(&CompatLogger::ExternalCommandHandler, this, _2, _3));
|
||||
|
||||
m_RotationTimer = boost::make_shared<Timer>();
|
||||
m_RotationTimer->OnTimerExpired.connect(boost::bind(&CompatLogger::RotationTimerHandler, this));
|
||||
@ -413,6 +415,21 @@ void CompatLogger::FlappingHandler(const Service::Ptr& service, FlappingState fl
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CompatLogger::ExternalCommandHandler(const String& command, const std::vector<String>& arguments)
|
||||
{
|
||||
std::ostringstream msgbuf;
|
||||
msgbuf << "EXTERNAL COMMAND: "
|
||||
<< command << ";"
|
||||
<< boost::algorithm::join(arguments, ";")
|
||||
<< "";
|
||||
|
||||
{
|
||||
ObjectLock oLock(this);
|
||||
WriteLine(msgbuf.str());
|
||||
}
|
||||
}
|
||||
|
||||
void CompatLogger::WriteLine(const String& line)
|
||||
{
|
||||
ASSERT(OwnsLock());
|
||||
|
@ -67,6 +67,7 @@ private:
|
||||
void FlappingHandler(const Service::Ptr& service, FlappingState flapping_state);
|
||||
void TriggerDowntimeHandler(const Service::Ptr& service, const Dictionary::Ptr& downtime);
|
||||
void RemoveDowntimeHandler(const Service::Ptr& service, const Dictionary::Ptr& downtime);
|
||||
void ExternalCommandHandler(const String& command, const std::vector<String>& arguments);
|
||||
|
||||
Timer::Ptr m_RotationTimer;
|
||||
void RotationTimerHandler(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user