UPDATE 05/04: As mentioned by Tom in the comments, there is now a much better (and cleaner) way of adding hdd temperature sensors to your Observium setup. Using Check_MK and hddtemp, more info available on the Observium wiki.
The only sensor missing in my Observium setup, which is quite critical, are hard disk temperatures.
S.M.A.R.T. is supported by almost all recent disks, and provides a lot of information about them, including temperature.
Based on an article from Glen Pitt-Pladdy, I used his scripts to generate the required snmpd data, and added the necessary Observium discovery script.
At the moment, i’m focusing on the temperature only, the other S.M.A.R.T. values will be added to Observium on a later date.
Create the following perl script on the server to be monitored , e.g. /etc/snmp/scripts/smart-generic.
Create the file /etc/snmp/scripts/smart-cron, and put the following lines into it, this file will be used as a cronjob,
#!/bin/sh for devfull in /dev/sd?; do dev=`/bin/echo $devfull | /bin/sed 's/^.*\(sd.\)$/\1/'` /usr/sbin/smartctl -n idle -a $devfull > /var/cache/snmp/smart-$dev.TMP mv /var/cache/snmp/smart-$dev.TMP /var/cache/snmp/smart-$dev done
Add the following cronjob, I used /etc/cron.d/observium,
*/5 * * * * root /etc/snmp/scripts/smart-cron
Then add the following lines into /etc/snmp/snmpd.conf
extend sreal /etc/snmp/scripts/smart-generic 5 extend srerr /etc/snmp/scripts/smart-generic 1 extend sserr /etc/snmp/scripts/smart-generic 7 extend sair /etc/snmp/scripts/smart-generic R190 extend stemp /etc/snmp/scripts/smart-generic R194 extend secc /etc/snmp/scripts/smart-generic 195
For the moment we will only use ‘stemp’ in Observium, the rest will follow later.
Download this file to includes/discovery/temperatures/ within your Observium root path.
To add the temperature sensor immediately, run ./discovery.php -h all in the Observium root, or ./discovery.php -h <hostname> to only update that specific host.
Now you should see ‘Disk sdX’ item(s) in your temperature listing within Observium.
Together with the IPMI sensors, it looks like this,
TODO: at the moment only /dev/sdX disks are checked for S.M.A.R.T., will need to add CCISS support later.