1 #include "icinga/host.h"
2 #include "icinga/icingaapplication.h"
3 #include "base/dynamicobject.h"
10 * The acknowledgement type of a service.
14 enum AcknowledgementType
16 AcknowledgementNone = 0,
17 AcknowledgementNormal = 1,
18 AcknowledgementSticky = 2
22 class Service : DynamicObject
24 [config] String display_name {
26 if (m_DisplayName.IsEmpty())
27 return GetShortName();
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; }}}
40 [config, protected] String check_period (CheckPeriodRaw);
41 [config] double check_interval (CheckIntervalRaw) {
42 default {{{ return 5 * 60; }}}
44 [config] double retry_interval (RetryIntervalRaw) {
45 default {{{ return 60; }}}
47 [config] String event_command (EventCommandRaw);
48 [config] bool volatile;
49 [config] String short_name {
51 if (m_ShortName.IsEmpty())
57 [config] String host (HostRaw);
58 [config] double flapping_threshold {
59 default {{{ return 30; }}}
61 [config] Dictionary::Ptr notifications (NotificationDescriptions);
62 [config] bool enable_active_checks (EnableActiveChecksRaw) {
63 default {{{ return true; }}}
65 [config] bool enable_passive_checks (EnablePassiveChecksRaw) {
66 default {{{ return true; }}}
68 [config] bool enable_event_handler (EnableEventHandlerRaw) {
69 default {{{ return true; }}}
71 [config] bool enable_notifications (EnableNotificationsRaw) {
72 default {{{ return true; }}}
74 [config] bool enable_flapping (EnableFlappingRaw) {
75 default {{{ return true; }}}
77 [config] bool enable_perfdata (EnablePerfdataRaw) {
78 default {{{ return true; }}}
81 [state] double next_check (NextCheckRaw);
82 [state] int check_attempt {
83 default {{{ return 1; }}}
85 [state, enum] ServiceState "state" {
86 default {{{ return StateUnknown; }}}
88 [state, enum] StateType state_type {
89 default {{{ return StateTypeSoft; }}}
91 [state, enum] ServiceState last_state {
92 default {{{ return StateUnknown; }}}
94 [state, enum] ServiceState last_hard_state {
95 default {{{ return StateUnknown; }}}
97 [state, enum] StateType last_state_type {
98 default {{{ return StateTypeSoft; }}}
100 [state] bool last_reachable {
101 default {{{ return true; }}}
103 [state] CheckResult::Ptr last_check_result;
104 [state] double last_state_change {
105 default {{{ return Application::GetStartTime(); }}}
107 [state] double last_hard_state_change {
108 default {{{ return Application::GetStartTime(); }}}
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; }}}
120 [state] double acknowledgement_expiry;
121 [state] Dictionary::Ptr comments {
122 default {{{ return make_shared<Dictionary>(); }}}
124 [state] Dictionary::Ptr downtimes {
125 default {{{ return make_shared<Dictionary>(); }}}
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;