Home‎ > ‎Server config‎ > ‎

Server room temperature check script

Typical crontab to check temp remotely from the temp sensor module:

#!/bin/tcsh

set threshold=26

set temperature = `curl svr.bi.up.ac.za:61033`

set temp = `echo $temperature|cut -c 3-4`

if ($temp >= $threshold) then
    printf "Subject: Server room aircon alert\n\nTEMPERATURE THRESHOLD EXCEEDED %uC\n" $temp| /usr/local/sbin/ssmtp johann.maxen@gmail.com, johann.swart@up.ac.za, fourie.joubert@up.ac.za, fourie.joubert@gmail.com
endif

# echo $temp