No, this is not CakePHP code snippet! 🙂
So, I had experience with an UPS Inform GUARD Standby SERIES 1500AP recently. It took me a while to understand that this is not the right model for the server ups solution, but anyway, this give me opportunity to understand something for this part of the hardware which I haven’t had change to touch.
The whole problem is that this ups doesn’t have Auto restart functionality, so if the power is down I can shutdown it, but on the power-on it doesn’t start up automatically, so the next power crash the server is doomed.
According with this I couldn’t manage to find single package which could work properly with this UPS. The nut package clam to support it, but in fact the driver recommended as working was not working at all.
Finally I managed to get signals from the ups with powstatd which is quite low level software. Ok, there are some additional files, but they cannot work with the upstart in Ubuntu. What I managed to get from it was status change in a file with following states: OK, FAIL and LOW.
So, in order to turn these states in actions I just wrote a small bash script, which doing different things on each state change.
Continue reading →