Page 1 of 1
Use log as trigger
Posted: Wednesday 30 March 2016 10:12
by sebaszz
Is it possible to trigger event based on result of the log.
I want to have a trigger when "Toon" provides the following error in the log: "Error: ToonThermostat: Error login!"
Can somebody push me in the right direction?
Re: Use log as trigger
Posted: Wednesday 30 March 2016 10:37
by Egregius
Maybe a huge thing, but I guess fail2ban should do it.
fail2ban can monitor logfiles in realtime and do actions if a string is found.
Normally used to block IP adresses in firewall but the action can be anything you want.
Re: Use log as trigger
Posted: Wednesday 30 March 2016 10:40
by jvdz
What I have done for my ICY thermostat is to check for the lastupdate of the TempDevice being older than 5 minutes triggering an Telegram message that there is an error.
Guess you could also use fail2ban to scan the log for this and create an action based on it, but is more difficult to do if you want to warned of loosing the connection to your thermostat.
Jos
Re: Use log as trigger
Posted: Wednesday 30 March 2016 11:08
by Egregius
If the timestamp gets updated regularly that would absolutely be an easier solution.