Need a help

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
MaxP
Posts: 1
Joined: Wed Aug 21, 2019 5:18 am

Need a help

Post by MaxP »

Hi!

Is there a way to dynamically check for and ultimately select a subtree based on a HOST field?

Example: Existing Tree Structure:

Customers -
{123456} - Example Customer
Routers -
Host: blah
Switches -

A new device is added with the following description and notes:
Host Description: 123456-2950S-1

I would like to be able to check if the NODE 123456 is present and if so, add the new host under the appropriate SUB. Putting it in the right place isn't too bad but I haven't seen where it is possible to check for the existence of a sub-tree item.

Thanks!
netniV
Cacti Guru User
Posts: 3441
Joined: Sun Aug 27, 2017 12:05 am

Re: Need a help

Post by netniV »

Currently, no. Because the device can be added to more than one location in a tree at the same time. You could add it as an enhancement request on GitHub but we'd probably have to make that select the first one found which may not be the one you expect.
Cacti Developer & Release Manager
The Cacti Group

Director
BV IT Solutions Ltd

+--------------------------------------------------------------------------+

Cacti Resources:
Cacti Website (including releases)
Cacti Issues
Cacti Development Releases
Cacti Development Documentation
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: Need a help

Post by Osiris »

It would be simple to write though. 20 minutes work and maybe a redirect in the end. Something like:

https://mysite.com/cacti/graph_view.php ... tion:12345}

Pass it a JSON array and it redirects with a special flag to open the found leaf and select device.
Before history, there was a paradise, now dust.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests