In case icingadb module is not present Backend in Metadata is set to null which is incorrect.
Also use static fetchDb() from IcingaDbObject class in case icingadb backend is being used.
Move enumHostListByFilter and enumServiceListByFilter to EnumList trait from AddNodeForm and change fetchServices and fetchHosts
method to work with filters in IcingaDbBackEnd class.
Also, applyMonitoringRestriction is changed to applyIcingaDbRestrictions in IcingaDbBackend.
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.
Internally non-process children are only instantiated once.
This means when applying state overrides directly they're
used everywhere and do not differ between the containing
process. State overrides are now applied explicitly and
on demand, decoupling them from children.
Showing the override rules only in tree view but not in tile
view is one problem. Another one however are rules for all
states which then are difficult to decipher while not providing
much benefit.
The flash to indicate the real state also is not intuitive enough.
That's why this change combines both widgets in a single one. This
makes it more clear what the actual state is, what happened to it,
and does not cobble the view with too much state balls.
Storing overrides as part of a node's name leads to way too complicated
code. A separate field is not only better for compatibility but also
more straightforward to process.
Earlier in NodeRemoveAction the states were recalculated for the BpNodes. Hence, the state for parent nodes with unconfirmed deleted monitored nodes (host/service) is set to Unknown. This results in incorrect tile rendering for the parent nodes. Therefore, any call to methods which recalculate the states are removed.
fix#279
The node state is recursively calculated in case the node contains only BpNodes as its children and are empty. The gray tiles and state-balls are used for the entire branch if the children are empty.
In BpNode::recalculateState() the BpNode needs to be recursively checked if its children is empty using BpNode::isEmpty() instead of BpNode::hasChildren().
We need to check recurively whether the BP Nodes contatin only child BpNodes which are empty and set the entire tree to state NODE_EMPTY state in this case.
If the imported node is empty or was deleted at a later time, then in NodeTile::render() $link should not be rendered. Also, NodeTile::addDetailsAction() should not add a `href` to this tile.
Before the child empty nodes where set to missing nodes by BpNode::isMissing().
This has been corrected in this fix by checking if whether a child node is an empty node or not.
An empty node state called `NODE_EMPTY` has been introduced with a value of 128 in class `Node`, and this state has been mapped to value *0* in structure `$stateToSortStateMap`.
Before, the empty nodes were to be considered as missing nodes. Correspondingly, the counter for missing in BpNode::getStateSummary() was increased if an empty node is encountered.
Now, the empty nodes are not assumed as missing nodes and the counter for missing is not increased for this case.