Implementation of "Reboot via PoE" hardware watchdog

Hello,

I’m having trooubles with 3G on RB441UAHR ( http://forum.mikrotik.com/t/big-problem-with-option-minipcie-hsdpa-card-on-rb411u/32953/48 ) and because I have also RB750UP onsite, I would like to implement watchdog with reset of external device with PoE.

Why? current watchdog is too harsh and has no configuration options. GPRS is very slow and watchdog checks connectivity too often. Aparto of these, some of the users complain about loses of PPP configuration (I’ve reproduced them successfully of course via every 5 minutes reboot on 5.22, still trying on 5.24, until now looks good). Using netwatch is also not an option, because it starts with router and when PPP is not already there.

Why, from business perpective? because availability is not the most important; more important is the instalation is independent and running unattended for next 10 years.

How? I need a script on RB750UP:

  • a script to check conditions on external 411UAHR router (SNMP check, API, ssh, whatever)
  • same script checking ability to ping an address or any other mean the correctnes of GPRS connection
  • and turn off and on the PoE interface if both are true, whatever.

The scheduler would run the watchdog each 15 / 30 / or_any_other_interval minutes.

Is anybody aware of existence of such script or shall I try to write my own? Has anybody have any thoughts I should consider before starting?

Thank you!

Starting point:

/system script 
add name=ResetExternalDeviceViaPoEOnOutage policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api source=":if ([/ping 8.8.8.8 interval=2 count=10]\
    >0)  do={[/log info \"WATCHDOG: Host 8.8.8.8 is responding, sleeping.\"]} else={[/log info \"WATCHDOG: Host 8.8.8.8 didn't respond, restarting device on\
    \_ether5.\";\
    \n /interface ethernet poe set ether5 poe-out=off ;\
    \ndelay 10;\
    \n/interface ethernet poe set ether5 poe-out=auto-on ;\
    \n/log info \"WATCHDOG: Device on ether5 restarted via PoE.\"\
    \n]}\
    \n"

/system scheduler
add comment="Restart device via PoE if a host doesn’t respond " disabled=no interval=1h name=CheckExternalDevice on-event=ResetExternalDeviceViaPoEOnOutage policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-date=jan/01/1970 start-time=18:00:00