Hi Robert,
ich habe für die Software monit folgende Datei in /etc/monit/monitrc.d abgelegt:
Das Patter ist nicht sonderlich elegant, aber es funktioniert. Nachteil: wenn neue Dateien dazukommen, muss diese Konfig angepasst werden.
Gruß Michael
ich habe für die Software monit folgende Datei in /etc/monit/monitrc.d abgelegt:
check process openhab with pidfile /var/run/openhab.pid
group openhab
start program = "/etc/init.d/openhab start"
stop program = "/etc/init.d/openhab stop"
if cpu > 60% for 10 cycles then restart
check file openhab.log with path /opt/usr/openhab/logs/openhab.log
group openhab
if match "netzwerk.rules .Datei oder Verzeichnis nicht gefunden" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/netzwerk.rules"
if match "speech.rules .Datei oder Verzeichnis nicht gefunden" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/speech.rules"
if match "status.rules .Datei oder Verzeichnis nicht gefunden" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/status.rules"
if match "'netzwerk.rules' is either empty or cannot be parsed correctly" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/netzwerk.rules"
if match "'speech.rules' is either empty or cannot be parsed correctly" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/speech.rules"
if match "'status.rules' is either empty or cannot be parsed correctly" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/status.rules"
group openhab
start program = "/etc/init.d/openhab start"
stop program = "/etc/init.d/openhab stop"
if cpu > 60% for 10 cycles then restart
check file openhab.log with path /opt/usr/openhab/logs/openhab.log
group openhab
if match "netzwerk.rules .Datei oder Verzeichnis nicht gefunden" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/netzwerk.rules"
if match "speech.rules .Datei oder Verzeichnis nicht gefunden" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/speech.rules"
if match "status.rules .Datei oder Verzeichnis nicht gefunden" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/status.rules"
if match "'netzwerk.rules' is either empty or cannot be parsed correctly" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/netzwerk.rules"
if match "'speech.rules' is either empty or cannot be parsed correctly" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/speech.rules"
if match "'status.rules' is either empty or cannot be parsed correctly" then exec "/usr/bin/touch /opt/usr/openhab/configurations/rules/status.rules"
Gruß Michael
Kommentar