mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
The `process-check-result` action can now optionally set the `ttl` parameter. This overrules the configured freshness check (check_interval). The main idea behind this is to allow the external sender to specify when the next check result is coming in. For example, a backup script which should be run every 24h can specify the exact expected next check result. The addition to the CheckResult class is necessary to forward the check result throughout the cluster and calculate the `next_check` value on each node. This allows us to send in a check result on a satellite, and the master determines the freshness and possible notifications/state changes for Icinga Web 2.
88 lines
2.3 KiB
Plaintext
88 lines
2.3 KiB
Plaintext
/******************************************************************************
|
|
* Icinga 2 *
|
|
* Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/) *
|
|
* *
|
|
* This program is free software; you can redistribute it and/or *
|
|
* modify it under the terms of the GNU General Public License *
|
|
* as published by the Free Software Foundation; either version 2 *
|
|
* of the License, or (at your option) any later version. *
|
|
* *
|
|
* This program is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
* GNU General Public License for more details. *
|
|
* *
|
|
* You should have received a copy of the GNU General Public License *
|
|
* along with this program; if not, write to the Free Software Foundation *
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
|
******************************************************************************/
|
|
|
|
library icinga;
|
|
|
|
namespace icinga
|
|
{
|
|
|
|
code {{{
|
|
/**
|
|
* The state of a host.
|
|
*
|
|
* @ingroup icinga
|
|
*/
|
|
enum HostState
|
|
{
|
|
HostUp = 0,
|
|
HostDown = 1
|
|
};
|
|
|
|
/**
|
|
* The state of a service.
|
|
*
|
|
* @ingroup icinga
|
|
*/
|
|
enum ServiceState
|
|
{
|
|
ServiceOK = 0,
|
|
ServiceWarning = 1,
|
|
ServiceCritical = 2,
|
|
ServiceUnknown = 3
|
|
};
|
|
|
|
/**
|
|
* The state type of a host or service.
|
|
*
|
|
* @ingroup icinga
|
|
*/
|
|
enum StateType
|
|
{
|
|
StateTypeSoft = 0,
|
|
StateTypeHard = 1
|
|
};
|
|
}}}
|
|
|
|
class CheckResult
|
|
{
|
|
[state] Timestamp schedule_start;
|
|
[state] Timestamp schedule_end;
|
|
[state] Timestamp execution_start;
|
|
[state] Timestamp execution_end;
|
|
|
|
[state] Value command;
|
|
[state] int exit_status;
|
|
|
|
[state, enum] ServiceState "state";
|
|
[state] String output;
|
|
[state] Array::Ptr performance_data;
|
|
|
|
[state] bool active {
|
|
default {{{ return true; }}}
|
|
};
|
|
|
|
[state] String check_source;
|
|
[state] double ttl;
|
|
|
|
[state] Dictionary::Ptr vars_before;
|
|
[state] Dictionary::Ptr vars_after;
|
|
};
|
|
|
|
}
|