rendered paste bodyard@tina:/etc/snmp$ cat smart-temp
#!/bin/sh
if [ $# -lt 1 ]
then
echo "Usage: smart-tmp <device>"
exit 1
fi
DEV="$1"
case "$DEV" in
hd*) smartctl -a /dev/$DEV|grep "Temperature_Celsius"|awk '{ print $10 }
'
break;
;;
sd*) smartctl -a /dev/$DEV|grep "Current Drive Temperature"|awk '{ print
$4 }'
break;
;;
*) echo 0;;
esac
----
En dan in de snmpd:
exec tempsda /etc/snmp/smart-temp sda
exec tempsdb /etc/snmp/smart-temp sdb
exec tempsdc /etc/snmp/smart-temp sdc
exec tempsdd /etc/snmp/smart-temp sdd
exec temphde /etc/snmp/smart-temp hde
exec temphdg /etc/snmp/smart-temp hdg
exec temphdi /etc/snmp/smart-temp hdi
exec temphdk /etc/snmp/smart-temp hdk
exec temphda /etc/snmp/smart-temp hda
-----
in cricket:
OID ucdProgramName .1.3.6.1.4.1.2021.8.1.2
OID ucdProgramResult .1.3.6.1.4.1.2021.8.1.101
map ucd-prog-name
base-oid = ucdProgramName
match = %ucd-prog-name%
Target --default--
inst = map(ucd-prog-name)
target-type = temp
datasource --default--
rrd-ds-type = GAUGE
datasource temp
ds-source = snmp://%snmp%/ucdProgramResult.%inst%
targetType temp
ds = "temp"
view = "temperatuur: temp"
graph --default--
y-axis = "celsius"
units = "c"
legend = "celsius"
draw-as = LINE2
target anouk-hda
snmp-host=anouk.upa.nl
ucd-prog-name=temphda
short-desc = "hda"