]> granicus.if.org Git - icinga2/blob - lib/icinga/checkable.ti
Merge pull request #7164 from Icinga/bugfix/notification-times-validate
[icinga2] / lib / icinga / checkable.ti
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #include "icinga/icingaapplication.hpp"
4 #include "icinga/customvarobject.hpp"
5 #include "base/array.hpp"
6 #impl_include "icinga/checkcommand.hpp"
7 #impl_include "icinga/eventcommand.hpp"
8
9 library icinga;
10
11 namespace icinga
12 {
13
14 code {{{
15 /**
16  * The acknowledgement type of a service.
17  *
18  * @ingroup icinga
19  */
20 enum AcknowledgementType
21 {
22         AcknowledgementNone = 0,
23         AcknowledgementNormal = 1,
24         AcknowledgementSticky = 2
25 };
26 }}}
27
28 abstract class Checkable : CustomVarObject
29 {
30         [config, required, navigation] name(CheckCommand) check_command (CheckCommandRaw) {
31                 navigate {{{
32                         return CheckCommand::GetByName(GetCheckCommandRaw());
33                 }}}
34         };
35         [config] int max_check_attempts {
36                 default {{{ return 3; }}}
37         };
38         [config, navigation] name(TimePeriod) check_period (CheckPeriodRaw) {
39                 navigate {{{
40                         return TimePeriod::GetByName(GetCheckPeriodRaw());
41                 }}}
42         };
43         [config] Value check_timeout;
44         [config] double check_interval {
45                 default {{{ return 5 * 60; }}}
46         };
47         [config] double retry_interval {
48                 default {{{ return 60; }}}
49         };
50         [config, navigation] name(EventCommand) event_command (EventCommandRaw) {
51                 navigate {{{
52                         return EventCommand::GetByName(GetEventCommandRaw());
53                 }}}
54         };
55         [config] bool volatile;
56
57         [config] bool enable_active_checks {
58                 default {{{ return true; }}}
59         };
60         [config] bool enable_passive_checks {
61                 default {{{ return true; }}}
62         };
63         [config] bool enable_event_handler {
64                 default {{{ return true; }}}
65         };
66         [config] bool enable_notifications {
67                 default {{{ return true; }}}
68         };
69         [config] bool enable_flapping {
70                 default {{{ return false; }}}
71         };
72         [config] bool enable_perfdata {
73                 default {{{ return true; }}}
74         };
75
76         [config, deprecated] double flapping_threshold;
77
78         [config] double flapping_threshold_low {
79                 default {{{ return 25; }}}
80         };
81
82         [config] double flapping_threshold_high{
83                 default {{{ return 30; }}}
84         };
85
86         [config] String notes;
87         [config] String notes_url;
88         [config] String action_url;
89         [config] String icon_image;
90         [config] String icon_image_alt;
91
92         [state] Timestamp next_check;
93         [state] int check_attempt {
94                 default {{{ return 1; }}}
95         };
96         [state, enum, no_user_view, no_user_modify] ServiceState state_raw {
97                 default {{{ return ServiceUnknown; }}}
98         };
99         [state, enum] StateType state_type {
100                 default {{{ return StateTypeSoft; }}}
101         };
102         [state, enum, no_user_view, no_user_modify] ServiceState last_state_raw {
103                 default {{{ return ServiceUnknown; }}}
104         };
105         [state, enum, no_user_view, no_user_modify] ServiceState last_hard_state_raw {
106                 default {{{ return ServiceUnknown; }}}
107         };
108         [state, enum] StateType last_state_type {
109                 default {{{ return StateTypeSoft; }}}
110         };
111         [state] bool last_reachable {
112                 default {{{ return true; }}}
113         };
114         [state] CheckResult::Ptr last_check_result;
115         [state] Timestamp last_state_change {
116                 default {{{ return Application::GetStartTime(); }}}
117         };
118         [state] Timestamp last_hard_state_change {
119                 default {{{ return Application::GetStartTime(); }}}
120         };
121         [state] Timestamp last_state_unreachable;
122
123         [state] Timestamp previous_state_change {
124                 default {{{ return Application::GetStartTime(); }}}
125         };
126         [no_storage] int severity {
127                 get;
128         };
129         [no_storage] bool problem {
130                 get;
131         };
132         [no_storage] bool handled {
133                 get;
134         };
135
136         [state] bool force_next_check;
137         [state] int acknowledgement (AcknowledgementRaw) {
138                 default {{{ return AcknowledgementNone; }}}
139         };
140         [state] Timestamp acknowledgement_expiry;
141         [state] bool force_next_notification;
142         [no_storage] Timestamp last_check {
143                 get;
144         };
145         [no_storage] int downtime_depth {
146                 get;
147         };
148
149         [state] double flapping_current {
150                 default {{{ return 0; }}}
151         };
152         [state] Timestamp flapping_last_change;
153
154         [state, no_user_view, no_user_modify] int flapping_buffer;
155         [state, no_user_view, no_user_modify] int flapping_index;
156         [state, protected] bool flapping;
157
158         [config, navigation] name(Endpoint) command_endpoint (CommandEndpointRaw) {
159                 navigate {{{
160                         return Endpoint::GetByName(GetCommandEndpointRaw());
161                 }}}
162         };
163 };
164
165 }