Poor man UPS Monitor

Hello

I am going to run my remote AP’s of 12v SLA and chargers.

I was thinking of connecting a $10 switch to ether2 and plugging the switch into main power.

I’d like a script to tell when ether1 has ‘no link’ and then email me.

I have never wrote a MT script before and had a glance at the manual and ran the other way…

Can anyone help with this?

I have done this a couple of times - it works well. I use the following script x2 (one for power up and one for power down). then use the netwatch tool to advise whenever the state changes.

hope this helps


:global datetime ([/system clock get time] . " - " . [:pick[/system clock get date] 4 6] . “-” . [:pick [/system clock get date]0 3] . “-” . [:pick[/system clock get date] 7 11])

{/tool e-mail send to=myemailaddrss@.myisp.com subject=("site-id Power Failure At " . $datetime) body=("site-id Power Failure at " . $datetime)
}

Thanks for that

With netwatch, what do you ping to tell if the power is down?

Thanks :slight_smile:

well - I just ping on old swith that plugs directly into the mains - so when the power goes off and the router is running from UPS (or battery bank), you know the sight has lost power. You can use an old switch or print server or anything you have laying around that has an IP address.

Neat, Thanks for that :slight_smile:

Thats what I’ll do, all the old routers I was going to throw away I’ll make use of :slight_smile:

If it drops a single ping will it send the email?
Of only if it times out a few times.

Thanks

:slight_smile:

Not realy sure on how many pings it takes - havn’t read the manual - lol. Just used the feature. All I can say is I have had very few false alarms - perhaps one a month (I have 11 sites monitored in this way). I have them sending the emails via an sms gateway to my phone. I set it to monitor the host every 30 seconds so if it does give a false power down alarm it corrects it in 30 seconds - so no harm done.

No Problems

I might try use the dude for this, it has down count and email feature.

It also has a 'depends on" feature so if a router goes down on the way it wont think its down when its not.

Thanks :slight_smile:

I usually just set up the netwatch feature on the MT box in question so there is no routers inbetween - ie run netwatch on the MT box running on batteries and have the old switch (or print server - lol) plugged in via ethernet.

Having said that - the dude has some really cool features like that :slight_smile: