create_rrds.sh 685 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2003 Fredrik Ohrn. All Rights Reserved.
  4. #
  5. # See the included COPYING file for license details.
  6. #
  7. # Edit the variables
  8. hostname=$HOSTNAME
  9. ipmi_cmd="/usr/local/bin/ipmitool -I open"
  10. rrd_dir="/some/dir/rrd"
  11. # No need to edit below this point.
  12. IFS="
  13. "
  14. for line in `eval $ipmi_cmd -c -v sdr list full` ; do
  15. IFS=,
  16. split=($line)
  17. file="$rrd_dir/$hostname-${split[0]}.rrd"
  18. if [ -e "$file" ] ; then
  19. echo "Skipping existing file $file"
  20. continue
  21. fi
  22. echo "Creating file $file"
  23. rrdtool create "$file" \
  24. --step 300 DS:var:GAUGE:900:${split[16]}:${split[17]} \
  25. RRA:AVERAGE:0.5:1:288 \
  26. RRA:AVERAGE:0.5:6:336 \
  27. RRA:AVERAGE:0.5:12:720
  28. done