Ticket #164: t.py

File t.py, 685 bytes (added by human, 4 years ago)

Run it with "python t.py"

Line 
1#!/usr/bin/python
2
3import rrdtool, os, sys
4
5#create db
6rrdtool.create('test.rrd', '-s', '60', 'DS:in:GAUGE:120:U:125000000',
7  'DS:out:GAUGE:120:U:125000000', 'RRA:AVERAGE:0.5:1:129600',
8  'RRA:AVERAGE:0.5:12:105120')
9
10# and final demonstration
11for interval in [3600*24,3600*24*7,3600*24*31,3600*24*365]:
12    print interval
13    rrdtool.graph('test.png', '-w', '576', '--zoom', '5', '--start', '-%s' % interval,
14       '--lazy',
15       'DEF:in=test.rrd:in:AVERAGE',
16       'AREA:in#ff0000',
17       'LINE1:in#000000',
18       'COMMENT:X=3\l',
19       'COMMENT:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \r',
20       'COMMENT:Generated at Sun Dec 30 16.54.51 2007 by SAGATOR \r'
21    )

NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example. It may also be that you are looking at a mirror page which did not copy the CSS for this page. Or if some pictu res are missing, then the mirror may not have picked up the contents of the inc directory.