2013-01-22 08:34:29 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* Icinga 2 *
|
|
|
|
* Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/) *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
* modify it under the terms of the GNU General Public License *
|
|
|
|
* as published by the Free Software Foundation; either version 2 *
|
|
|
|
* of the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the Free Software Foundation *
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
|
|
******************************************************************************/
|
|
|
|
|
2013-01-29 15:00:39 +01:00
|
|
|
#ifndef EXTERNALCOMMANDPROCESSOR_H
|
|
|
|
#define EXTERNALCOMMANDPROCESSOR_H
|
2013-01-22 08:34:29 +01:00
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
2013-02-09 15:20:10 +01:00
|
|
|
|
2013-01-29 15:00:39 +01:00
|
|
|
class I2_ICINGA_API ExternalCommandProcessor {
|
2013-01-22 08:34:29 +01:00
|
|
|
public:
|
2013-01-24 23:42:02 +01:00
|
|
|
static void Execute(const String& line);
|
2013-01-22 15:13:51 +01:00
|
|
|
static void Execute(double time, const String& command, const vector<String>& arguments);
|
2013-01-22 08:34:29 +01:00
|
|
|
|
2013-01-22 15:13:51 +01:00
|
|
|
static void ProcessServiceCheckResult(double time, const vector<String>& arguments);
|
|
|
|
static void ScheduleSvcCheck(double time, const vector<String>& arguments);
|
|
|
|
static void ScheduleForcedSvcCheck(double time, const vector<String>& arguments);
|
2013-01-22 16:01:08 +01:00
|
|
|
static void EnableSvcCheck(double time, const vector<String>& arguments);
|
|
|
|
static void DisableSvcCheck(double time, const vector<String>& arguments);
|
2013-01-22 16:23:25 +01:00
|
|
|
static void ShutdownProcess(double time, const vector<String>& arguments);
|
2013-01-23 10:42:16 +01:00
|
|
|
static void ScheduleForcedHostSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void ScheduleHostSvcChecks(double time, const vector<String>& arguments);
|
2013-01-23 10:51:54 +01:00
|
|
|
static void EnableHostSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void DisableHostSvcChecks(double time, const vector<String>& arguments);
|
2013-01-23 13:21:07 +01:00
|
|
|
static void AcknowledgeSvcProblem(double time, const vector<String>& arguments);
|
|
|
|
static void AcknowledgeSvcProblemExpire(double time, const vector<String>& arguments);
|
|
|
|
static void RemoveSvcAcknowledgement(double time, const vector<String>& arguments);
|
2013-01-27 11:35:47 +01:00
|
|
|
static void AcknowledgeHostProblem(double time, const vector<String>& arguments);
|
|
|
|
static void AcknowledgeHostProblemExpire(double time, const vector<String>& arguments);
|
|
|
|
static void RemoveHostAcknowledgement(double time, const vector<String>& arguments);
|
2013-01-24 13:39:42 +01:00
|
|
|
static void EnableHostgroupSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void DisableHostgroupSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void EnableServicegroupSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void DisableServicegroupSvcChecks(double time, const vector<String>& arguments);
|
2013-01-24 23:10:07 +01:00
|
|
|
static void EnablePassiveSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void DisablePassiveSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void EnableServicegroupPassiveSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void DisableServicegroupPassiveSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void EnableHostgroupPassiveSvcChecks(double time, const vector<String>& arguments);
|
|
|
|
static void DisableHostgroupPassiveSvcChecks(double time, const vector<String>& arguments);
|
2013-01-24 23:42:02 +01:00
|
|
|
static void ProcessFile(double time, const vector<String>& arguments);
|
2013-01-29 14:19:54 +01:00
|
|
|
static void ScheduleSvcDowntime(double time, const vector<String>& arguments);
|
|
|
|
static void DelSvcDowntime(double time, const vector<String>& arguments);
|
|
|
|
static void ScheduleHostDowntime(double time, const vector<String>& arguments);
|
|
|
|
static void DelHostDowntime(double time, const vector<String>& arguments);
|
|
|
|
static void ScheduleHostSvcDowntime(double time, const vector<String>& arguments);
|
|
|
|
static void ScheduleHostgroupHostDowntime(double time, const vector<String>& arguments);
|
|
|
|
static void ScheduleHostgroupSvcDowntime(double time, const vector<String>& arguments);
|
|
|
|
static void ScheduleServicegroupHostDowntime(double time, const vector<String>& arguments);
|
|
|
|
static void ScheduleServicegroupSvcDowntime(double time, const vector<String>& arguments);
|
2013-01-29 16:29:09 +01:00
|
|
|
static void AddHostComment(double time, const vector<String>& arguments);
|
|
|
|
static void DelHostComment(double time, const vector<String>& arguments);
|
|
|
|
static void AddSvcComment(double time, const vector<String>& arguments);
|
|
|
|
static void DelSvcComment(double time, const vector<String>& arguments);
|
|
|
|
static void DelAllHostComments(double time, const vector<String>& arguments);
|
|
|
|
static void DelAllSvcComments(double time, const vector<String>& arguments);
|
2013-02-09 15:20:10 +01:00
|
|
|
static void SendCustomHostNotification(double time, const vector<String>& arguments);
|
|
|
|
static void SendCustomSvcNotification(double time, const vector<String>& arguments);
|
2013-01-22 08:34:29 +01:00
|
|
|
|
|
|
|
private:
|
2013-01-22 15:13:51 +01:00
|
|
|
typedef function<void (double time, const vector<String>& arguments)> Callback;
|
2013-01-22 08:34:29 +01:00
|
|
|
|
|
|
|
static bool m_Initialized;
|
|
|
|
static map<String, Callback> m_Commands;
|
|
|
|
|
2013-01-29 15:00:39 +01:00
|
|
|
ExternalCommandProcessor(void);
|
2013-01-22 08:34:29 +01:00
|
|
|
|
|
|
|
static void RegisterCommand(const String& command, const Callback& callback);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-01-29 15:00:39 +01:00
|
|
|
#endif /* EXTERNALCOMMANDPROCESSOR_H */
|