Initial commit

This commit is contained in:
Charlie Root 2025-03-01 00:58:18 +01:00
commit 529efd53a1
140 changed files with 10310 additions and 0 deletions

54
rrdtools/scripts/bw-bge0.sh Executable file
View file

@ -0,0 +1,54 @@
#!/bin/sh -x
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="bw-bge0"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:bge0_in:COUNTER:600:U:U \
DS:bge0_out:COUNTER:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
${RRD} update ${DBASE} N:`${SNMPGET} "ifInOctets[1]"`:`${SNMPGET} "ifOutOctets[1]"`
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="Bandwith" \
--font DEFAULT:7 \
--height=100 \
--width=400 \
--tabwidth=20 \
--lower-limit=0 \
--vertical-label="bytes/sec" \
DEF:byte_in="${DBASE}":bge0_in:AVERAGE \
DEF:byte_out="${DBASE}":bge0_out:AVERAGE \
AREA:byte_in#00CF00:"IN\t" GPRINT:byte_in:LAST:"Last\:%8.2lf %s" GPRINT:byte_in:AVERAGE:"Avg\:%8.2lf %s" GPRINT:byte_in:MAX:"Max\:%8.2lf %s\n" \
LINE1:byte_out#FF0000:"OUT\t" GPRINT:byte_out:LAST:"Last\:%8.2lf %s" GPRINT:byte_out:AVERAGE:"Avg\:%8.2lf %s" GPRINT:byte_out:MAX:"Max\:%8.2lf %s\n"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:byte_in="${DBASE}":bge0_in:AVERAGE \
DEF:byte_out="${DBASE}":bge0_out:AVERAGE \
AREA:byte_in#00CF00: \
LINE1:byte_out#FF0000:
# Optionals
# HRULE:150000#FF0000:"MAX possible speed"
# CDEF:byte_in=in,8,* \
# CDEF:byte_out=out,8,* \

91
rrdtools/scripts/conn-server.sh Executable file
View file

@ -0,0 +1,91 @@
#!/bin/sh
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="conn-server"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:conn_tot:GAUGE:600:U:U \
DS:conn_udp:GAUGE:600:U:U \
DS:conn_tcp:GAUGE:600:U:U \
DS:conn_pop:GAUGE:600:U:U \
DS:conn_www:GAUGE:600:U:U \
DS:conn_mai:GAUGE:600:U:U \
DS:conn_pcs:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
TOTSESS=`netstat -an | grep -ce '^.*p4'`
UDPSESS=`netstat -an | grep -ce '^udp4'`
TCPSESS=`netstat -an | grep -ce '^tcp4'`
POPSESS=`netstat -an | grep -ce '83.149.156.244.110 '`
WWWSESS=`netstat -an | grep -ce '83.149.156.244.80'`
MAISESS=`netstat -an | grep -ce '83.149.156.244.25'`
PCSSESS=`netstat -an | grep -ce '83.149.156.244.2110'`
${RRD} update ${DBASE} N:${TOTSESS}:${UDPSESS}:${TCPSESS}:${POPSESS}:${WWWSESS}:${MAISESS}:${PCSSESS}
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="Connections" \
--font DEFAULT:7 \
--rigid \
--base=1000 \
--height=100 \
--width=400 \
--tabwidth=20 \
--lower-limit=0 \
--vertical-label="Connections" \
DEF:tot="${DBASE}":conn_tot:AVERAGE \
DEF:udp="${DBASE}":conn_udp:AVERAGE \
DEF:tcp="${DBASE}":conn_tcp:AVERAGE \
DEF:pop="${DBASE}":conn_pop:AVERAGE \
DEF:www="${DBASE}":conn_www:AVERAGE \
DEF:mai="${DBASE}":conn_mai:AVERAGE \
DEF:pcs="${DBASE}":conn_pcs:AVERAGE \
AREA:tot#00CF00:"TOT\t\t" GPRINT:tot:LAST:"Last\:%4.0lf %s\t" GPRINT:tot:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:tot:MAX:"Max\:%4.0lf %s\n" \
LINE1:udp#FF0000:"UDP\t\t" GPRINT:udp:LAST:"Last\:%4.0lf %s\t" GPRINT:udp:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:udp:MAX:"Max\:%4.0lf %s\n" \
LINE1:tcp#002A97:"TCP\t\t" GPRINT:tcp:LAST:"Last\:%4.0lf %s\t" GPRINT:tcp:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:tcp:MAX:"Max\:%4.0lf %s\n" \
LINE1:pop#FF00FF:"pop3\t\t" GPRINT:pop:LAST:"Last\:%4.0lf %s\t" GPRINT:pop:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:pop:MAX:"Max\:%4.0lf %s\n" \
LINE1:www#009999:"www\t\t" GPRINT:www:LAST:"Last\:%4.0lf %s\t" GPRINT:www:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:www:MAX:"Max\:%4.0lf %s\n" \
LINE1:mai#DDDDDD:"smtp\t\t" GPRINT:mai:LAST:"Last\:%4.0lf %s\t" GPRINT:mai:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:mai:MAX:"Max\:%4.0lf %s\n" \
LINE1:pcs#FFFF66:"procsy\t" GPRINT:pcs:LAST:"Last\:%4.0lf %s\t" GPRINT:pcs:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:pcs:MAX:"Max\:%4.0lf %s"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:tot="${DBASE}":conn_tot:AVERAGE \
DEF:udp="${DBASE}":conn_udp:AVERAGE \
DEF:tcp="${DBASE}":conn_tcp:AVERAGE \
DEF:pop="${DBASE}":conn_pop:AVERAGE \
DEF:www="${DBASE}":conn_www:AVERAGE \
DEF:mai="${DBASE}":conn_mai:AVERAGE \
DEF:pcs="${DBASE}":conn_pcs:AVERAGE \
AREA:tot#00CF00 \
LINE1:udp#FF0000 \
LINE1:tcp#002A97 \
LINE1:pop#FF00FF \
LINE1:www#009999 \
LINE1:mai#DDDDDD \
LINE1:pcs#FFFF66
# Optionals
# HRULE:150000#FF0000:"MAX possible speed"
# CDEF:byte_in=in,8,* \
# CDEF:byte_out=out,8,* \

View file

@ -0,0 +1,71 @@
#!/bin/sh
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="conn-server"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:conn_estab:GAUGE:600:U:U \
DS:conn_active:COUNTER:600:U:U \
DS:conn_passive:COUNTER:600:U:U \
DS:conn_fails:COUNTER:600:U:U \
DS:conn_reset:COUNTER:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
${RRD} update ${DBASE} N:`${SNMPGET} TCP-MIB::tcpCurrEstab.0`:`${SNMPGET} TCP-MIB::tcpActiveOpens.0`:`${SNMPGET} TCP-MIB::tcpPassiveOpens.0`:`${SNMPGET} TCP-MIB::tcpAttemptFails.0`:`${SNMPGET} TCP-MIB::tcpEstabResets.0`
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="Connections" \
--font DEFAULT:7 \
--rigid \
--base=1000 \
--height=100 \
--width=400 \
--tabwidth=20 \
--lower-limit=0 \
--vertical-label="Connections" \
DEF:estab="${DBASE}":conn_estab:AVERAGE \
DEF:active="${DBASE}":conn_active:AVERAGE \
DEF:passive="${DBASE}":conn_passive:AVERAGE \
DEF:fails="${DBASE}":conn_fails:AVERAGE \
DEF:reset="${DBASE}":conn_reset:AVERAGE \
LINE1:estab#002A97:"TCP Estab\t" GPRINT:estab:LAST:"Last\:%4.0lf %s\t" GPRINT:estab:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:estab:MAX:"Max\:%4.0lf %s\n" \
LINE1:active#00CF00:"TCP Active\t" GPRINT:active:LAST:"Last\:%4.0lf %s\t" GPRINT:active:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:active:MAX:"Max\:%4.0lf %s\n" \
LINE1:passive#FF0000:"TCP Passive\t" GPRINT:passive:LAST:"Last\:%4.0lf %s\t" GPRINT:passive:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:passive:MAX:"Max\:%4.0lf %s\n" \
LINE1:fails#FF00FF:"TCP Fails\t" GPRINT:fails:LAST:"Last\:%4.0lf %s\t" GPRINT:fails:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:fails:MAX:"Max\:%4.0lf %s\n" \
LINE1:reset#009999:"TCP Reset\t" GPRINT:reset:LAST:"Last\:%4.0lf %s\t" GPRINT:reset:AVERAGE:"Avg\:%4.0lf %s\t" GPRINT:reset:MAX:"Max\:%4.0lf %s\n"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:estab="${DBASE}":conn_estab:AVERAGE \
DEF:active="${DBASE}":conn_active:AVERAGE \
DEF:passive="${DBASE}":conn_passive:AVERAGE \
DEF:fails="${DBASE}":conn_fails:AVERAGE \
DEF:reset="${DBASE}":conn_reset:AVERAGE \
LINE1:estab#002A97:\
LINE1:active#00CF00:\
LINE1:passive#FF0000:\
LINE1:fails#FF00FF:\
LINE1:reset#009999:\
# Optionals
# HRULE:150000#FF0000:"MAX possible speed"
# CDEF:byte_in=in,8,* \
# CDEF:byte_out=out,8,* \

44
rrdtools/scripts/cpu-server.sh Executable file
View file

@ -0,0 +1,44 @@
#!/bin/sh
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="cpu-server"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:cpu_srv:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
${RRD} update ${DBASE} N:`uptime | awk '{gsub(",", ""); print $(NF-1)}' | awk '{print $1 * 100}'`
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="CPU usage" \
--font LEGEND:7 \
--height=100 \
--width=400 \
--tabwidth=20 \
--lower-limit=0 \
--vertical-label="cpu usage %" \
DEF:cpu="${DBASE}":cpu_srv:AVERAGE \
AREA:cpu#00CF00:"CPU\t" GPRINT:cpu:LAST:"Last\:%4.0lf %s" GPRINT:cpu:AVERAGE:"Avg\:%4.0lf %s" GPRINT:cpu:MAX:"Max\:%4.0lf %s"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:cpu="${DBASE}":cpu_srv:AVERAGE \
AREA:cpu#00CF00:

50
rrdtools/scripts/hd-server.sh Executable file
View file

@ -0,0 +1,50 @@
#!/bin/sh
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="hd-server"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:hd0_srv:GAUGE:600:U:U \
DS:hd1_srv:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
HD0SPACE=`df | grep /dev/ad0s1a | awk '{gsub("%", ""); print $(NF-1)}'`
HD1SPACE=`df | grep /dev/ad1s1a | awk '{gsub("%", ""); print $(NF-1)}'`
${RRD} update ${DBASE} N:${HD0SPACE}:${HD1SPACE}
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="HD space" \
--font LEGEND:7 \
--width=400 \
--tabwidth=20 \
--lower-limit=0 \
--vertical-label="hd usage %" \
DEF:hd0="${DBASE}":hd0_srv:AVERAGE \
DEF:hd1="${DBASE}":hd1_srv:AVERAGE \
AREA:hd0#00CF00:"ad0 usage\t" GPRINT:hd0:LAST:"Last\:%4.0lf %s" GPRINT:hd0:AVERAGE:"Avg\:%4.0lf %s" GPRINT:hd0:MAX:"Max\:%4.0lf %s\n" \
LINE1:hd1#002A97:"ad1 usage\t" GPRINT:hd1:LAST:"Last\:%4.0lf %s" GPRINT:hd1:AVERAGE:"Avg\:%4.0lf %s" GPRINT:hd1:MAX:"Max\:%4.0lf %s"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:hd0="${DBASE}":hd0_srv:AVERAGE \
DEF:hd1="${DBASE}":hd1_srv:AVERAGE \
AREA:hd0#00CF00 \
LINE1:hd1#002A97

View file

@ -0,0 +1,58 @@
#!/bin/sh -x
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="bw-bge0"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:bge0_in:COUNTER:600:U:U \
DS:bge0_out:COUNTER:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
${RRD} update ${DBASE} N:`${SNMPGET} "ifInOctets[1]"`:`${SNMPGET} "ifOutOctets[1]"`
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="Bandwith" \
--font DEFAULT:7 \
--rigid \
--base=1000 \
--height=100 \
--width=400 \
--upper-limit=180000 \
--tabwidth=20 \
--lower-limit=0 \
--vertical-label="KB/sec" \
DEF:byte_in="${DBASE}":bge0_in:AVERAGE \
DEF:byte_out="${DBASE}":bge0_out:AVERAGE \
AREA:byte_in#00CF00:"IN\t" GPRINT:byte_in:LAST:"Last\:%8.2lf %s" GPRINT:byte_in:AVERAGE:"Avg\:%8.2lf %s" GPRINT:byte_in:MAX:"Max\:%8.2lf %s\n" \
LINE1:byte_out#FF0000:"OUT\t" GPRINT:byte_out:LAST:"Last\:%8.2lf %s" GPRINT:byte_out:AVERAGE:"Avg\:%8.2lf %s" GPRINT:byte_out:MAX:"Max\:%8.2lf %s\n"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--upper-limit=180000 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:byte_in="${DBASE}":bge0_in:AVERAGE \
DEF:byte_out="${DBASE}":bge0_out:AVERAGE \
AREA:byte_in#00CF00: \
LINE1:byte_out#FF0000:
# Optionals
# HRULE:150000#FF0000:"MAX possible speed"
# CDEF:byte_in=in,8,* \
# CDEF:byte_out=out,8,* \

54
rrdtools/scripts/old/bw-em0.sh Executable file
View file

@ -0,0 +1,54 @@
#!/bin/sh -x
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="bw-em0"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:em0_in:COUNTER:600:U:U \
DS:em0_out:COUNTER:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
${RRD} update ${DBASE} N:`${SNMPGET} "ifInOctets[1]"`:`${SNMPGET} "ifOutOctets[1]"`
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="Bandwith" \
--font DEFAULT:7 \
--height=100 \
--width=400 \
--tabwidth=20 \
--lower-limit=0 \
--vertical-label="bytes/sec" \
DEF:byte_in="${DBASE}":em0_in:AVERAGE \
DEF:byte_out="${DBASE}":em0_out:AVERAGE \
AREA:byte_in#00CF00:"IN\t" GPRINT:byte_in:LAST:"Last\:%8.2lf %s" GPRINT:byte_in:AVERAGE:"Avg\:%8.2lf %s" GPRINT:byte_in:MAX:"Max\:%8.2lf %s\n" \
LINE1:byte_out#FF0000:"OUT\t" GPRINT:byte_out:LAST:"Last\:%8.2lf %s" GPRINT:byte_out:AVERAGE:"Avg\:%8.2lf %s" GPRINT:byte_out:MAX:"Max\:%8.2lf %s\n"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:byte_in="${DBASE}":em0_in:AVERAGE \
DEF:byte_out="${DBASE}":em0_out:AVERAGE \
AREA:byte_in#00CF00: \
LINE1:byte_out#FF0000:
# Optionals
# HRULE:150000#FF0000:"MAX possible speed"
# CDEF:byte_in=in,8,* \
# CDEF:byte_out=out,8,* \

View file

@ -0,0 +1,48 @@
#!/bin/sh
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="hd-server"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:hd_srv:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
${RRD} update ${DBASE} N:`df | grep /dev/ad0s1a | awk '{gsub("%", ""); print $(NF-1)}'`
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="HD space" \
--font LEGEND:7 \
--rigid \
--base=1000 \
--height=100 \
--width=400 \
--tabwidth=20 \
--upper-limit=100 \
--lower-limit=0 \
--vertical-label="hd usage %" \
DEF:hd="${DBASE}":hd_srv:AVERAGE \
AREA:hd#00CF00:"SPACE USED\t" GPRINT:hd:LAST:"Last\:%4.0lf %s" GPRINT:hd:AVERAGE:"Avg\:%4.0lf %s" GPRINT:hd:MAX:"Max\:%4.0lf %s"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:hd="${DBASE}":hd_srv:AVERAGE \
AREA:hd#00CF00

View file

@ -0,0 +1,46 @@
#!/bin/sh
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="temp-hd"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:temp_hd:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
${RRD} update ${DBASE} N:`smartctl -a /dev/ad0 | grep Temperature_Celsius | cut -c 88-89`
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="HD Temperature" \
--font LEGEND:7 \
--rigid \
--base=1000 \
--height=100 \
--width=400 \
--upper-limit=100 \
--tabwidth=20 \
--lower-limit=0 \
--vertical-label="celsius" \
DEF:temp="${DBASE}":temp_hd:AVERAGE \
AREA:temp#00CF00:"TEMP\t" GPRINT:temp:LAST:"Last\:%4.0lf %s" GPRINT:temp:AVERAGE:"Avg\:%4.0lf %s" GPRINT:temp:MAX:"Max\:%4.0lf %s"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:temp="${DBASE}":temp_hd:AVERAGE \
AREA:temp#00CF00:

55
rrdtools/scripts/temp-hd.sh Executable file
View file

@ -0,0 +1,55 @@
#!/bin/sh
BASEDIR=`pwd`
. ${BASEDIR%scripts}/rrdtool.conf
FILE="temp-hd"
DBASE="${DBASEDIR}/${FILE}.rrd"
IMG="${IMGDIR}/${FILE}.png"
SIMG="${IMGDIR}/small-${FILE}.png"
if [ ! -f "${DBASE}" ]; then
${RRD} create ${DBASE} \
--start N \
--step 300 \
DS:temp0_hd:GAUGE:600:U:U \
DS:temp1_hd:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:288
fi
TEMP0=`smartctl -a /dev/ad0 | grep Temperature_Celsius | cut -c 88-89`
TEMP1=`smartctl -a /dev/ad1 | grep Temperature_Celsius | cut -c 88-89`
${RRD} update ${DBASE} N:${TEMP0}:${TEMP1}
${RRD} graph ${IMG} \
--imgformat=PNG \
--title="HD Temperature" \
--font LEGEND:7 \
--rigid \
--base=1000 \
--height=100 \
--width=400 \
--upper-limit=100 \
--tabwidth=20 \
--lower-limit=0 \
--vertical-label="celsius" \
DEF:temp0="${DBASE}":temp0_hd:AVERAGE \
DEF:temp1="${DBASE}":temp1_hd:AVERAGE \
AREA:temp0#00CF00:"ad0\t" GPRINT:temp0:LAST:"Last\:%4.0lf %s" GPRINT:temp0:AVERAGE:"Avg\:%4.0lf %s" GPRINT:temp0:MAX:"Max\:%4.0lf %s\n" \
LINE1:temp1#FF0000:"ad1\t" GPRINT:temp1:LAST:"Last\:%4.0lf %s" GPRINT:temp1:AVERAGE:"Avg\:%4.0lf %s" GPRINT:temp1:MAX:"Max\:%4.0lf %s"
${RRD} graph ${SIMG} \
--imgformat=PNG \
--font DEFAULT:5 \
--height=50 \
--width=200 \
--tabwidth=20 \
--lower-limit=0 \
--no-legend \
DEF:temp0="${DBASE}":temp0_hd:AVERAGE \
DEF:temp1="${DBASE}":temp1_hd:AVERAGE \
AREA:temp0#00CF00: \
LINE1:temp1#FF0000: