×
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!
  • Students Click Here

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

Students Click Here

APC shutdown sequence

APC shutdown sequence

APC shutdown sequence

(OP)
Hello,

       Have any of you successfully used the shutdown sequence to turn off remote servers within the same lan ?  Currently I have 1 UPS with 1 communication port and 2 servers.  I have the ups connected to one of the servers.  When there's a power failure, you can program a little script so that certain operations can be performed before the UPS shuts down the server that is connected to it (via the communication cable).  The script is placed in the Shutdown Sequence menu.  I know that you can buy the port expander so that there are multiple communication cables going to each server but I don't want to use that option.  Now I've tried the following tools to remotely shutdown my other server : psshutdown (from PSTools), nltest.exe (comes with Windows 2000 Server), tsshutdn (usable if you have terminal services running) and shutdown.exe (comes with PowerChute).  Using psshutdown and tsshutdn works fine when executed within a .bat, command prompt or .cmd manually.  However, when the UPS calls the script then it doesn't work.  With psshutdown, nothing happens.  With tsshutdn, you see a message appear on the screen indicating the server will shutdown but after the time elapses, nothing happens, the server keeps on running.  With nltest and shutdown, they seem to only work locally (must be run from the remote system). It won't work when you run it from the computer connected to the UPS even through command line.  I'm wondering if the APC software somehow detects you are trying to shutdown a remote system without using a port expander and blocks it.  I even tried calling a batch file that resides on the remote server from the script and it still doesn't work.  BTW, I have the PowerChute Business Edition 5 Nodes that comes with the APC Smart-UPS 1000

Any ideas ?  Or do I have to absolutely buy a port expander or put a single UPS per server ?

Thanks
anthony

RE: APC shutdown sequence

You can run the APC software on multipule computers listening for a shutdown command from the host with the connection to the UPS.

RE: APC shutdown sequence

Set the permissions of the batch file to interact with the desktop and then call the batch file from the APC CMD file.

RE: APC shutdown sequence

Hi anthony I was wondering if you had that script so I could play around with it.

Thanks

RE: APC shutdown sequence

(OP)
Naw, I don't have the scripts anymore.  But basically what I tried is create a batch file with the commands like tsshutdown (from windows) or psshutdown (from Winternals) with switches that remotely shutdown the servers.  When I manually ran the batch file, it would properly shutdown the other servers that were NOT attached to the UPS via the comm cable.  Then in PowerChute, I configured it to execute the batch file I created when the battery ran low.  Unfortunately it didn't work.  I did 2 things to solve the problem. 1) I got separate UPSes for each server and 2) I bought a port expander for my other "larger" UPS to control up to 7 servers.  The port expander is already screwed into the server rack but haven't connected the comm cables to each server yet.  I've been too busy with half a dozen ongoing projects and trying to joggle everything !  There's another thread in this forum about an open license software that works with remote servers.  I'll give it a try when I get back from my trip.  I have to fix a crashed server that's very far (I'm in Canada and the server is in Africa).  Good luck with your testing.

RE: APC shutdown sequence

Hi, Akwong. I have tried to do a network shutdown in the same way you mentioned. Used a cmd-file that uses the shutdown.exe file. The file works on its own, but in Powerchute it doesn't. I have emailed APC but they don't seem to give me a good answer.

I even tried to let a first cmd file open a second cmd file and that one runs the shutdown command. Not working in Powerchute. Then I made a program in Visual Basic that opens the cmd-file with the shutdown command. NOPE

It's like powerchute blocks that command, but only if it is over the network.

If anyone has an idea or whatsoever, please post!!!!


This is the cmd-file:


NET USE \\SERVER\SharedFolder /user:administrator pasword
SHUTDOWN.EXE -s -m \\SERVER -t 60


First log on to the remote servers share as administrator, the shut it down.

When double clicking the cmd-file, it works. When Powerchute opens it, it doesn't.

Greetz

RE: APC shutdown sequence

APC finally gave me the solution for a remote shutdown using a CMD-file:

To clear up any permission problem, you can make the APC services run as Administrator. To do this, go to the system services and: 1. Stop the APC PBE Agent and APC PBE Server services 2. modify their properties by setting Log on as account Administrator in the "Log On" tab 3. reboot the system.

RE: APC shutdown sequence

(OP)
Hi pthomass,

     Thanks for the info.  I also had tried having one batch call another batch and it didn't work as you figuered out.  I never thought about a permission problem.  I'll give it a try this week.  I just came back yesterday and have tons of emails to catch up on.  Man, going from high speed internet to nearly dial-up speed is unbearable.

RE: APC shutdown sequence

Hi Akwong,



did you try it already? I'm experiencing problems with this. With the permissions issue solved I'm able to test my command file for network shutdown, but when Power fails, my command file doesn't get executed. Why I don't know...

Have you experienced the same?

RE: APC shutdown sequence

(OP)
Hi pthomass,

       Sorry, haven't tried yet.  I'm getting overwhelmed with projects.  All the CEO's are back from vacation and have new and great ideas that they want implemented yesterday (if you get my drift).  They (all the CEO's) were probably chatting during the holidays and were comparing IT technologies.  At least I'll make a little money on some of these new "ideas".  I'll let you know when I get a chance.

RE: APC shutdown sequence

Just tried it out and it worked no probs. Just using the
"default.cmd" file

start shutdown -m \\computer name -s -f -t 180

RE: APC shutdown sequence

I finally got this working using a combination of methods mentioned above...so to consolidate what everyone was talking about:

Powerchute Business Edition

1) Make sure that the services for the Agent and Server are bound to an authorized administrator that can run commands on the remote servers.  APC actually has a decent article on this at the following location:

PowerChute Plus for Windows NT/2000/XP is not executing a command file - Answer ID: 1784
http://nam-en.apc.com/cgi-bin/nam_en.cfg/php/enduser/std_adp.php?p_faqid=1784&p_created=1010390400&;p_sid=W2m3KsWh&p_lva=&;p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9MjgxJnBfcHJvZHM9MCZwX2NhdHM9JnBfcHY9JnBfY3Y9JnBfc2VhcmNoX3R5cGU9YW5zd2Vycy5zZWFyY2hfbmwmcF9wYWdlPTEmcF9zZWFyY2hfdGV4dD1tYW51YWxseSB1bmluc3RhbGwgcG93ZXJjaHV0ZQ**&p_li=&p_topview=1

2) Make sure the extention of your script file and syntax within are correct.  This is where it gets a bit tricky.  Make sure you use a file with the .cmd extension (i.e. shutdown.cmd).  The syntax, when executing a remote shutdown command for instance is the following:

START "" shutdown -s -m \\remote_location -t time_in_seconds
or
START "" shutdown -s -m \\j-compy -t 180

DO NOT FORGET the "" or your script will not work.  APC is funny about that.  It requires "" in order to delineate "spaces" in its programming...at least before you run the shutdown command.  

When this script fires off, it will send the shutdown command to the computer known as "j-compy" which will shut down in 3 minutes.  

Incidentally, to cancel this request, run this from the command line: shutdown -a -m \\j-compy
(Just incase...you will NOT be able to cancel this with the mouse)

Hope that helps

RE: APC shutdown sequence

Hi JMBraun,


Thanks for your respond. I've got it working as well. Figured out as well that the service needs to be used as administrator. Never got round to write it down in here.

Thanks

Greetz

Peter

RE: APC shutdown sequence

-I accidentally put this into the wrong thread. I apologize.-

OK, I know this is a rather old thread, but it has been helpful to me in setting up our in-office UPS over two servers. I have a quick question though.

My UPS reports power failure/restored a couple times a week which only last about 1 to 2 minutes. If I have this command file in the shutdown sequence, I know it'll go off at whatever time interval I say, but will it still run the command if the power is restored? This may be a silly question.  

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! Already a Member? Login

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