#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"
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));
}
+
+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());
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);