mirror of
https://github.com/Icinga/icinga2.git
synced 2026-02-19 02:29:16 -05:00
I've used the following command to replace the original copyright header
lines in a C-style comment block:
```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{/\*[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*\*/}{// SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n// SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```
For files that use shell-style comments (#) like CMakeLists.txt, I've
used this command:
```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{#.*\(\s*c\s*\)\s(\d{4})\sIcinga\s+GmbH.*}{# SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n# SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```
And for SQL files:
```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{--.*\(c\)\s(\d{4})\sIcinga\sGmbH.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{-- Copyright \(c\)\s(\d{4})\sIcinga\s+Development\sTeam.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```
193 lines
5 KiB
Text
193 lines
5 KiB
Text
// SPDX-FileCopyrightText: 2012 Icinga GmbH <https://icinga.com>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "icinga/icingaapplication.hpp"
|
|
#include "icinga/customvarobject.hpp"
|
|
#include "base/array.hpp"
|
|
#impl_include "icinga/checkcommand.hpp"
|
|
#impl_include "icinga/eventcommand.hpp"
|
|
|
|
library icinga;
|
|
|
|
namespace icinga
|
|
{
|
|
|
|
code {{{
|
|
/**
|
|
* The acknowledgement type of a service.
|
|
*
|
|
* @ingroup icinga
|
|
*/
|
|
enum AcknowledgementType
|
|
{
|
|
AcknowledgementNone = 0,
|
|
AcknowledgementNormal = 1,
|
|
AcknowledgementSticky = 2
|
|
};
|
|
}}}
|
|
|
|
abstract class Checkable : CustomVarObject
|
|
{
|
|
[config, required, navigation] name(CheckCommand) check_command (CheckCommandRaw) {
|
|
navigate {{{
|
|
return CheckCommand::GetByName(GetCheckCommandRaw());
|
|
}}}
|
|
};
|
|
[config] int max_check_attempts {
|
|
default {{{ return 3; }}}
|
|
};
|
|
[config, navigation] name(TimePeriod) check_period (CheckPeriodRaw) {
|
|
navigate {{{
|
|
return TimePeriod::GetByName(GetCheckPeriodRaw());
|
|
}}}
|
|
};
|
|
[config] Value check_timeout;
|
|
[config] double check_interval {
|
|
default {{{ return 5 * 60; }}}
|
|
};
|
|
[config] double retry_interval {
|
|
default {{{ return 60; }}}
|
|
};
|
|
[config, navigation] name(EventCommand) event_command (EventCommandRaw) {
|
|
navigate {{{
|
|
return EventCommand::GetByName(GetEventCommandRaw());
|
|
}}}
|
|
};
|
|
[config] bool volatile;
|
|
|
|
[config] bool enable_active_checks {
|
|
default {{{ return true; }}}
|
|
};
|
|
[config] bool enable_passive_checks {
|
|
default {{{ return true; }}}
|
|
};
|
|
[config] bool enable_event_handler {
|
|
default {{{ return true; }}}
|
|
};
|
|
[config] bool enable_notifications {
|
|
default {{{ return true; }}}
|
|
};
|
|
[config] bool enable_flapping {
|
|
default {{{ return false; }}}
|
|
};
|
|
[config] bool enable_perfdata {
|
|
default {{{ return true; }}}
|
|
};
|
|
|
|
[config] array(String) flapping_ignore_states;
|
|
[no_user_view, no_user_modify] int flapping_ignore_states_filter_real (FlappingIgnoreStatesFilter);
|
|
|
|
[config, deprecated] double flapping_threshold;
|
|
|
|
[config] double flapping_threshold_low {
|
|
default {{{ return 25; }}}
|
|
};
|
|
|
|
[config] double flapping_threshold_high{
|
|
default {{{ return 30; }}}
|
|
};
|
|
|
|
[config] String notes;
|
|
[config] String notes_url;
|
|
[config] String action_url;
|
|
[config] String icon_image;
|
|
[config] String icon_image_alt;
|
|
|
|
[state] Timestamp next_check;
|
|
[state, no_user_view, no_user_modify] Timestamp last_check_started;
|
|
|
|
[state] int check_attempt {
|
|
default {{{ return 1; }}}
|
|
};
|
|
[state, enum, no_user_view, no_user_modify] ServiceState state_raw {
|
|
default {{{ return ServiceUnknown; }}}
|
|
};
|
|
[state, enum] StateType state_type {
|
|
default {{{ return StateTypeSoft; }}}
|
|
};
|
|
[state, enum, no_user_view, no_user_modify] ServiceState last_state_raw {
|
|
default {{{ return ServiceUnknown; }}}
|
|
};
|
|
[state, enum, no_user_view, no_user_modify] ServiceState last_hard_state_raw {
|
|
default {{{ return ServiceUnknown; }}}
|
|
};
|
|
[state, no_user_view, no_user_modify] "unsigned short" last_hard_states_raw {
|
|
default {{{ return /* current */ 99 * 100 + /* previous */ 99; }}}
|
|
};
|
|
[state, no_user_view, no_user_modify] "unsigned short" last_soft_states_raw {
|
|
default {{{ return /* current */ 99 * 100 + /* previous */ 99; }}}
|
|
};
|
|
[state, enum] StateType last_state_type {
|
|
default {{{ return StateTypeSoft; }}}
|
|
};
|
|
[state] bool last_reachable {
|
|
default {{{ return true; }}}
|
|
};
|
|
[state] CheckResult::Ptr last_check_result;
|
|
[state] Timestamp last_state_change {
|
|
default {{{ return Application::GetStartTime(); }}}
|
|
};
|
|
[state] Timestamp last_hard_state_change {
|
|
default {{{ return Application::GetStartTime(); }}}
|
|
};
|
|
[state] Timestamp last_state_unreachable;
|
|
|
|
[state] Timestamp previous_state_change {
|
|
default {{{ return Application::GetStartTime(); }}}
|
|
};
|
|
[no_storage] int severity {
|
|
get;
|
|
};
|
|
[no_storage] bool problem {
|
|
get;
|
|
};
|
|
[no_storage] bool handled {
|
|
get;
|
|
};
|
|
[no_storage] Timestamp next_update {
|
|
get;
|
|
};
|
|
|
|
[state] bool force_next_check;
|
|
[state] int acknowledgement (AcknowledgementRaw) {
|
|
default {{{ return AcknowledgementNone; }}}
|
|
};
|
|
[state] Timestamp acknowledgement_expiry;
|
|
[state] Timestamp acknowledgement_last_change;
|
|
[state] bool force_next_notification;
|
|
[no_storage] Timestamp last_check {
|
|
get;
|
|
};
|
|
[no_storage] int downtime_depth {
|
|
get;
|
|
};
|
|
|
|
[state] double flapping_current {
|
|
default {{{ return 0; }}}
|
|
};
|
|
[state] Timestamp flapping_last_change;
|
|
|
|
[state, enum, no_user_view, no_user_modify] ServiceState flapping_last_state {
|
|
default {{{ return ServiceUnknown; }}}
|
|
};
|
|
[state, no_user_view, no_user_modify] int flapping_buffer;
|
|
[state, no_user_view, no_user_modify] int flapping_index;
|
|
[state, protected] bool flapping;
|
|
[state, no_user_view, no_user_modify] int suppressed_notifications {
|
|
default {{{ return 0; }}}
|
|
};
|
|
[state, enum, no_user_view, no_user_modify] ServiceState state_before_suppression {
|
|
default {{{ return ServiceOK; }}}
|
|
};
|
|
|
|
[config, navigation] name(Endpoint) command_endpoint (CommandEndpointRaw) {
|
|
navigate {{{
|
|
return Endpoint::GetByName(GetCommandEndpointRaw());
|
|
}}}
|
|
};
|
|
|
|
[state, no_user_modify] Dictionary::Ptr executions;
|
|
[state, no_user_view, no_user_modify] Dictionary::Ptr pending_executions;
|
|
};
|
|
|
|
}
|