2019-02-25 14:48:22 +01:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2014-10-17 19:44:31 +02:00
|
|
|
|
2014-05-25 16:23:35 +02:00
|
|
|
#include "icinga/icingaapplication.hpp"
|
|
|
|
#include "icinga/customvarobject.hpp"
|
|
|
|
#include "base/array.hpp"
|
2015-09-22 09:42:30 +02:00
|
|
|
#impl_include "icinga/checkcommand.hpp"
|
|
|
|
#impl_include "icinga/eventcommand.hpp"
|
2014-04-03 15:36:13 +02:00
|
|
|
|
2015-08-04 14:47:44 +02:00
|
|
|
library icinga;
|
|
|
|
|
2014-04-03 15:36:13 +02:00
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
|
|
|
code {{{
|
|
|
|
/**
|
|
|
|
* The acknowledgement type of a service.
|
|
|
|
*
|
|
|
|
* @ingroup icinga
|
|
|
|
*/
|
|
|
|
enum AcknowledgementType
|
|
|
|
{
|
|
|
|
AcknowledgementNone = 0,
|
|
|
|
AcknowledgementNormal = 1,
|
|
|
|
AcknowledgementSticky = 2
|
|
|
|
};
|
|
|
|
}}}
|
|
|
|
|
2014-05-12 16:45:25 +02:00
|
|
|
abstract class Checkable : CustomVarObject
|
2014-04-03 15:36:13 +02:00
|
|
|
{
|
2015-09-22 09:42:30 +02:00
|
|
|
[config, required, navigation] name(CheckCommand) check_command (CheckCommandRaw) {
|
|
|
|
navigate {{{
|
|
|
|
return CheckCommand::GetByName(GetCheckCommandRaw());
|
|
|
|
}}}
|
|
|
|
};
|
2015-08-04 14:47:44 +02:00
|
|
|
[config] int max_check_attempts {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return 3; }}}
|
|
|
|
};
|
2015-09-22 09:42:30 +02:00
|
|
|
[config, navigation] name(TimePeriod) check_period (CheckPeriodRaw) {
|
|
|
|
navigate {{{
|
|
|
|
return TimePeriod::GetByName(GetCheckPeriodRaw());
|
|
|
|
}}}
|
|
|
|
};
|
2016-04-07 15:07:17 +02:00
|
|
|
[config] Value check_timeout;
|
2015-08-04 14:47:44 +02:00
|
|
|
[config] double check_interval {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return 5 * 60; }}}
|
|
|
|
};
|
2015-08-04 14:47:44 +02:00
|
|
|
[config] double retry_interval {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return 60; }}}
|
|
|
|
};
|
2015-09-22 09:42:30 +02:00
|
|
|
[config, navigation] name(EventCommand) event_command (EventCommandRaw) {
|
|
|
|
navigate {{{
|
|
|
|
return EventCommand::GetByName(GetEventCommandRaw());
|
|
|
|
}}}
|
|
|
|
};
|
2014-04-03 15:36:13 +02:00
|
|
|
[config] bool volatile;
|
2017-10-19 17:32:52 +02:00
|
|
|
|
2015-08-04 14:47:44 +02:00
|
|
|
[config] bool enable_active_checks {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return true; }}}
|
|
|
|
};
|
2015-08-04 14:47:44 +02:00
|
|
|
[config] bool enable_passive_checks {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return true; }}}
|
|
|
|
};
|
2015-08-04 14:47:44 +02:00
|
|
|
[config] bool enable_event_handler {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return true; }}}
|
|
|
|
};
|
2015-08-04 14:47:44 +02:00
|
|
|
[config] bool enable_notifications {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return true; }}}
|
|
|
|
};
|
2015-08-04 14:47:44 +02:00
|
|
|
[config] bool enable_flapping {
|
2015-02-09 14:23:09 +01:00
|
|
|
default {{{ return false; }}}
|
2014-04-03 15:36:13 +02:00
|
|
|
};
|
2015-08-04 14:47:44 +02:00
|
|
|
[config] bool enable_perfdata {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return true; }}}
|
|
|
|
};
|
|
|
|
|
2017-10-19 17:32:52 +02:00
|
|
|
[config, deprecated] double flapping_threshold;
|
|
|
|
|
|
|
|
[config] double flapping_threshold_low {
|
|
|
|
default {{{ return 25; }}}
|
|
|
|
};
|
|
|
|
|
|
|
|
[config] double flapping_threshold_high{
|
|
|
|
default {{{ return 30; }}}
|
|
|
|
};
|
|
|
|
|
2014-04-08 13:23:24 +02:00
|
|
|
[config] String notes;
|
|
|
|
[config] String notes_url;
|
|
|
|
[config] String action_url;
|
|
|
|
[config] String icon_image;
|
|
|
|
[config] String icon_image_alt;
|
|
|
|
|
2016-06-21 11:29:12 +02:00
|
|
|
[state] Timestamp next_check;
|
2014-04-03 15:36:13 +02:00
|
|
|
[state] int check_attempt {
|
|
|
|
default {{{ return 1; }}}
|
|
|
|
};
|
2015-11-02 14:10:44 +01:00
|
|
|
[state, enum, no_user_view, no_user_modify] ServiceState state_raw {
|
2014-04-08 09:11:54 +02:00
|
|
|
default {{{ return ServiceUnknown; }}}
|
2014-04-03 15:36:13 +02:00
|
|
|
};
|
|
|
|
[state, enum] StateType state_type {
|
|
|
|
default {{{ return StateTypeSoft; }}}
|
|
|
|
};
|
2015-11-02 14:10:44 +01:00
|
|
|
[state, enum, no_user_view, no_user_modify] ServiceState last_state_raw {
|
2014-04-08 09:11:54 +02:00
|
|
|
default {{{ return ServiceUnknown; }}}
|
2014-04-03 15:36:13 +02:00
|
|
|
};
|
2015-11-02 14:10:44 +01:00
|
|
|
[state, enum, no_user_view, no_user_modify] ServiceState last_hard_state_raw {
|
2014-04-08 09:11:54 +02:00
|
|
|
default {{{ return ServiceUnknown; }}}
|
2014-04-03 15:36:13 +02:00
|
|
|
};
|
|
|
|
[state, enum] StateType last_state_type {
|
|
|
|
default {{{ return StateTypeSoft; }}}
|
|
|
|
};
|
|
|
|
[state] bool last_reachable {
|
|
|
|
default {{{ return true; }}}
|
|
|
|
};
|
|
|
|
[state] CheckResult::Ptr last_check_result;
|
2016-06-21 11:29:12 +02:00
|
|
|
[state] Timestamp last_state_change {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return Application::GetStartTime(); }}}
|
|
|
|
};
|
2016-06-21 11:29:12 +02:00
|
|
|
[state] Timestamp last_hard_state_change {
|
2014-04-03 15:36:13 +02:00
|
|
|
default {{{ return Application::GetStartTime(); }}}
|
|
|
|
};
|
2016-06-21 11:29:12 +02:00
|
|
|
[state] Timestamp last_state_unreachable;
|
2017-02-09 15:32:10 +01:00
|
|
|
|
2019-03-27 11:43:14 +01:00
|
|
|
[state] Timestamp previous_state_change {
|
|
|
|
default {{{ return Application::GetStartTime(); }}}
|
|
|
|
};
|
2017-02-09 15:32:10 +01:00
|
|
|
[no_storage] int severity {
|
|
|
|
get;
|
|
|
|
};
|
2019-04-09 11:34:59 +02:00
|
|
|
[no_storage] bool problem {
|
|
|
|
get;
|
|
|
|
};
|
|
|
|
[no_storage] bool handled {
|
|
|
|
get;
|
|
|
|
};
|
2017-02-09 15:32:10 +01:00
|
|
|
|
2015-08-04 14:47:44 +02:00
|
|
|
[state] bool force_next_check;
|
2014-04-03 15:36:13 +02:00
|
|
|
[state] int acknowledgement (AcknowledgementRaw) {
|
|
|
|
default {{{ return AcknowledgementNone; }}}
|
|
|
|
};
|
2016-06-21 11:29:12 +02:00
|
|
|
[state] Timestamp acknowledgement_expiry;
|
2015-08-04 14:47:44 +02:00
|
|
|
[state] bool force_next_notification;
|
2016-06-21 11:29:12 +02:00
|
|
|
[no_storage] Timestamp last_check {
|
2015-11-02 14:10:44 +01:00
|
|
|
get;
|
|
|
|
};
|
2016-06-25 17:32:12 +02:00
|
|
|
[no_storage] int downtime_depth {
|
|
|
|
get;
|
|
|
|
};
|
2014-11-13 11:23:57 +01:00
|
|
|
|
2017-10-19 17:32:52 +02:00
|
|
|
[state] double flapping_current {
|
|
|
|
default {{{ return 0; }}}
|
|
|
|
};
|
|
|
|
[state] Timestamp flapping_last_change;
|
2017-11-03 17:50:59 +01:00
|
|
|
|
2017-10-19 17:32:52 +02:00
|
|
|
[state, no_user_view, no_user_modify] int flapping_buffer;
|
2017-11-03 17:50:59 +01:00
|
|
|
[state, no_user_view, no_user_modify] int flapping_index;
|
2017-10-19 17:32:52 +02:00
|
|
|
[state, protected] bool flapping;
|
|
|
|
|
2015-09-22 09:42:30 +02:00
|
|
|
[config, navigation] name(Endpoint) command_endpoint (CommandEndpointRaw) {
|
|
|
|
navigate {{{
|
|
|
|
return Endpoint::GetByName(GetCommandEndpointRaw());
|
|
|
|
}}}
|
|
|
|
};
|
2014-04-03 15:36:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|