trigger comands when log pattern matches in live log:
tail -fn0 log0.txt  | awk '/alarm is happen for motion/ {system("echo alert")} 
/alarm is clear/ {system("echo clear")}'