cacti icon indicating copy to clipboard operation
cacti copied to clipboard

Automation tree insertion improvements

Open g1augusto opened this issue 8 years ago • 5 comments

Hi,

Is it possible or planned to extend the Tree Rules to follow a simple selection algorithm?

I noticed that the rules are essentially top-down implemented and we have an iterative tree structure so we could avoid repeating the same rules for multiple sites, an example:

Our Tree structure will be the following:

EMEA (Root Tree) -- Site 1 -- -- Access Switches ---> 1 Rule in Tree Rules -- -- Core Switches ---> 1 Rule in Tree Rules -- -- etc... ---> 1 Rule in Tree Rules each more -- Site 2 -- -- Access Switches ---> 1 Rule in Tree Rules -- -- Core Switches ---> 1 Rule in Tree Rules -- -- etc... ---> 1 Rule in Tree Rules each more

And each one of the devices to be inserted in the related subtree of each site will need to be a specific rule with slight differences to the matching patterns, and no chance to aggregate it, also I expect that having a certain number of sites, the last site in the tree rule will have to go through all tree rules before having an exit condition to the matching rule for tree insertion

Now the way I'd see the tree insertion rules simplified would be the following

EMEA (Root Tree) -- Site 1 ---> Main condition 1 (match pattern on the hostname or ip, etc) -- -- Access Switches ---> sub condition 1 (match pattern on hostname, or else) -- -- Core Switches ---> sub condition 2 (match pattern on hostname, or else) -- -- etc... ---> sub condition 3 (match pattern on hostname, or else) for each -- Site 2 ---> Main condition 2 (match pattern on the hostname or ip, etc) -- -- Access Switches ---> sub condition 1 (match pattern on hostname, or else) -- -- Core Switches ---> sub condition 2 (match pattern on hostname, or else) -- -- etc... ---> sub condition 3 (match pattern on hostname, or else) for each

So the Main condition would select a specific Root and call the sub condition X that would always be the same (iterative tree structure is common for most of deployments I believe) so that the task would be only to extend the Main condition rules and the Tree Rules would not be inspected each time sequentially.

This may save implementation time for the user and maybe some processing time for the server maybe.

Let me know if more info are needed or if I explained correctly what do I have in mind.

Thanks for your time.

g1augusto avatar Apr 30 '17 10:04 g1augusto

There are plans for a Site branch type that includes Device Template as a Leaf level.

cigamit avatar May 01 '17 02:05 cigamit

Thank you,

No rush, just do you have an expectation of when the restructure of the automation will happen, or should I start with what there is available currently :) ?

g1augusto avatar May 01 '17 08:05 g1augusto

That's a tree change, not automation. But I'm sure it's more of both. It's on the list of things to do. But as you can see by the growing list of 'enhancement' requests, ordering is going to start from easy things to harder things. Right now, we are doing weekly or semi weekly releases to get all the bugs wrung our of the system. Once we have something pretty stable, we will start hitting more core issues.

cigamit avatar May 01 '17 11:05 cigamit

Thank you,

I appreciate the commitment you have on looking into these enhancements.

I agree that is better for everyone you working on bugfixes.

I will wait for you to be OK on a release of all enhancements scheduling them on some correlation between them.

Again. thanks :)

g1augusto avatar May 01 '17 15:05 g1augusto

@g1augusto, I've been giving this some thought (at long last) and I'm thinking of adding a Device Type or Device Types table that allows you to map various devices to a Device Type. From there, we can auto-generate a Trees using patterns. For example, Cacti has the following object meta-data today:

Site Table: Country, City, State, Site (and soon to be Region) Host Table: Site, Location, Host Template, Hostname

So, as a feature, you could build a Tree hierarchically using a pattern such as:

Region/Country/Site/Location Country/State/Site/Location Region/State/Site State/Site/Location ...

So, if we support building a Tree based upon those patterns. Do you think that's enough. Adding Host Groups or Device Groups is fairly trivial.

TheWitness avatar Dec 14 '24 02:12 TheWitness