mirror of https://github.com/Icinga/icinga2.git
Implemented external command "SHUTDOWN_PROGRAM".
This commit is contained in:
parent
856c5c5a8a
commit
a63a1002a8
|
@ -33,6 +33,7 @@ void ExternalCommand::Execute(double time, const String& command, const vector<S
|
|||
RegisterCommand("SCHEDULE_FORCED_SVC_CHECK", &ExternalCommand::ScheduleForcedSvcCheck);
|
||||
RegisterCommand("ENABLE_SVC_CHECK", &ExternalCommand::EnableSvcCheck);
|
||||
RegisterCommand("DISABLE_SVC_CHECK", &ExternalCommand::DisableSvcCheck);
|
||||
RegisterCommand("SHUTDOWN_PROCESS", &ExternalCommand::ShutdownProcess);
|
||||
|
||||
m_Initialized = true;
|
||||
}
|
||||
|
@ -145,3 +146,9 @@ void ExternalCommand::DisableSvcCheck(double time, const vector<String>& argumen
|
|||
service->SetEnableChecks(false);
|
||||
}
|
||||
|
||||
void ExternalCommand::ShutdownProcess(double time, const vector<String>& arguments)
|
||||
{
|
||||
Logger::Write(LogInformation, "icinga", "Shutting down Icinga via external command.");
|
||||
Application::RequestShutdown();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
static void ScheduleForcedSvcCheck(double time, const vector<String>& arguments);
|
||||
static void EnableSvcCheck(double time, const vector<String>& arguments);
|
||||
static void DisableSvcCheck(double time, const vector<String>& arguments);
|
||||
static void ShutdownProcess(double time, const vector<String>& arguments);
|
||||
|
||||
private:
|
||||
typedef function<void (double time, const vector<String>& arguments)> Callback;
|
||||
|
|
Loading…
Reference in New Issue