]> granicus.if.org Git - icinga2/blob - lib/icinga/externalcommandprocessor.h
Implemented support for disabling notifications.
[icinga2] / lib / icinga / externalcommandprocessor.h
1 /******************************************************************************
2  * Icinga 2                                                                   *
3  * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
4  *                                                                            *
5  * This program is free software; you can redistribute it and/or              *
6  * modify it under the terms of the GNU General Public License                *
7  * as published by the Free Software Foundation; either version 2             *
8  * of the License, or (at your option) any later version.                     *
9  *                                                                            *
10  * This program is distributed in the hope that it will be useful,            *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
13  * GNU General Public License for more details.                               *
14  *                                                                            *
15  * You should have received a copy of the GNU General Public License          *
16  * along with this program; if not, write to the Free Software Foundation     *
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
18  ******************************************************************************/
19
20 #ifndef EXTERNALCOMMANDPROCESSOR_H
21 #define EXTERNALCOMMANDPROCESSOR_H
22
23 namespace icinga
24 {
25
26 class I2_ICINGA_API ExternalCommandProcessor {
27 public:
28         static void Execute(const String& line);
29         static void Execute(double time, const String& command, const vector<String>& arguments);
30
31 private:
32         typedef function<void (double time, const vector<String>& arguments)> Callback;
33
34         static boost::once_flag m_InitializeOnce;
35         static boost::mutex m_Mutex;
36         static map<String, Callback> m_Commands;
37
38         ExternalCommandProcessor(void);
39
40         static void Initialize(void);
41
42         static void RegisterCommand(const String& command, const Callback& callback);
43
44         static void ProcessHostCheckResult(double time, const vector<String>& arguments);
45         static void ProcessServiceCheckResult(double time, const vector<String>& arguments);
46         static void ScheduleHostCheck(double time, const vector<String>& arguments);
47         static void ScheduleForcedHostCheck(double time, const vector<String>& arguments);
48         static void ScheduleSvcCheck(double time, const vector<String>& arguments);
49         static void ScheduleForcedSvcCheck(double time, const vector<String>& arguments);
50         static void EnableHostCheck(double time, const vector<String>& arguments);
51         static void DisableHostCheck(double time, const vector<String>& arguments);
52         static void EnableSvcCheck(double time, const vector<String>& arguments);
53         static void DisableSvcCheck(double time, const vector<String>& arguments);
54         static void ShutdownProcess(double time, const vector<String>& arguments);
55         static void ScheduleForcedHostSvcChecks(double time, const vector<String>& arguments);
56         static void ScheduleHostSvcChecks(double time, const vector<String>& arguments);
57         static void EnableHostSvcChecks(double time, const vector<String>& arguments);
58         static void DisableHostSvcChecks(double time, const vector<String>& arguments);
59         static void AcknowledgeSvcProblem(double time, const vector<String>& arguments);
60         static void AcknowledgeSvcProblemExpire(double time, const vector<String>& arguments);
61         static void RemoveSvcAcknowledgement(double time, const vector<String>& arguments);
62         static void AcknowledgeHostProblem(double time, const vector<String>& arguments);
63         static void AcknowledgeHostProblemExpire(double time, const vector<String>& arguments);
64         static void RemoveHostAcknowledgement(double time, const vector<String>& arguments);
65         static void EnableHostgroupSvcChecks(double time, const vector<String>& arguments);
66         static void DisableHostgroupSvcChecks(double time, const vector<String>& arguments);
67         static void EnableServicegroupSvcChecks(double time, const vector<String>& arguments);
68         static void DisableServicegroupSvcChecks(double time, const vector<String>& arguments);
69         static void EnablePassiveHostChecks(double time, const vector<String>& arguments);
70         static void DisablePassiveHostChecks(double time, const vector<String>& arguments);
71         static void EnablePassiveSvcChecks(double time, const vector<String>& arguments);
72         static void DisablePassiveSvcChecks(double time, const vector<String>& arguments);
73         static void EnableServicegroupPassiveSvcChecks(double time, const vector<String>& arguments);
74         static void DisableServicegroupPassiveSvcChecks(double time, const vector<String>& arguments);
75         static void EnableHostgroupPassiveSvcChecks(double time, const vector<String>& arguments);
76         static void DisableHostgroupPassiveSvcChecks(double time, const vector<String>& arguments);
77         static void ProcessFile(double time, const vector<String>& arguments);
78         static void ScheduleSvcDowntime(double time, const vector<String>& arguments);
79         static void DelSvcDowntime(double time, const vector<String>& arguments);
80         static void ScheduleHostDowntime(double time, const vector<String>& arguments);
81         static void DelHostDowntime(double time, const vector<String>& arguments);
82         static void ScheduleHostSvcDowntime(double time, const vector<String>& arguments);
83         static void ScheduleHostgroupHostDowntime(double time, const vector<String>& arguments);
84         static void ScheduleHostgroupSvcDowntime(double time, const vector<String>& arguments);
85         static void ScheduleServicegroupHostDowntime(double time, const vector<String>& arguments);
86         static void ScheduleServicegroupSvcDowntime(double time, const vector<String>& arguments);
87         static void AddHostComment(double time, const vector<String>& arguments);
88         static void DelHostComment(double time, const vector<String>& arguments);
89         static void AddSvcComment(double time, const vector<String>& arguments);
90         static void DelSvcComment(double time, const vector<String>& arguments);
91         static void DelAllHostComments(double time, const vector<String>& arguments);
92         static void DelAllSvcComments(double time, const vector<String>& arguments);
93         static void SendCustomHostNotification(double time, const vector<String>& arguments);
94         static void SendCustomSvcNotification(double time, const vector<String>& arguments);
95         static void DelayHostNotification(double time, const vector<String>& arguments);
96         static void DelaySvcNotification(double time, const vector<String>& arguments);
97         static void EnableHostNotifications(double time, const vector<String>& arguments);
98         static void DisableHostNotifications(double time, const vector<String>& arguments);
99         static void EnableSvcNotifications(double time, const vector<String>& arguments);
100         static void DisableSvcNotifications(double time, const vector<String>& arguments);
101 };
102
103 }
104
105 #endif /* EXTERNALCOMMANDPROCESSOR_H */