File: create_rrds.sh

package info (click to toggle)
ipmitool 1.8.1-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,764 kB
  • ctags: 2,636
  • sloc: ansic: 21,161; sh: 9,004; makefile: 202
file content (40 lines) | stat: -rwxr-xr-x 685 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
#
#  Copyright (c) 2003 Fredrik Ohrn.  All Rights Reserved.
#
#  See the included COPYING file for license details.
#

# Edit the variables

hostname=$HOSTNAME

ipmi_cmd="/usr/local/bin/ipmitool -I open"
rrd_dir="/some/dir/rrd"

# No need to edit below this point.

IFS="
"

for line in `eval $ipmi_cmd -c -v sdr list full` ; do

	IFS=,

	split=($line)

	file="$rrd_dir/$hostname-${split[0]}.rrd"

	if [ -e "$file" ] ; then
		echo "Skipping existing file $file"
		continue
	fi

	echo "Creating file $file"

	rrdtool create "$file" \
		--step 300 DS:var:GAUGE:900:${split[16]}:${split[17]} \
		RRA:AVERAGE:0.5:1:288 \
		RRA:AVERAGE:0.5:6:336 \
		RRA:AVERAGE:0.5:12:720
done