Advertisement
Steven715

Round Robbin create cpu temp graphs script "Create graph.sh"

Jan 26th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.96 KB | None | 0 0
  1. #!/bin/bash
  2. DIR='/var/www/CPUTemp'
  3.  
  4. #set to C is using Celsius
  5. TEMP_SCALE="C"
  6.  
  7. #define the desiered colours for the graphs
  8. CPUTEMP_COLOR="#CC0000"
  9.  
  10. #hourly
  11. rrdtool graph $DIR/temp_hourly.png --start -4h \
  12. DEF:temp=$DIR/cputemp.rrd:cputemp:AVERAGE \
  13. AREA:temp$CPUTEMP_COLOR:"CPU Temprature [deg $TEMP_SCALE]"
  14.  
  15. #daily
  16. rrdtool graph $DIR/temp_daily.png --start -1d \
  17. DEF:temp=$DIR/cputemp.rrd:cputemp:AVERAGE \
  18. AREA:temp$CPUTEMP_COLOR:"CPU Temprature [deg $TEMP_SCALE]"
  19.  
  20. #weekly
  21. rrdtool graph $DIR/temp_weekly.png --start -1w \
  22. DEF:temp=$DIR/cputemp.rrd:cputemp:AVERAGE \
  23. AREA:temp$CPUTEMP_COLOR:"CPU Temprature [deg $TEMP_SCALE]"
  24.  
  25. #monthly
  26. rrdtool graph $DIR/temp_monthly.png --start -1m \
  27. DEF:temp=$DIR/cputemp.rrd:cputemp:AVERAGE \
  28. AREA:temp$CPUTEMP_COLOR:"CPU Temprature [deg $TEMP_SCALE]"
  29.  
  30. #yearly
  31. rrdtool graph $DIR/temp_yearly.png --start -1y \
  32. DEF:temp=$DIR/cputemp.rrd:cputemp:AVERAGE \
  33. AREA:temp$CPUTEMP_COLOR:"CPU Temprature [deg $TEMP_SCALE]"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement