洛阳铲的日志

2008年10月26日

server audit via analyzing the munin database

Filed under: 生活小札 — HackGou @ 08:30

On Tue, Oct 14, 2008 at 00:08, Moses Moore <moses@mozai.com wrote:
HG wrote:
Hi,Matthias: thanks for your reply . actually, I have dumped these data into XML format using rrdtool before i ask the question. i want to know is there a simple way to get these usefull data.
… I’m a bit boggled as to why you don’t think an XML file of all the numbers you need is not ‘a simple way.’ All the minimums, maximums, and averages are there for you, one per line, with timestamps.
Still, you asked for an explanation of how else you can get the data out of the *.rrd files used by munin. I don’t think the non-XML way is any easier. I hope I can help.
You could use ‘rrdtool fetch ${filename} AVERAGE -r 86400 -s ${start} -e {$end}’ to get the averages for each day over a time period, but you have to have the exact values (accurate to the second) or else it just gives up and ignores the ‘-r’ parameter and gives it to you for each 5 minute period. Kinda sucks if you’re not machine-like perfect.
You could get the number out using rrdtool graph, although this is really inefficient since it has to compute a whole graph every time you get each number, and you can only get numbers one at a time. Example: rrdtool graph /tmp/$$ –start `date +%s -d today-7days`

没有评论 »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress