retrieving stats

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
linvicch
Posts: 4
Joined: Wed Oct 11, 2006 9:16 pm

retrieving stats

Post by linvicch »

hi below is the code used to print the graph, how do i get it to print in text mode just the stats? i tried using print instead of gprint but couldn't get it to work, i need the current,average and maximum that is displayed on the graph in text mode. Please advice -> an example of the function call would be appreciated

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1160470586 \
--end=1160556986 \
--title="Myaree Core - CPU Usage" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
COMMENT:"From 2006/10/10 16:56:26 To 2006/10/11 16:56:26\c" \
COMMENT:"\n" \
--vertical-label="percent" \
DEF:a="/usr/share/cacti/site/rra/myaree_core1_nas_5min_cpu_69.rrd":5min_cpu:AVERAGE \
AREA:a#FF0000:"CPU Usage" \
GPRINT:a:LAST:"Current\:%8.0lf" \
GPRINT:a:AVERAGE:"Average\:%8.0lf" \
GPRINT:a:MAX:"Maximum\:%8.0lf"
linvicch
Posts: 4
Joined: Wed Oct 11, 2006 9:16 pm

Post by linvicch »

from the documentation i gather that if using the above function call to fetch leaving out any graphing variables in it, it will print out a text report, but after many attempts i still couldn't get it to work

the machine itself has no graphical interface on it

Thanks in advance
linvicch
Posts: 4
Joined: Wed Oct 11, 2006 9:16 pm

Post by linvicch »

is okie i have figured it out..

/usr/bin/rrdtool graph test.txt \
DEF:a="/usr/share/cacti/site/rra/myaree_core1_nas_5min_cpu_69.rrd":5min_cpu:AVERAGE\
PRINT:a:LAST:"Current\:%8.0lf" \
PRINT:a:AVERAGE:"Average\:%8.0lf" \
PRINT:a:MAX:"Maximum\:%8.0lf"

just have to change the - after graph to text.txt or something

hope this will help anyone looking for the same thing
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

You may have a look at the reports plugin. Perhaps it helps you generating those reports you want to use. You may serach for "cactiquery" in the addons forum as well
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests