collect_data.sh 448 B

1234567891011121314151617181920212223242526272829
  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 sdr list full` ; do
  15. IFS=,
  16. split=($line)
  17. file="$rrd_dir/$hostname-${split[0]}.rrd"
  18. rrdupdate "$file" "N:${split[1]}"
  19. done