1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
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"
16 * The acknowledgement type of a service.
20 enum AcknowledgementType
22 AcknowledgementNone = 0,
23 AcknowledgementNormal = 1,
24 AcknowledgementSticky = 2
28 abstract class Checkable : CustomVarObject
30 [config, required, navigation] name(CheckCommand) check_command (CheckCommandRaw) {
32 return CheckCommand::GetByName(GetCheckCommandRaw());
35 [config] int max_check_attempts {
36 default {{{ return 3; }}}
38 [config, navigation] name(TimePeriod) check_period (CheckPeriodRaw) {
40 return TimePeriod::GetByName(GetCheckPeriodRaw());
43 [config] Value check_timeout;
44 [config] double check_interval {
45 default {{{ return 5 * 60; }}}
47 [config] double retry_interval {
48 default {{{ return 60; }}}
50 [config, navigation] name(EventCommand) event_command (EventCommandRaw) {
52 return EventCommand::GetByName(GetEventCommandRaw());
55 [config] bool volatile;
57 [config] bool enable_active_checks {
58 default {{{ return true; }}}
60 [config] bool enable_passive_checks {
61 default {{{ return true; }}}
63 [config] bool enable_event_handler {
64 default {{{ return true; }}}
66 [config] bool enable_notifications {
67 default {{{ return true; }}}
69 [config] bool enable_flapping {
70 default {{{ return false; }}}
72 [config] bool enable_perfdata {
73 default {{{ return true; }}}
76 [config, deprecated] double flapping_threshold;
78 [config] double flapping_threshold_low {
79 default {{{ return 25; }}}
82 [config] double flapping_threshold_high{
83 default {{{ return 30; }}}
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;
92 [state] Timestamp next_check;
93 [state] int check_attempt {
94 default {{{ return 1; }}}
96 [state, enum, no_user_view, no_user_modify] ServiceState state_raw {
97 default {{{ return ServiceUnknown; }}}
99 [state, enum] StateType state_type {
100 default {{{ return StateTypeSoft; }}}
102 [state, enum, no_user_view, no_user_modify] ServiceState last_state_raw {
103 default {{{ return ServiceUnknown; }}}
105 [state, enum, no_user_view, no_user_modify] ServiceState last_hard_state_raw {
106 default {{{ return ServiceUnknown; }}}
108 [state, enum] StateType last_state_type {
109 default {{{ return StateTypeSoft; }}}
111 [state] bool last_reachable {
112 default {{{ return true; }}}
114 [state] CheckResult::Ptr last_check_result;
115 [state] Timestamp last_state_change {
116 default {{{ return Application::GetStartTime(); }}}
118 [state] Timestamp last_hard_state_change {
119 default {{{ return Application::GetStartTime(); }}}
121 [state] Timestamp last_state_unreachable;
123 [state] Timestamp previous_state_change {
124 default {{{ return Application::GetStartTime(); }}}
126 [no_storage] int severity {
129 [no_storage] bool problem {
132 [no_storage] bool handled {
136 [state] bool force_next_check;
137 [state] int acknowledgement (AcknowledgementRaw) {
138 default {{{ return AcknowledgementNone; }}}
140 [state] Timestamp acknowledgement_expiry;
141 [state] bool force_next_notification;
142 [no_storage] Timestamp last_check {
145 [no_storage] int downtime_depth {
149 [state] double flapping_current {
150 default {{{ return 0; }}}
152 [state] Timestamp flapping_last_change;
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;
158 [config, navigation] name(Endpoint) command_endpoint (CommandEndpointRaw) {
160 return Endpoint::GetByName(GetCommandEndpointRaw());