]> granicus.if.org Git - icinga2/blob - lib/icinga/service.ti
Replace check result dictionaries with a class.
[icinga2] / lib / icinga / service.ti
1 #include "icinga/host.h"
2 #include "icinga/icingaapplication.h"
3 #include "base/dynamicobject.h"
4
5 namespace icinga
6 {
7
8 code {{{
9 /**
10  * The acknowledgement type of a service.
11  *
12  * @ingroup icinga
13  */
14 enum AcknowledgementType
15 {
16         AcknowledgementNone = 0,
17         AcknowledgementNormal = 1,
18         AcknowledgementSticky = 2
19 };
20 }}}
21
22 class Service : DynamicObject
23 {
24         [config] String display_name {
25                 get {{{
26                         if (m_DisplayName.IsEmpty())
27                                 return GetShortName();
28                         else
29                                 return m_DisplayName;
30                 }}}
31         };
32         [config] Dictionary::Ptr macros;
33         [config] Array::Ptr host_dependencies;
34         [config] Array::Ptr service_dependencies;
35         [config] Array::Ptr groups;
36         [config, protected] String check_command (CheckCommandRaw);
37         [config] int max_check_attempts {
38                 default {{{ return 3; }}}
39         };
40         [config, protected] String check_period (CheckPeriodRaw);
41         [config] double check_interval (CheckIntervalRaw) {
42                 default {{{ return 5 * 60; }}}
43         };
44         [config] double retry_interval (RetryIntervalRaw) {
45                 default {{{ return 60; }}}
46         };
47         [config] String event_command (EventCommandRaw);
48         [config] bool volatile;
49         [config] String short_name {
50                 get {{{
51                         if (m_ShortName.IsEmpty())
52                                 return GetName();
53                         else
54                                 return m_ShortName;
55                 }}}
56         };
57         [config] String host (HostRaw);
58         [config] double flapping_threshold {
59                 default {{{ return 30; }}}
60         };
61         [config] Dictionary::Ptr notifications (NotificationDescriptions);
62         [config] bool enable_active_checks (EnableActiveChecksRaw) {
63                 default {{{ return true; }}}
64         };
65         [config] bool enable_passive_checks (EnablePassiveChecksRaw) {
66                 default {{{ return true; }}}
67         };
68         [config] bool enable_event_handler (EnableEventHandlerRaw) {
69                 default {{{ return true; }}}
70         };
71
72         [state] double next_check (NextCheckRaw);
73         [state] int check_attempt {
74                 default {{{ return 1; }}}
75         };
76         [state, enum] ServiceState "state" {
77                 default {{{ return StateUnknown; }}}
78         };
79         [state, enum] StateType state_type {
80                 default {{{ return StateTypeSoft; }}}
81         };
82         [state, enum] ServiceState last_state {
83                 default {{{ return StateUnknown; }}}
84         };
85         [state, enum] ServiceState last_hard_state {
86                 default {{{ return StateUnknown; }}}
87         };
88         [state, enum] StateType last_state_type {
89                 default {{{ return StateTypeSoft; }}}
90         };
91         [state] bool last_reachable {
92                 default {{{ return true; }}}
93         };
94         [state] CheckResult::Ptr last_check_result;
95         [state] double last_state_change {
96                 default {{{ return Application::GetStartTime(); }}}
97         };
98         [state] double last_hard_state_change {
99                 default {{{ return Application::GetStartTime(); }}}
100         };
101         [state] double last_state_ok (LastStateOK);
102         [state] double last_state_warning;
103         [state] double last_state_critical;
104         [state] double last_state_unknown;
105         [state] double last_state_unreachable;
106         [state] bool last_in_downtime;
107         [state] bool force_next_check (ForceNextCheckRaw);
108         [state] int acknowledgement (AcknowledgementRaw) {
109                 default {{{ return AcknowledgementNone; }}}
110         };
111         [state] double acknowledgement_expiry;
112         [state] Dictionary::Ptr comments {
113                 default {{{ return make_shared<Dictionary>(); }}}
114         };
115         [state] Dictionary::Ptr downtimes {
116                 default {{{ return make_shared<Dictionary>(); }}}
117         };
118         [state] bool enable_notifications (EnableNotificationsRaw) {
119                 default {{{ return true; }}}
120         };
121         [state] bool force_next_notification (ForceNextNotificationRaw);
122         [state] int flapping_positive;
123         [state] int flapping_negative;
124         [state] double flapping_last_change;
125         [state] bool enable_flapping (EnableFlappingRaw) {
126                 default {{{ return true; }}}
127         };
128         [state] bool enable_perfdata {
129                 default {{{ return true; }}}
130         };
131         [state] Value override_enable_active_checks;
132         [state] Value override_enable_passive_checks;
133         [state] Value override_check_interval;
134         [state] Value override_retry_interval;
135         [state] Value override_enable_event_handler;
136 };
137
138 }