• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 486
  • Last Modified:

UPS Script - Shutdown server

Hi,

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

Scenario

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.

Richard
0
richard_h
Asked:
richard_h
  • 2
2 Solutions
 
pjedmondCommented:
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

Check:

man shutdown

for more info.

HTH:)



In order to cancel the shutdown if the power comes back on,
0
 
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
0
 
badianeCommented:
Most linux distros have a UPS daemon available and if not a bunch can be downloaded and configured
http://www.roseindia.net/linux/tutorial/linux-howto/UPS-HOWTO/x73.html
http://www.sibbald.com/apcupsd/3.8manual/apcupsd.pdf

Just do a search on google for ups and linux
0
 
richard_hAuthor Commented:
Will give it a bash if it works will award points

Richard
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now