Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make batch file for Server Shutdown 1

Status
Not open for further replies.

Nytro

MIS
Dec 24, 2001
25
US
I would like to execute a batch file or command file to shutdown my server. I'm using power chute business edition along with utilizing the console.

I've been on apc's forums i.e. answer id: 7712, however it does me no good, because I do not know how to write a batch file or command file.

I have a server with SBS 2003 connected to a apc smartups 1500 by serial cable.

Any help will be greatly appreciated.

Thank you
 

Do you mean to shutdown your server in the event of a power outage? If so then you shouldn't need to write a batch file. That's the whole idea of the smartUPS. Everything that you want to configure should be configurable through the Powerchute software.

See user manual starting on page 6 (page 8 if you use the PDF page numbers).

Hope this helps.

Please help us help you. Read Tek-Tips posting polices before posting.
Canadian members check out Tek-Tips in Canada for socializing, networking, and anything non-technical.
 
Thank you for your response! Looking through the manuel I see that their is a Shutdown Delay. Does this mean when there is a power outage the SmartUPS sends a signal to the server automatically thus shutting it down?

The Powerchute business edition does have a setting where you can configure a batch file or command line. I guess this is where I get confused. Maybe writing a batch file or command line shuts down a Service prior to the UPS shutting down the
server?

Let me know your thoughts!


Again! thank you


 

What service(s) do you want to shut down? Is this an exchange server? If it's just a normal server then you don't need to shut down any service(s) first.

The UPS sends a shutdown signal to the server it doesn't just cut the power.

By default the Low Battery Warning will commence the shutdown sequence when there is two minutes of battery time left on the UPS. Change that to something higher than the default.

The Shutdown Delay controls the amount of time between the commencement of the shutdown sequence and the actual shutdown. The Powerchute software sends out a warning to any devices connected to the server that the server is about to shutdown every 30 seconds from the time that the shutdown sequence is commenced until the connected device disconnects. Set this value at something less than the the Low Battery Warning. Remember when setting the value that this is in seconds and the Low Battery Warning is in minutes.

We have ours set as 8 minutes for the Low Battery Warning and 270 seconds for the Shutdown delay. It gives the users plenty of time to save their work and log out. Caveat: Our settings are based on our load on the UPS. You may need to set different values. Use your Powerchute monitoring to check the "Battery runtime" (or something similar, I don't have access to our servers at the moment to check the exact wording).

We have all our devices, except our printers, on UPSs. Only the servers, switches, router, and modem are on SmartUPSs, the rest are on individual UPSs. This allows the users to save their work before shutting down their computers. Printers, particularly laser and multifunction printers, shouldn't be plugged into UPSs.

Remember, the whole idea of a UPS is to provide uninterrupted power so you don't want your server shutting down immediately if the power is only going to be off for a few seconds.

Hope this helps.

Please help us help you. Read Tek-Tips posting polices before posting.
Canadian members check out Tek-Tips in Canada for socializing, networking, and anything non-technical.
 
The command line or batch file option is so that if you have multiple servers, and just the one is connected directly to the UPS, you can send a message or command across the network to down the other servers as well. Back in the last century, on a Best Ferrups and Netware servers, one server was connectec to the UPS via Serial port, and ran an app (they were called Netware Loadable Modules) that did kind of what Powerchute does. The other servers ran a version of app that listed to the server with the connection to the UPS, so they would initiate their shutdown when it called for it. With the batch file or command line option in Powerchute, you could use s NET Send to issue graceful shutdown commands to the other servers.

Fred Wagner

 
I am assuming the computers/servers attached to the UPS are Windows machines. If so, create a .bat file using something similar to the following...

Code:
shutdown –m \\computername –f –c “Computer is shutting down in 120 seconds. Please save any work in progress” –t 120



Brad L.
Network Engineer
Pcubed

"Some things Man was never meant to know. For everything else, there's Google.
 
Sorry, just now realizing you said you don't know how to write a batch file... OK - please copy my command from above and paste it into notepad and finally save it as shutdown.bat. You can then tell your UPS software to run that bat file. Make sure you actually replace \\computername with the actual nae of your computer.

Brad L.
Network Engineer
Pcubed

"Some things Man was never meant to know. For everything else, there's Google.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top