Cacti is fantastic at collecting data from SNMP enabled devices and interpreting this data in the form of useful graphs. As Cacti collects and stores this data, you may have a use case to access this data for other means. This tutorial quickly explains how to enable automatic exporting of host data in the CSV format.
The good news is that there is a Cacti plugin called NmidDataExport that automatically can do just that. Download it from the Cacti plugins page. Be sure to activate it after installation, navigate in the web interface to Configuration and then Plugin management.
In the Cacti web interface click on Console.
Next under Management click on Graph Management.
This displays a list of all current graphs available that Cacti is graphing.
Find the Graph you wish enable the automated CSV export for. Example I have a graph called Cisco ASA 5505 – Traffic – Ethernet0/0. Select the check box next to this graph and scroll down to the bottom of the page.
Where it says, Choose an action, click the list where it says, Delete, change it to Automated Export – Add to Export. Press Go.
Where is my CSV data?
On the Cacti side bar, navigate to Configuration and click Settings.
Notice at the top you have a menu item named NMID. Here you have settings for json or csv. And the export directory can be set. You can change this to a more suitable web server directory for access via http easier than the default.
The CSV files have names that correspond to the IP/hostname/graph ID info, and are updated every 5 minutes over the last few hours, they contain the values for this period only as far as I can tell. This is useful as it gives near live data sampled over a recent period that is updated frequently.
Leave a Reply