Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.64k stars 405 forks source link

Enhancement: Integrate Cacti with other systems such as Rancid / Oxidized #1576

Closed g1augusto closed 6 years ago

g1augusto commented 6 years ago

Hi Everyone,

(It's been a while since last request)

Is it possible to integrate CACTI with RANCID and/or OXIDIZED for device list import?

both systems uses CSV files for device configuration retrieval, and the grouping would be easily derived from the SITES in CACTI, this would allow from a nice feature considering these tools lacks a discovery module that instead is already implemented in CACTI.

then about the interface for access would not be a problem, either through the same Web Server or through an additional TAB as an external link.

RANCID : http://www.shrubbery.net/rancid/ OXIDIZED : https://github.com/ytti/oxidized/

netniV commented 6 years ago

The easiest part there would be via external link since that functionality is already present, you can just apply the correct URL.

The device import could probably be part of the automation functions but how to handle the fact that a device may have been previously imported and delete (eg, you may backup the device but you don't want all the monitoring assoicated to it). That's likely for test or temporary units in an environment especially a testing one.

That said, it should probably be done as a plugin since most people wouldn't need that functionality in the base software. If you have sample CSV files, those should probably be attached for review so we don't have to go chasing through pages to find the examples when reviewing.

g1augusto commented 6 years ago

Thank you for looking into this,

Here a sample of RANCID source file:

router.zip

Essentially it's a CSV with ":" or ";" separators in this fashion

Devicename:model:state

Devicename can be easily copied from the description of the device in CACTI model could follow some regex rules from the snmp sysdescription of the device (or could be manually set as an additional field for any single device options (And populated via automation discovery) state is either up or down and can be copied 1:1 from the device state in CACTI

Consider that normally RANCID works with groups that are defined within he rancid.conf file and that have each a path where the config data is stored (normally under a subfolder of the main rancid path named after the group itself). So group could simply be the SITE name in CACTI and for each of them all what would be necessary is to know what is the rancid root folder, so to populate the router.db file with the necessary data.

example: RANCID root folder : /usr/local/rancid

This could be overwritten by CACTI, so if a device is removed in CACTI it will also be removed in RANCID, if a device will be still active but down in CACTI, it will be down in RANCID

OXIDIZED can read the same file source type or it can be customized on what information to read from, I am less accustomed to it but I have run some tests and I could see that has the same structure.

g1augusto commented 6 years ago

I know it's not nice to do, but I would also give a look at the integration of LibreNMS and OXIDIZED from this article to get some idea for that one as it has more options than RANCID (that I described before)

https://docs.librenms.org/#Extensions/Oxidized/

cigamit commented 6 years ago

This might belong in a small plugin for now. I suggest based upon the structure of the CSV file, this is a very simple thing. I with the CSV file had more detail though, like the device type for example. I'm not too interested in doing anything at the moment. I've got too many core items on my plate and not enough time as it is.

ronytomen commented 6 years ago

This is really a request for a new plugin.

Closing this issue.