On Mon, Jun 13, 2005 at 07:55:37AM -0700, mobby lin wrote:
> How to use rrdcgi to display the graph by time domain (day,
> week..)?

Not really a JFFNMS-specific question so you better off looking at the 
generic RRD documentation, such as rrdcgi manual page.

Someting to get you started, to graph the last 42 hours traffic of
a physical interface, assuming that the interface number is 1234,
a rrdcgi file would look like what is shown below.

Put this into your CGI directory, call it something like traffic.cgi
Make sure apache can write to /var/www/graphs/ directory

This one makes the nice mountains on the lake graph.

Go to http://yourhost/cgi-bin/traffic.cgi


-------------------------------------------
#!/usr/bin/rrdcgi
<h1>My Traffic</h1>
<p>
<RRD::GRAPH /var/www/graphs/mytraffic.png
--imginfo '<img src="/graphs/%s" WIDTH="%lu" HEIGHT="%lu" ALT="Bits
graph">'--lower-limit 0
--start 'end-42h'
--title "Last 42 Hours"
--height 40
DEF:ds0=/var/lib/jffnms/rrd/interface-1234-0.rrd:data:AVERAGE
DEF:ds1=/var/lib/jffnms/rrd/interface-1234-1.rrd:data:AVERAGE
CDEF:bitsin=ds0,8,*
CDEF:gbitsin=0,ds0,8,*,-
CDEF:bitsout=ds1,8,*
HRULE:0#000000
AREA:bitsout#9999ff:"Bits Out"
GPRINT:bitsout:LAST:"Cur\: %0.2lf%s"
GPRINT:bitsout:MAX:"Max/Avg/Min\: %0.2lf%s\g"
GPRINT:bitsout:AVERAGE:"/%0.2lf%s\g"
GPRINT:bitsout:MIN:"/%0.2lf%s\g"
COMMENT:\s
COMMENT:\s
AREA:gbitsin#2222ff:"Bits In "
GPRINT:bitsin:LAST:"Cur\: %0.2lf%s"
GPRINT:bitsin:MAX:"Max/Avg/Min\: %0.2lf%s\g"
GPRINT:bitsin:AVERAGE:"/%0.2lf%s\g"
GPRINT:bitsin:MIN:"/%0.2lf%s\g"
>
</p>

-------------------------------------
-- 
Craig Small      GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.enc.com.au/   MIEE         Debian developer
csmall at : enc.com.au                      ieee.org           debian.org


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
jffnms-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jffnms-users

Reply via email to