I love default cacti, but I'm hoping to generate a custom dashboard using RRDTool and chart.js to display tons of data on a 4K TV we're mounting in our office.
I plan on using cacti to get the data in, but want to pull the data out to graph on my own.
I've been reading a little on rrdtool, and it looks like rrdtool xport --json is probably what I want, but I'm not 100% sure on what options to set to pull data, nor do I know how to configure my ubuntu-based cacti server so I can poll it from the web.
My hope is to basically create a single-page php script that pulls in a query, executes an rrdtool xport, and returns the JSON. That way I can have a basic HTML file on a different server that simply pulls the data with javascript.
Thoughts?
I primarily use cacti for interface traffic, but I'm probably also going to pull the CPU usage of items independently into a single bar graph as well.
My hope is that once I see an example of how to do this, I can figure out the scripting on my own pretty easily and modify it to work with all my data sources.
A Noobs guide to pulling cacti data with rrdtool?
Moderators: Developers, Moderators
-
- Posts: 10
- Joined: Thu Oct 03, 2013 12:50 pm
-
- Posts: 10
- Joined: Thu Oct 03, 2013 12:50 pm
Re: A Noobs guide to pulling cacti data with rrdtool?
Ok, as a noob, it took me a while to realize that there is a "turn on graph debug mode" link when viewing graphs in the console...
that basically has everything I need except the XPORT statement, but the DEFs are clear enough that I finally put together the following:
I think that *should* give me enough to start playing with graphs... the only issue now is sorting out how to do this without running sudo from the terminal, but through an interface that is open to my LAN.
that basically has everything I need except the XPORT statement, but the DEFs are clear enough that I finally put together the following:
Code: Select all
rrdtool xport \
--start=-86400 \
--end=-300 \
DEF:a="/var/lib/cacti/rra/rack_procurve_traffic_in_9.rrd":'traffic_in':AVERAGE \
DEF:b="/var/lib/cacti/rra/rack_procurve_traffic_in_9.rrd":'traffic_out':AVERAGE \
XPORT:a:"in bits" \
XPORT:b:"out bits" \
--json
Re: A Noobs guide to pulling cacti data with rrdtool?
My hope is to basically create a single-page php script that pulls in a query, executes an rrdtool xport, and returns the JSON. That way I can have a basic HTML file on a different server that simply pulls the data with javascript.
Thoughts?
...........................
Thoughts?
...........................
Who is online
Users browsing this forum: No registered users and 4 guests