UPS Script - Shutdown server


Would like to know if there is some kind of script or app I could install on my Suse Linux 9.1 Ent server to do the following


Power failure occurs and UPS switches to battery backup,
Then sends signal via usb / serial to the server, Server picks up signal and initiates a shutdown sequence.

The area that this server is located at suffers from sever power outages for long periods of time.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Doesn't need to be much of a script really, just make sure that the signal triggers:

shutdown -h now

for immediate shutdown, or

shutdown -h -t 60

if you want a delay of 60 seconds before shutting down.

To ensure that all users are aware of the reason for the shutdown and the fact that it was going to happen, enter the following into the script:

wall "Server is commencing a shutdown in x minutes due to a power failure. Please save all work now!"

The message can be integrated into the shutdown command if required. To cancel a shutdown if the power comes back on you need:

shutdown -c


man shutdown

for more info.


In order to cancel the shutdown if the power comes back on,
richard_hAuthor Commented:
Not to worried if it goes down the user on site can boot it up then if need be.
Do you know of any software that could interpret the signal to the server?
ie to kick off the script
Most linux distros have a UPS daemon available and if not a bunch can be downloaded and configured

Just do a search on google for ups and linux

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
richard_hAuthor Commented:
Will give it a bash if it works will award points

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.