mirror of https://github.com/Icinga/icinga2.git
Fix that triggered_by field is not of type int in a livestatus response
fixes #5356
This commit is contained in:
parent
9bf44b9b1d
commit
772f319926
|
@ -152,5 +152,5 @@ Value DowntimesTable::TriggeredByAccessor(const Value& row)
|
||||||
{
|
{
|
||||||
Downtime::Ptr downtime = static_cast<Downtime::Ptr>(row);
|
Downtime::Ptr downtime = static_cast<Downtime::Ptr>(row);
|
||||||
|
|
||||||
return downtime->GetTriggeredBy();
|
return downtime->GetTriggeredByLegacyId();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ class Downtime
|
||||||
[state] double trigger_time;
|
[state] double trigger_time;
|
||||||
[state] bool fixed;
|
[state] bool fixed;
|
||||||
[state] double duration;
|
[state] double duration;
|
||||||
|
[state] int triggered_by_legacy_id;
|
||||||
[state] String triggered_by;
|
[state] String triggered_by;
|
||||||
[state] String scheduled_by;
|
[state] String scheduled_by;
|
||||||
[state] Dictionary::Ptr triggers {
|
[state] Dictionary::Ptr triggers {
|
||||||
|
|
|
@ -70,6 +70,11 @@ String Service::AddDowntime(const String& author, const String& comment,
|
||||||
downtime->SetTriggeredBy(triggeredBy);
|
downtime->SetTriggeredBy(triggeredBy);
|
||||||
downtime->SetScheduledBy(scheduledBy);
|
downtime->SetScheduledBy(scheduledBy);
|
||||||
|
|
||||||
|
if (!triggeredBy.IsEmpty()) {
|
||||||
|
Downtime::Ptr triggerDowntime = GetDowntimeByID(triggeredBy);
|
||||||
|
downtime->SetTriggeredByLegacyId(triggerDowntime->GetLegacyId());
|
||||||
|
}
|
||||||
|
|
||||||
int legacy_id;
|
int legacy_id;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue