File: sens_create_rrd

package info (click to toggle)
lm-sensors 1%3A3.6.0-7
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 3,236 kB
  • sloc: perl: 6,461; ansic: 5,303; sh: 2,301; lex: 372; yacc: 296; makefile: 220
file content (60 lines) | stat: -rwxr-xr-x 1,698 bytes parent folder | download | duplicates (9)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
#
#    sens_create_rrd -
#	Create a sensors rrd database of 14 sensor readings
#	at 5 minute intervals for 1 week.
#
#    Copyright 2001 Mark D. Studebaker <mdsxyz123@yahoo.com>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#    MA 02110-1301 USA.
#
RRDPATH=/usr/bin
RRDB=$1
#Heartbeat 15 minutes
HB=900
#Rows 12 * 24 * 7 = 1 week of every 5 minutes
RW=2016

if [ $# -ne 1 ]
then
	echo usage: $0 database.rrd
	exit 1
fi

DIR=`dirname $1`
if [ ! -w $DIR ]
then
	echo $0: directory $DIR not present or not writable
	exit 1
fi

$RRDPATH/rrdtool create $RRDB --step 300 \
	DS:fan1:GAUGE:${HB}:0:12000 \
	DS:fan2:GAUGE:${HB}:0:12000 \
	DS:fan3:GAUGE:${HB}:0:12000 \
	DS:temp1:GAUGE:${HB}:-25:250 \
	DS:temp2:GAUGE:${HB}:-25:250 \
	DS:temp3:GAUGE:${HB}:-25:250 \
	DS:in0:GAUGE:${HB}:-25:25 \
	DS:in1:GAUGE:${HB}:-25:25 \
	DS:in2:GAUGE:${HB}:-25:25 \
	DS:in3:GAUGE:${HB}:-25:25 \
	DS:in4:GAUGE:${HB}:-25:25 \
	DS:in5:GAUGE:${HB}:-25:25 \
	DS:in6:GAUGE:${HB}:-25:25 \
	DS:loadavg:GAUGE:${HB}:0:U \
	RRA:AVERAGE:0.5:1:$RW