nachdem ich auf der CCU2 jetzt lokal einen Software Watchdog laufen habe wollte ich euch diesen nicht vorenthalten:
eine Datei in /usr/local bei mir heist diese check.sh erstellen:
Code: Alles auswählen
#/bin/bash
rfd=$(ps aux|grep 'bin/rfd '|grep -v grep|wc -l)
rs485=$(ps aux|grep 'bin/hs485d '|grep -v grep|wc -l)
rega=$(ps aux|grep '/bin/ReGaHss'|grep -v grep|wc -l)
cuxd=$(ps aux|grep '/usr/local/addons/cuxd/cuxd'|grep -v grep|wc -l)
msg="X"
if [ $rfd -lt 1 ]; then
msg="no rfd process running"
echo $msg
fi
if [ $rs485 -lt 1 ]; then
msg="no rs485 process running"
echo $msg
fi
if [ $rega -lt 1 ]; then
msg="no ReGaHss process running"
echo $msg
fi
if [ $cuxd -lt 1 ]; then
msg="no cuxd process running"
echo $msg
fi
if [ $msg == "X" ]; then
echo rfd: $rfd, rs485: $rs485, ReGaHss: $rega, CUxD: $cuxd daemons running, all fine...
else
url=$(echo "msg" | sed -e 's/%/%25/g' -e 's/ /%20/g' -e 's/!/%21/g' -e 's/"/%22/g' -e 's/#/%23/g' -e 's/\$/%24/g' -e 's/\&/%26/g' -e 's/'\''/%27/g' -e 's/(/%28/g' -e 's/)/%29/g' -e 's/\*/%2a/g' -e 's/+/%2b/g' -e 's/,/%2c/g' -e 's/-/%2d/g' -e 's/\./%2e/g' -e 's/\//%2f/g' -e 's/:/%3a/g' -e 's/;/%3b/g' -e 's//%3e/g' -e 's/?/%3f/g' -e 's/@/%40/g' -e 's/\[/%5b/g' -e 's/\\/%5c/g' -e 's/\]/%5d/g' -e 's/\^/%5e/g' -e 's/_/%5f/g' -e 's/`/%60/g' -e 's/{/%7b/g' -e 's/|/%7c/g' -e 's/}/%7d/g' -e 's/~/%7e/g')
wget -q -O - 'http://<ip>/mail/mail.php?rec=userdomain.com&sub=ccu%20reboot&mes='$url
reboot
fi
Dann erstellt einen cronjob welcher jede Minute das Script aufruft
Code: Alles auswählen
crontab -e
Code: Alles auswählen
5 * * * * /usr/local/check.sh
EDIT 01-2014: Zeitintervall der Überprüfung von jede Minute auf 5 Minuten geändert --> weil die JAVA SCH**** ab der Firmware 2.7.8 so lange zum starten braucht lößt der conjob bereits einen neustart aus bevor alle Dienste beim normalen Hochfahren gestartet wurden!
LG
Paul