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

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: