I have just started to look at incorporating Cacti for monitoring our network. I have glanced through a few books, read the Cacti manual and per my understanding, the type of script we would write would collect data from a single node. The Cacti poller would then create multiple jobs for sending the same script to multiple devices simultaneously.
However, I had already written a multi-threaded script for collecting data from a set of hosts. The script would be collecting only a few parameters from each host. Assuming that there are 500 hosts, the output of the script (for each invocation) would be some thing like. I can change the format in any way that can be consumed by Cacti, however output for all the devices would be generated in each invocation of the script.
Device Id, Status1, Status2
-----------------------
device1, 5, 10
device2, 5, 4
device3, 6, 10
device4, 8, 15
....
device500, 7, 10
Is there a way of incorporating the output above to Cacti? Or do I need to update the script such that the same script would be invoked multiple times by Cacti poller?
I wanted to maintain the same script (if possible) because I need to invoke this script via the command line and wanted to reuse the same script for multiple purposes.
Any pointers to relevant documentation and suggestions would be highly appreciated.
Cacti Data Collection from multiple Hosts
Moderators: Developers, Moderators
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Cacti Data Collection from multiple Hosts
A two step approach is recommended, then.
Run your gathering script from crontab and make sure it has finished before cacti starts polling. Store data into some temporary file.
Then, have each cacti host associated with a second script that greps the required data from that intermediate file.
R.
Run your gathering script from crontab and make sure it has finished before cacti starts polling. Store data into some temporary file.
Then, have each cacti host associated with a second script that greps the required data from that intermediate file.
R.
Re: Cacti Data Collection from multiple Hosts
Great. That will definitely work. Thank you for the suggestion.
Who is online
Users browsing this forum: No registered users and 6 guests