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.
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.
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.
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?
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_text_out_over_a_serial_port
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
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.
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?
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.
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