Page 1 of 1

Poor man UPS Monitor

Posted: Wed Jan 10, 2007 2:15 am
by Equis
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?

Posted: Sat Jan 13, 2007 12:09 pm
by vk7zms
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)
}

Posted: Sun Jan 14, 2007 10:24 am
by Equis
Thanks for that

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

Thanks :-)

Posted: Sun Jan 14, 2007 11:32 am
by vk7zms
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.

Posted: Sun Jan 14, 2007 11:44 am
by Equis
Neat, Thanks for that :-)

Thats what I'll do, all the old routers I was going to throw away I'll make use of :-)

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

Thanks

:-)

Posted: Sun Jan 14, 2007 12:47 pm
by vk7zms
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.

Posted: Sun Jan 14, 2007 12:58 pm
by Equis
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 :-)

Posted: Sun Jan 14, 2007 1:02 pm
by vk7zms
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 :)