|
|
| Author |
Message |
TQ_
Joined: 30 Jun 2008 Posts: 2
|
Posted: Thu Jul 10, 2008 1:41 pm Post subject: Cacti as a frontend for collecd? |
|
|
Hi,
I want to use collectd for collecting data from multiple hosts as it has much plugins for collecting different data and greater resolution that cacti and it comes with its own network plugin so I dont have to configure snmp for querying remote hosts. The tool however is just for collecting data and putting it in rrdtool DB (which is nice, you can use whatever visualization tool you like).
I`d like to use cacti just as a frontend for collectd - collectd will create data for all hosts and put it in rrdtool, I want to use cacti just for visualizing the data - no polling, no creating rrd files, just visualize from whatever rrdfiles I have. Is this possible and how (a link to some documentation about such setup would be appreciated). There are similiar tools that just do only visualization (like drraw), but cacti has a really nice interface and I would like to use it (ddraw looks like it was made in 199x).
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 17009 Location: Muenster, Germany
|
Posted: Fri Jul 11, 2008 3:10 pm Post subject: |
|
|
Please see http://docs.cacti.net. Find the HowTo section and read rrdtool chapter. There's a hint on using "externally updated rrd files".
But you will NOT love this way.
Even if I do NOT know collectd, I think that cacti has similar functions to be extended by own scripts. See again link from above
Reinhard
|
|
| Back to top |
|
 |
Mulciber
Joined: 22 Nov 2009 Posts: 1
|
Posted: Sun Nov 22, 2009 5:45 pm Post subject: |
|
|
Hi,
I've made a script to add automatically the RRDs created by collectd into the Cacti database. It's a bit dirty but it works. Please, make a dump of your database before using this script so if it fails/bugs, you can reload your configuration. There is not a lot of comments (cause the script was not intended to be published) but i can add some.
It creates all the Graph Templates, Data Input Methods, Devices, data sources, etc... so you can use all the features of cacti. The colors are 100% random, but you can change them in the graph templates panel.
Cacti does nothing here. The hosts added by the script are automatically disabled.
'irq' and 'df' are disabled by default, but if you want to graph them, then delete the "#" at the beginning of the lines 47 & 48.
Tested on :
Linux (Ubuntu).
(dunno if it works on windows. If you need so, I may have a look on it)
You need :
Python (2.6)
the Python-Mysql library (MySQLdb)
RRDtool (>= 1.2 ?)
Configuration :
Open the file, and set the parameters :
- The path to the rrds
- Your logins for cacti
- The path for rrdtool (if not the one by default)
Example :
For 1 host, but works for every host in the collectd path
| Code: | nolsys@Evy:~$ find /var/lib/collectd/rrd/
/var/lib/collectd/rrd/
/var/lib/collectd/rrd/Evy
/var/lib/collectd/rrd/Evy/disk-sda1
/var/lib/collectd/rrd/Evy/disk-sda1/disk_time.rrd
/var/lib/collectd/rrd/Evy/disk-sda1/disk_merged.rrd
/var/lib/collectd/rrd/Evy/disk-sda1/disk_octets.rrd
/var/lib/collectd/rrd/Evy/disk-sda1/disk_ops.rrd
/var/lib/collectd/rrd/Evy/disk-sda5
/var/lib/collectd/rrd/Evy/disk-sda5/disk_time.rrd
/var/lib/collectd/rrd/Evy/disk-sda5/disk_merged.rrd
/var/lib/collectd/rrd/Evy/disk-sda5/disk_octets.rrd
/var/lib/collectd/rrd/Evy/disk-sda5/disk_ops.rrd
/var/lib/collectd/rrd/Evy/entropy
/var/lib/collectd/rrd/Evy/entropy/entropy.rrd
[...]
|
Run the script :
| Code: |
nolsys@Evy:~$ mv ./scripts/collectd2cacti.txt ./scripts/collectd2cacti.py
nolsys@Evy:~$ chmod +x ./scripts/collectd2cacti.py
nolsys@Evy:~$ ./scripts/collectd2cacti.py
Getting values for Evy.
##############################
Database stuff
Host : Evy.
load
processes
users
entropy
swap
memory
interface
disk
cpu
|
A screenshot :
Please feel free to ask any question in this post, by PM or by email ( thephylax ==at--[nospamplz] gmail__com )
Best regards,
Mathieu.
PS :tell me at least if it works :]
| Description: |
Rename this file .txt -> .py |
|
 Download |
| Filename: |
collectd2cacti.txt |
| Filesize: |
21.54 KB |
| Downloaded: |
333 Time(s) |
|
|
| Back to top |
|
 |
skywalka
Joined: 17 Mar 2009 Posts: 4
|
Posted: Fri Jan 22, 2010 1:00 am Post subject: |
|
|
Thanks Mulciber! It works perfectly
|
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|