Does anyone have a Script to share capable of monitoring task(s) something like this ? …
1. Verify T.1 Task(s) are active process(es) in good condition as far as can reasonably be determined, if not take T.2 action.
2. If any T.1 Task(s) are consuming over C% CPU, checked every I time interval, occuring R number of times in a row, then take T.2 action.
3. Check the system.log every I time interval for occurance(s) of L.1 string list, if found take L.2 action.
4. If ping times to P.1 host are above P.2 ms, checked every P.3 time interval, occuring P.4 number of times in a row, take P.5 action.
Example Constants I define: T.1=('olsr','dnsmasq') : T.2=('reboot', 'restart'), C=30 %, I=30 sec, R=3, L.1=('hardware failure','halted') : L.2=('reboot','reboot'), P.1='192.168.1.1', P.2=500 ms, P.3=30 sec, P.4=5, P.5='reset ath0'), -- actions: 'reboot'=reboot, 'reset ath0'=reset interface, 'restart'=run /usr/local/etc/rc.d/'T.1'.sh but if restart or reset fails or is triggered again within 12hrs then reboot.
If not, I may post a small bounty.
Thanks,
Pete