~ubuntu-branches/ubuntu/maverick/ipmitool/maverick

« back to all changes in this revision

Viewing changes to contrib/create_rrds.sh

  • Committer: Bazaar Package Importer
  • Author(s): Petter Reinholdtsen
  • Date: 2005-04-07 01:18:44 UTC
  • Revision ID: james.westby@ubuntu.com-20050407011844-a1b206z5iefiu5vi
Tags: upstream-1.8.1
ImportĀ upstreamĀ versionĀ 1.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
8
# Edit the variables
 
9
 
 
10
hostname=$HOSTNAME
 
11
 
 
12
ipmi_cmd="/usr/local/bin/ipmitool -I open"
 
13
rrd_dir="/some/dir/rrd"
 
14
 
 
15
# No need to edit below this point.
 
16
 
 
17
IFS="
 
18
"
 
19
 
 
20
for line in `eval $ipmi_cmd -c -v sdr list full` ; do
 
21
 
 
22
        IFS=,
 
23
 
 
24
        split=($line)
 
25
 
 
26
        file="$rrd_dir/$hostname-${split[0]}.rrd"
 
27
 
 
28
        if [ -e "$file" ] ; then
 
29
                echo "Skipping existing file $file"
 
30
                continue
 
31
        fi
 
32
 
 
33
        echo "Creating file $file"
 
34
 
 
35
        rrdtool create "$file" \
 
36
                --step 300 DS:var:GAUGE:900:${split[16]}:${split[17]} \
 
37
                RRA:AVERAGE:0.5:1:288 \
 
38
                RRA:AVERAGE:0.5:6:336 \
 
39
                RRA:AVERAGE:0.5:12:720
 
40
done