Empulse Group a collection of notes from a sys admin, musician, and father

30May/110

gnuplot

gnuplot is an easy to use bash tool to create graph images on any data you can throw at it.

 

gnuplot homepage

 

For my test, I am taking a 12 hour period of sar logs.

[root@www gnuplot_tests]# head tail.log
05/29/2011 01:10:01 PM  22195880   2475844     10.04    152596   1857972   2096472         0      0.00         0
05/29/2011 01:20:01 PM  22183664   2488060     10.08    153788   1867836   2096472         0      0.00         0
05/29/2011 01:30:01 PM  22183092   2488632     10.09    154196   1868708   2096472         0      0.00         0
05/29/2011 01:40:01 PM  22180212   2491512     10.10    155188   1869504   2096472         0      0.00         0

 

And the script to create a .png image. To run:  ./sar_plot.pg > graph.png

#!/usr/bin/gnuplot
reset
set terminal png

## set size w,h
set size 2,1

set xdata time
set timefmt "%d/%m/%Y %H:%M:%S"
set format x "%H:%M"
set xlabel "time"

set ylabel "% RAM used"

set title "Server RAM Usage"
set key reverse Left outside
set grid

set style data linespoints

#plot "tail.log" using 1:2, "tail.log" using 1:4
plot "tail.log" using 1:6



Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.