4 ms·
Why over complicate it with electronics? It’s a computer. Just have your device shutdown when it can no longer poll another device. For example, if the router
by greggsy 4y ago
Why over complicate it with electronics? It’s a computer.
Just have your device shutdown when it can no longer poll another device. For example, if the router or some other network device isn’t contactable for longer than two minutes, it might indicate that the power is out.
- unregistereddev 4y agoThe router is one of the first things I put on a UPS. The telco equipment likely has fallback power as well. Sure, you could find some device that isn't on a battery backup and ping it regularly. But this approach forces the device on your UPS to shutdown as soon as power is lost. That buys you a clean shutdown, but you don't get the added benefit of being able to run without interruption during a brief brownout.
- deleted 4y ago[deleted]
- tenebrisalietum 4y agoI heard of connecting an old modem to a serial port for this purpose. If it doesn't respond to any AT commands then power may be out.
- Nextgrid 4y agoAny networked device will do - switch, router, etc. If there's no link on the port, power is down. USB-C Ethernet adapters with power pass-through will generally power the Ethernet module off the USB-C power port even if no host device is plugged in. USB-to-Ethernet adapters may also light up the port even if only connected to power (and not a host device).
- justsomehnguy 4y agoAnd couple of months later you are investigating why the branch gone dark in the middle of the day. No. Devices should survive powerloss, devices can have a graceful shutdown from an external source. Key is in your "might".
- greggsy 4y agoIf you’re proposing to support a whole branch without a proper UPS, then your employer needs to reevaluate their hiring choruses.
- justsomehnguy 4y agoIt's more common for the employer to cheap out and not to buy UPS than for a sysadmin to propose a lack of UPS. In your example even simply updating router OS/FW would case the router to reboot and your script will gladly shutdown the server.
- goodpoint 4y agoAnd you call that "simple"?
- asdff 4y agoYou could do it with a bash one liner
- goodpoint 4y ago...while also keep a number of network devices always connected, reachable and correctly configured. Have one router break or someone disconnect one cable and your servers will power down. "simple".
- asdff 4y agoThat's not hard to do, for some networked devices that step amounts to just plugging it into a power source and connecting it to the network. I haven't had to touch the configuration of my wifi printer for example since I plugged it in to the wall years ago.
- greggsy 4y agoMuch simpler than sourcing and jury rigging some components into a usb interface. You’d need to set up some scripting for that anyway.
- axiolite 4y ago> Just have your device shutdown when it can no longer poll another device. Most people want their devices to stay up and running on battery as long as they can, not just shut-down immediately after utility power goes down. Without somehow measuring the battery voltage, you can't estimate how much run-time your devices have to work with.