Community discussions

MikroTik App
 
jschnip
just joined
Topic Author
Posts: 8
Joined: Tue May 30, 2006 11:46 pm

APC UPS Reboot Command

Thu Sep 07, 2006 6:57 pm

Would it be possible to add a "reboot the ups" command? This would be useful for using the mikrotik as a remote power controller for all the devices connected to the UPS. The command could gracefully shut down the mikrotik and then reboot the UPS. This appears to be a possible command, having reviewed the powerchute software.

Thanks
 
Beccara
Long time Member
Long time Member
Posts: 606
Joined: Fri Apr 08, 2005 3:13 am

Fri Sep 08, 2006 6:56 am

Rebooting a UPS??!!
 
jschnip
just joined
Topic Author
Posts: 8
Joined: Tue May 30, 2006 11:46 pm

Mikrotik+UPS could replace Remote Power Controller

Fri Sep 08, 2006 1:44 pm

Yes, We currently use an additionaly piece of equipment (an ethernet remote power controller) to power cycle remote equipment that needs to be restarted. The Power Controller that we use, allows us to reboot equipment, and it also has an auto-ping feature, which will reboot a specific outlet if ping stops. This is all functionality that could be performed with the Mikrotik, allowing us to install UPS's (mainly to provide clean power) instead of the power controllers.
 
Beccara
Long time Member
Long time Member
Posts: 606
Joined: Fri Apr 08, 2005 3:13 am

Fri Sep 08, 2006 2:07 pm

Oh right its a managed power strip.

Sounded like you wanted to turn the ups on or off.


Anyway yes this would be a nifty feature, the APC PDU's are popular and SNMP based so it shouldnt be too hard to work something out
 
User avatar
BrianHiggins
Forum Veteran
Forum Veteran
Posts: 702
Joined: Mon Jan 16, 2006 6:07 am
Location: Norwalk, CT
Contact:

Sat Sep 09, 2006 11:51 pm

Sounded like you wanted to turn the ups on or off.
I think that is what he's getting at.

I beleive that the APC's, as well as others I'm sure, have the ability to send them a power down signal that will cause them to power down, and automatically power back up when the power level raises above a certain point.

I don't know if this would work as jschnip wants though (I agree, it would be very usefull at times) as once it powers down, you can't tell it to power up. There may be a way to trick it by reading the current power level, (say 98% charge for this example) initiating a battery test, which will drain the battery 1%-2% (guessing) and thus leaving the battery at 96%-97% then initiating a shutdown command to automatically power back up as soon as the power level reaches the original 98% level.

this will take some research on MT's part, but would be quite useful for remote locations if something locked up. it's not an ideal solution, but I would rather have the equipment powered down for 5-10 minutes while the battery backup recharges then drive 30 miles to flip a power switch off and back on.
 
voip4life
Frequent Visitor
Frequent Visitor
Posts: 52
Joined: Fri Dec 16, 2005 11:52 pm
Location: US

Sun Sep 10, 2006 10:35 pm

APC UPS's allow you to "reboot" the UPS or "Sleep" the UPS for a certain amount of time.

I believe what he's asking for (and if not...I am) is to use a watchdog or ping to ping OUT from the router to the net or your network. If this fails, then issue the command to the UPS to REBOOT or SLEEP for a few minutes and then turn back on. This will reboot the entire site and all radios, and if one had locked up, it should now start responding once the UPS is back on and power is restored. You don't need to worry about how to turn the UPS back on, it does it automatically. We do it all the time, the difficulty is when your backhaul to the tower locks up, then it doesn't matter how fancy your IP-device is, you won't be able to get to it to reboot it, except for in your truck (unless you have a phone-line or something like that).

We were just thinking of this recently and decided it's possible and plugged in a Routerboard to a UPS via the serial cable and are not sure what to do next, does anyone have any ideas to setup a watchdog capable of issuing a command to APC UPS to reboot?
 
aviper
Member Candidate
Member Candidate
Posts: 196
Joined: Thu Sep 15, 2005 5:48 pm

Sun Sep 10, 2006 11:13 pm

I use rebooter that is atached to Parallel port of the PC. But I can use it only with linux and windows :/. MT cannot control the LPT port.
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Mon Sep 11, 2006 10:32 am

We were just thinking of this recently and decided it's possible and plugged in a Routerboard to a UPS via the serial cable and are not sure what to do next, does anyone have any ideas to setup a watchdog capable of issuing a command to APC UPS to reboot?
Not sure about the protocol APC is using, but I wrote a Wiki entry not long ago on how to send out some string over the serial port with RouterOS - perhaps this does help a bit?! You can find it here: http://wiki.mikrotik.com/wiki/Sending_t ... erial_port

Best regards,
Christian Meis
 
jschnip
just joined
Topic Author
Posts: 8
Joined: Tue May 30, 2006 11:46 pm

Mon Sep 11, 2006 4:41 pm

APC UPS's allow you to "reboot" the UPS or "Sleep" the UPS for a certain amount of time.
This is what I am requesting. In the APC Powerchute software, there is a utility to execute this "reboot" and "sleep". The ups has to be a SmartUPs, I think, and I assume the UPS stores the sleep command, so I assume its just one overall command. IE reboot_sleep_15

I think the missing piece is the protocol and command that the software sends. I am a network e, so my natural instinct says to sniff it, but since its serial, I'm not sure if there is a way to "sniff" rs-232? Some serial experience from others would be helpful here. Thanks
 
jschnip
just joined
Topic Author
Posts: 8
Joined: Tue May 30, 2006 11:46 pm

Mon Sep 11, 2006 5:05 pm

After taking my own advice, I just googled and found a listing of the APC Smart Protocol
http://www.networkupstools.org/protocols/apcsmart.html

I will be testing today to see if the @nnn command is what we are looking for. If so, is this something that Mikrotik would consider building in as a function of the UPS commands, bypassing the need to direct text to serial for scripts, usage, etc.
 
jschnip
just joined
Topic Author
Posts: 8
Joined: Tue May 30, 2006 11:46 pm

Tue Sep 12, 2006 6:23 pm

When sending the command @001 (6 minutes) using the text to serial method and a delay of 10 in my Mikrotik script, the UPS beeps, but thats it. I have the serial port on the UPS configured for 2400/8/N/1, flow control=xon/xoff, per what I could find on the net.

I tried to use hyperterminal from my PC to send the text, but that didn't seem to do anything...

I did test with APC's powerchute software, and the unit does power off, and then wait 6 minutes to power back on. Anybody have any advice or want to give it a shot?

Thanks
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Tue Sep 12, 2006 6:28 pm

If you could find a serial port logger you could sniff what powerchute sends and then see what is different.

Sam
 
User avatar
jp
Long time Member
Long time Member
Posts: 609
Joined: Wed Mar 02, 2005 5:06 am
Location: Maine
Contact:

Tue Sep 12, 2006 8:32 pm

I know if you use the wrong cable with the wrong UPS, it will shut the UPS off. I don't remember if it's the smart ups or back ups that responds this way. If so, it could be simplified to a lower level perhaps.
 
Hellbound
Long time Member
Long time Member
Posts: 508
Joined: Tue Oct 26, 2004 11:21 am

Re: APC UPS Reboot Command

Fri Sep 29, 2006 9:22 pm

Would it be possible to add a "reboot the ups" command? This would be useful for using the mikrotik as a remote power controller for all the devices connected to the UPS. The command could gracefully shut down the mikrotik and then reboot the UPS. This appears to be a possible command, having reviewed the powerchute software.

Thanks
use APC HS-500 to reboot any device connected to it. it has 3 port that you can OFF/ON or REBOOT each port separately via web-based interface.
it was very useful for us since its only 100 USD

Who is online

Users browsing this forum: qatar2022 and 216 guests