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 {
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; }}}
72 [state] double next_check (NextCheckRaw);
73 [state] int check_attempt {
74 default {{{ return 1; }}}
76 [state, enum] ServiceState "state" {
77 default {{{ return StateUnknown; }}}
79 [state, enum] StateType state_type {
80 default {{{ return StateTypeSoft; }}}
82 [state, enum] ServiceState last_state {
83 default {{{ return StateUnknown; }}}
85 [state, enum] ServiceState last_hard_state {
86 default {{{ return StateUnknown; }}}
88 [state, enum] StateType last_state_type {
89 default {{{ return StateTypeSoft; }}}
91 [state] bool last_reachable {
92 default {{{ return true; }}}
94 [state] CheckResult::Ptr last_check_result;
95 [state] double last_state_change {
96 default {{{ return Application::GetStartTime(); }}}
98 [state] double last_hard_state_change {
99 default {{{ return Application::GetStartTime(); }}}
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; }}}
111 [state] double acknowledgement_expiry;
112 [state] Dictionary::Ptr comments {
113 default {{{ return make_shared<Dictionary>(); }}}
115 [state] Dictionary::Ptr downtimes {
116 default {{{ return make_shared<Dictionary>(); }}}
118 [state] bool enable_notifications (EnableNotificationsRaw) {
119 default {{{ return true; }}}
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; }}}
128 [state] bool enable_perfdata {
129 default {{{ return true; }}}
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;