You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
For my company we are automatically generating a geographic tree with more than 500 sites. Hosts will in general only be assigned to a site. Using that method the tree search will never return a hit for a host that belongs to specific site, because there is no record existing in graph_tree_items referring its individual host_id.
Create some leaf sites, assign those to the Cacti tree or a tree branch and finally assign some hosts to those new test site records.
Go to the tree view and enter the first characters of one of those hosts.
Hosts will be found, tree will be opened down to host level, including leaf site branches.
No hits. Cacti returns nothing.
Better solutions may exist, but the easiest way is to take the host table in function "get_matching_nodes()" two times (with a RIGHT JOIN) into account as follows:
$matching = db_fetch_assoc_prepared("SELECT gti.parent, gti.graph_tree_id
FROM graph_tree_items AS gti
LEFT JOIN host AS h
RIGHT JOIN host AS h2
LEFT JOIN graph_templates_graph AS gtg
ON gtg.local_graph_id=gti.local_graph_id AND gtg.local_graph_id>0
WHERE gtg.title_cache LIKE ?
OR h.description LIKE ?
OR h.hostname LIKE ?
OR h2.description LIKE ?
OR h2.hostname LIKE ?
OR gti.title LIKE ?",
array($filter, $filter, $filter, $filter, $filter, $filter));
Patch in place
The text was updated successfully, but these errors were encountered: