Servers - General
cancel
Showing results for 
Search instead for 
Did you mean: 

HP Power Protect will not run a custom script when shutting down?

 
TippleOne
Occasional Contributor

HP Power Protect will not run a custom script when shutting down?

Hi Guys

 

Got a brand new shiny ML310e G8 server running Win2008. We connect a brand new shiny R/T3000 G2 UPS to the server via a serial cable and install HP Power Protection. Everything appears to be working fine. HP Power Protection software detects the UPS and we can configure it to Shutdown the server after 2mins. Pull out the power on the UPS and the server shutdowns gracefully after 2 minutes.  Brilliant....!

 

The HP Power Protection User Guide pdf talks about the Shutdown Configuration window. You can choose four different options to occur during a power cut. Hibernate, Shutdown, Shutoff and Script.  We change it from Shutdown to Script. The absolute path we type in for the script is identical to the pdf example. Ie c:\shutdown.bat ... We then go and create a file called shutdown.bat and place it in the location c:\ on the server. The shutdown.bat file is just

REM It works

Pause

Disconnect the power again and the HP Power Protection software advises us politely that the the server will shutdown in 2 mins, just like before. But,.... when two minutes is up and the server says it is shutting down, nothing happens. The batch file doesn’t run...!?!

 

Have tried running the batch file manually to make sure it works. A DOS screen pops up and waits for you to hit a key – pretty basic. So, what gives....?  What are we missing or is this a bug with the software...?

 

Have downloaded the latest HP Power Protection v 1.02 build 026.

Have tried installing it on a Win7 PC and get the same result. The script option doesn’t work...?

Have tried different batch files in different locations on the server and the PC.

 

Any advice welcome

 

Cheers

Mike

6 REPLIES 6
ravi_k_sj
Frequent Visitor

Re: HP Power Protect will not run a custom script when shutting down?

Kindly use the below details in the shutdown script and save the shutdown script to C: Driver and map the shutdown script created to Network Module.

 

c:\windows\system32\shutdown -s -t 00

-s is to shutdown the server

-t is set time for it to wait before it shuts down.

 

 

I am an HP employee
Regards,
madhuiss
HPE Pro

Re: HP Power Protect will not run a custom script when shutting down?

Adding to previous post I have seen this issue in the past. sometimes when customer runs the server as a script & is monitoring the server via Terminal Session then he would notice the script not running in there but it might have stalled in the actual server.

 

for testing I ran the windows calculator & I did'nt see it pop-up in terminal session & it worked when observed via ILO remote console.

 

So kindly ignore if you were doing this on actual physical server accessing it directly. If anyother like running in guest OS etc then it may not work.

 

Thank you

 

I am an HP Employee

TippleOne
Occasional Contributor

Re: HP Power Protect will not run a custom script when shutting down?

 

 

Thanks for taking the time to reply.

 

Sort of getting there....

 

I tried replacing the HP Power Protector script field to c:\windows\System32\shutdown –s –t 300 as you suggested. Pulled the power lead out of the UPS and the script ran fine. Great...! Created a batch file called test.bat to read c:\windows\System32\shutdown –s –t 300

 

Copied the test.bat file to c:\Users\Administrator\My Documents

Changed the HP Power Protector script field to c:\ Users\Administrator\My Documents\test.bat

Disconnected the power and the script ran ok again. The server was going to power down...! Cool...!

 

 

So all we needed now was to customise my batch file to do other stuff. But do you think I can get them to run – Arghhhhh... This is doing my head in.

 

After a lot of experimenting my batch file test.bat looks like this now. (it’s very complex – lol) c:\windows\System32\shutdown –s –t 300

c:\windows\System32\calc

 

When HPPP detects a power cut it runs the test.bat file and the system shutdown message pops up but the Windows Calculator does not pop up?

 

When I transpose the commands to read

c:\windows\System32\calc

c:\windows\System32\shutdown –s –t 300

 

Nothing happens when we disconnect the power.

 

 

If I type test.bat from a command line prompt the Windows calculator pops up. When I close the Windows Calculator the System Shutdown message pops up ... All good, although I would expect the System Shutdown message to pop up without me having to close down the Windows Calculator.

 

Soooooo, why can’t this same batch file run correctly from HPPP. Is it just a silly syntax thing we are missing or is it something hard coded into HP Power Protector that only allows us to run a “Shutdown” command and nothing else....?

 

 

Cheers Mike

 

P.S. We are running this directly from the console. No remote access. 

ravi_k_sj
Frequent Visitor

Re: HP Power Protect will not run a custom script when shutting down?

Hi,

 

Shutdown Script can include the below entries.

 

Script -- This option manages the shutdown using a custom script that you can create to customize
your own shutdown sequence. You can integrate the standard Windows shutdown command. For
more information, run the shutdown /? command in a Windows Command Line inter
preter. An example script is located in the following folder:
 
<installation path>
\
configs
\
scripts
 
 
In the Shutdown script field, enter the absolute path of the script.
 
 
 
I am an HP employee
Regards,
yannfrj
Occasional Visitor

Re: HP Power Protect will not run a custom script when shutting down?

I had the same problem.

tried to shutdown an proprely an esxi host from a distant windows machine with a PS script 

 

did you found the solution or finaly this script have to integrate only the shutdown command??

 

in the page 60 of the doc say 

Script—This option manages the shutdown using a CUSTOM script that you can create to customize
your own shutdown sequence. You can integrate the standard Windows shutdown command...

 

when i read i understand you can make a CUSTOM script  that can do many operation beside the shutdown.

i do not understand when i read, you can integrate ONLY the standard windows shutdown command..

 

if it is true i dont see really the interest in this option , completly useless.

 

 

 

 

Suresh_Mani
Occasional Advisor

Re: HP Power Protect will not run a custom script when shutting down?

Hi All,

 

Let me clarify the difference between these 2 options available in the Hp Power Protector Software.

 

Shutdown Type: Shutdown --> By Default, Shutdown Command is sent to the Management Server after the value (time) provided in the " Shutdown Initiated after(sec)" .

 

Shutdown Type: Script --> By Default, Shutdown command is NOT sent to the Management Server. For achieving graceful shutdown of the OS, shutdown command has to be specified in the script. If it is not specified, then the management server will powerOFF abruptly after the time specified in " OS shutdown time " since the UPS will unplug power to the load segment.

 

eg: shutdown.exe /s /t 0 /d p:1:1

 

Here are few scenarios that you can test.

 

 

1. If the shutdown command is specified in the script, Load Segment shutOFF is enabled.

Management server will gracefully shutdown.

Load segment will be turned OFF.

And then the UPS will also go OFF.

 

 

2. If the shutdown command is specified in the script & Load segment shutoff is Disabled.

 

Management server will shutdown gracefully & the load segment will stay ON for the time specified in the field " OS shutdown time ".

 

3. If the shutdown command is NOT specified in the script & Load segment shutoff is enabled.

 

Management server will continue working. No shutdown sequence is initiated. Server will stay ON till the end of the time specified in the field " OS shutdown time " and it will powerOFF abruptly.

 

4. If the shutdown command is NOT specified in the script & Load Segment shutoff is disabled.

 

Management Server will Stay ON till the battery is depleted.

I work for Hp