INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Make batch file for Server Shutdown

Make batch file for Server Shutdown

(OP)
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

RE: Make batch file for Server Shutdown


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.

RE: Make batch file for Server Shutdown

(OP)
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


RE: Make batch file for Server Shutdown


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.

RE: Make batch file for Server Shutdown

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

RE: Make batch file for Server Shutdown

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."

RE: Make batch file for Server Shutdown

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."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close