Does anyone know of a way to do a remote reboot? I have a script that
can detect when there are problems with my m0n0wall AP's, but I have to
manually log in to them and reboot them when it happens. I'm not too
happy about being chained to my desk 365 days a year. The AP's usually
need to be rebooted at least once per day because of wireless "xmit"
errors.
Here is the script that lets me know there is a problem:
HOSTS="ap1 ap2 ap3"
XMIT_ERROR=`tail -50 /var/log/syslog | grep "xmit failed" | wc -l`
MESSAGE_SENT='no'
# Test syslog file
if [ $XMIT_ERROR -gt 20 ]
then
beep -r 3 -f 900 -l 4000 &
echo "`date +'%b %d %T'` ********** XMIT ERRORS **********" >>
/dev/tty1
echo "`date +'%b %d %T'` ********** XMIT ERRORS **********" >>
/var/log/syslog
MESSAGE_SENT='yes'
# I would like to reboot the AP here.
else
echo "Logs OK"
fi |