mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
parent
34b5a4d9b4
commit
b23d58dccc
@ -1040,6 +1040,7 @@ Changes to service runtime macros
|
|||||||
LASTSERVICESTATEID | service.last_state_id
|
LASTSERVICESTATEID | service.last_state_id
|
||||||
LASTSERVICESTATETYPE | service.last_state_type
|
LASTSERVICESTATETYPE | service.last_state_type
|
||||||
LASTSERVICESTATECHANGE | service.last_state_change
|
LASTSERVICESTATECHANGE | service.last_state_change
|
||||||
|
SERVICEDOWNTIME | service.downtime_depth
|
||||||
SERVICEDURATIONSEC | service.duration_sec
|
SERVICEDURATIONSEC | service.duration_sec
|
||||||
SERVICELATENCY | service.latency
|
SERVICELATENCY | service.latency
|
||||||
SERVICEEXECUTIONTIME | service.execution_time
|
SERVICEEXECUTIONTIME | service.execution_time
|
||||||
@ -1070,6 +1071,7 @@ Changes to host runtime macros
|
|||||||
LASTHOSTSTATEID | host.last_state_id
|
LASTHOSTSTATEID | host.last_state_id
|
||||||
LASTHOSTSTATETYPE | host.last_state_type
|
LASTHOSTSTATETYPE | host.last_state_type
|
||||||
LASTHOSTSTATECHANGE | host.last_state_change
|
LASTHOSTSTATECHANGE | host.last_state_change
|
||||||
|
HOSTDOWNTIME | host.downtime_depth
|
||||||
HOSTDURATIONSEC | host.duration_sec
|
HOSTDURATIONSEC | host.duration_sec
|
||||||
HOSTLATENCY | host.latency
|
HOSTLATENCY | host.latency
|
||||||
HOSTEXECUTIONTIME | host.execution_time
|
HOSTEXECUTIONTIME | host.execution_time
|
||||||
|
@ -2034,6 +2034,7 @@ hosts or services:
|
|||||||
host.last_state_id | The host's previous state. Can be one of `0` (up), `1` (down) and `2` (unreachable).
|
host.last_state_id | The host's previous state. Can be one of `0` (up), `1` (down) and `2` (unreachable).
|
||||||
host.last_state_type | The host's previous state type. Can be one of `SOFT` and `HARD`.
|
host.last_state_type | The host's previous state type. Can be one of `SOFT` and `HARD`.
|
||||||
host.last_state_change | The last state change's timestamp.
|
host.last_state_change | The last state change's timestamp.
|
||||||
|
host.downtime_depth | The number of active downtimes.
|
||||||
host.duration_sec | The time since the last state change.
|
host.duration_sec | The time since the last state change.
|
||||||
host.latency | The host's check latency.
|
host.latency | The host's check latency.
|
||||||
host.execution_time | The host's check execution time.
|
host.execution_time | The host's check execution time.
|
||||||
@ -2066,6 +2067,7 @@ services:
|
|||||||
service.last_state_id | The service's previous state. Can be one of `0` (ok), `1` (warning), `2` (critical) and `3` (unknown).
|
service.last_state_id | The service's previous state. Can be one of `0` (ok), `1` (warning), `2` (critical) and `3` (unknown).
|
||||||
service.last_state_type | The service's previous state type. Can be one of `SOFT` and `HARD`.
|
service.last_state_type | The service's previous state type. Can be one of `SOFT` and `HARD`.
|
||||||
service.last_state_change | The last state change's timestamp.
|
service.last_state_change | The last state change's timestamp.
|
||||||
|
service.downtime_depth | The number of active downtimes.
|
||||||
service.duration_sec | The time since the last state change.
|
service.duration_sec | The time since the last state change.
|
||||||
service.latency | The service's check latency.
|
service.latency | The service's check latency.
|
||||||
service.execution_time | The service's check execution time.
|
service.execution_time | The service's check execution time.
|
||||||
|
@ -234,6 +234,9 @@ bool Host::ResolveMacro(const String& macro, const CheckResult::Ptr&, Value *res
|
|||||||
} else if (macro == "last_state_change") {
|
} else if (macro == "last_state_change") {
|
||||||
*result = Convert::ToString((long)GetLastStateChange());
|
*result = Convert::ToString((long)GetLastStateChange());
|
||||||
return true;
|
return true;
|
||||||
|
} else if (macro == "downtime_depth") {
|
||||||
|
*result = Convert::ToString((long)GetDowntimeDepth());
|
||||||
|
return true;
|
||||||
} else if (macro == "duration_sec") {
|
} else if (macro == "duration_sec") {
|
||||||
*result = Convert::ToString((long)(Utility::GetTime() - GetLastStateChange()));
|
*result = Convert::ToString((long)(Utility::GetTime() - GetLastStateChange()));
|
||||||
return true;
|
return true;
|
||||||
|
@ -157,6 +157,9 @@ bool Service::ResolveMacro(const String& macro, const CheckResult::Ptr& cr, Valu
|
|||||||
} else if (macro == "last_state_change") {
|
} else if (macro == "last_state_change") {
|
||||||
*result = Convert::ToString((long)GetLastStateChange());
|
*result = Convert::ToString((long)GetLastStateChange());
|
||||||
return true;
|
return true;
|
||||||
|
} else if (macro == "downtime_depth") {
|
||||||
|
*result = Convert::ToString((long)GetDowntimeDepth());
|
||||||
|
return true;
|
||||||
} else if (macro == "duration_sec") {
|
} else if (macro == "duration_sec") {
|
||||||
*result = Convert::ToString((long)(Utility::GetTime() - GetLastStateChange()));
|
*result = Convert::ToString((long)(Utility::GetTime() - GetLastStateChange()));
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user