Created
February 4, 2012 06:43
-
-
Save jpetazzo/1735900 to your computer and use it in GitHub Desktop.
Example of rrdtool GAUGE to store a value between 0 and 100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rrdtool create foo.rrd --start -2h --step 900 DS:foo:GAUGE:3600:0:100 RRA:AVERAGE:0.5:1:1000 | |
for N in $(seq 20 -1 1) | |
do | |
rrdtool update foo.rrd -- -$(($N*600)):$N$N | |
rrdtool lastupdate foo.rrd | |
done | |
rrdtool graph --start -1h foo.png DEF:foo=foo.rrd:foo:AVERAGE LINE:foo#000000:thefoo | |
rrdtool fetch foo.rrd AVERAGE | tail | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment