]> granicus.if.org Git - icinga2/blob - lib/icinga/service.ti
Merge branch 'feature/modified-attributes-4746' into next
[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 (MaxCheckAttemptsRaw) {
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         [config] bool enable_notifications (EnableNotificationsRaw) {
72                 default {{{ return true; }}}
73         };
74         [config] bool enable_flapping (EnableFlappingRaw) {
75                 default {{{ return true; }}}
76         };
77         [config] bool enable_perfdata (EnablePerfdataRaw) {
78                 default {{{ return true; }}}
79         };
80
81         [state] double next_check (NextCheckRaw);
82         [state] int check_attempt {
83                 default {{{ return 1; }}}
84         };
85         [state, enum] ServiceState "state" {
86                 default {{{ return StateUnknown; }}}
87         };
88         [state, enum] StateType state_type {
89                 default {{{ return StateTypeSoft; }}}
90         };
91         [state, enum] ServiceState last_state {
92                 default {{{ return StateUnknown; }}}
93         };
94         [state, enum] ServiceState last_hard_state {
95                 default {{{ return StateUnknown; }}}
96         };
97         [state, enum] StateType last_state_type {
98                 default {{{ return StateTypeSoft; }}}
99         };
100         [state] bool last_reachable {
101                 default {{{ return true; }}}
102         };
103         [state] CheckResult::Ptr last_check_result;
104         [state] double last_state_change {
105                 default {{{ return Application::GetStartTime(); }}}
106         };
107         [state] double last_hard_state_change {
108                 default {{{ return Application::GetStartTime(); }}}
109         };
110         [state] double last_state_ok (LastStateOK);
111         [state] double last_state_warning;
112         [state] double last_state_critical;
113         [state] double last_state_unknown;
114         [state] double last_state_unreachable;
115         [state] bool last_in_downtime;
116         [state] bool force_next_check (ForceNextCheckRaw);
117         [state] int acknowledgement (AcknowledgementRaw) {
118                 default {{{ return AcknowledgementNone; }}}
119         };
120         [state] double acknowledgement_expiry;
121         [state] Dictionary::Ptr comments {
122                 default {{{ return make_shared<Dictionary>(); }}}
123         };
124         [state] Dictionary::Ptr downtimes {
125                 default {{{ return make_shared<Dictionary>(); }}}
126         };
127         [state] bool force_next_notification (ForceNextNotificationRaw);
128         [state] int flapping_positive;
129         [state] int flapping_negative;
130         [state] double flapping_last_change;
131         [state] Value override_enable_notifications;
132         [state] Value override_enable_active_checks;
133         [state] Value override_enable_passive_checks;
134         [state] Value override_enable_flapping;
135         [state] Value override_enable_perfdata;
136         [state] Value override_check_interval;
137         [state] Value override_retry_interval;
138         [state] Value override_enable_event_handler;
139         [state] Value override_event_command;
140         [state] Value override_check_command;
141         [state] Value override_max_check_attempts;
142         [state] Value override_check_period;
143 };
144
145 }