mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-18 18:42:53 -05:00
Change state calculation in IcingaDbState
Since we are fetching the values directly using assembleSelect instead of using ORM, 'last_state_change', 'in_downtime' and 'ack' have different values compared to monitored nodes other than IcingaDb MySQL backend. This is addresses in this commit.
This commit is contained in:
parent
d1526a36cb
commit
f9be5f81d6
1 changed files with 5 additions and 3 deletions
|
|
@ -148,18 +148,20 @@ class IcingaDbState extends IcingaDbBackend
|
|||
return;
|
||||
}
|
||||
|
||||
// Since we are fetching the values directly using assembleSelect instead of using ORM,
|
||||
// the following changes for 'last_state_change', 'in_downtime' and 'ack' is required
|
||||
$node = $config->getNode($key);
|
||||
|
||||
if ($row->state !== null) {
|
||||
$node->setState($row->state)->setMissing(false);
|
||||
}
|
||||
if ($row->last_state_change !== null) {
|
||||
$node->setLastStateChange($row->last_state_change);
|
||||
$node->setLastStateChange($row->last_state_change/1000);
|
||||
}
|
||||
if ((int) $row->in_downtime === 1) {
|
||||
if ($row->in_downtime === 'y') {
|
||||
$node->setDowntime(true);
|
||||
}
|
||||
if ((int) $row->ack === 1) {
|
||||
if ($row->ack !== 'n') {
|
||||
$node->setAck(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue