Servers - General

HP power protector does not run a script

Go to solution
Occasional Contributor

HP power protector does not run a script

Hello everyone,


I'm currently trying to use a script on HP power protector for running some commands on my ESXi server in case of power failure from my ups and I need some help.


I made a script for a SSH connection to the server which looks like :


plink -v -I c:\...\****.ppk root@ <command>

 (-v for the detail or the connection, -I for an authentication key, the .ppk)


If I launch the script on windows or I run the command on the console it work fine but when I use the "test shutdown" link on hppp nothing seems to work.


I tried to use an another bat for a test with these commands :

shutdown : OK

mkdir : OK

calc : KO

plink,putty : KO


Is there something that block my command ?

What can I do ?




best regards






vm with hppp : windows 7

server ESXi : hp proliant ml110

ups : hp T750 g2

Occasional Contributor

Re: HP power protector doesn't run my batch file



I tried with a .js script based on the sample of hppp :

UserScript =
  name: "shutdownvm",
  enabled: true,     // Set this property to true to enable the script.
  onEvent: true,      // If true the script is called each time an event occurs.
  delay: 0,           // This property can be used to delay first execution of the action in milliseconds.
  interval: 10000,    // and every 10s from that
  onStart: function() // Startup function (optional)
    // Use this place to insert initialization code
  action: function()  // Script action definition
	exec("plink -v -i c:\...\****.ppk root@ /sbin/ && /sbin/poweroff");  
  onStop: function() // Ender function (optional)
    // Use this place to insert finalization code

KO, don't work


if i change the command :

exec("shutdown -s -t 30");                                            KO

exec("shutdown -m \\ -t 30 -t 30);    KO


if you know something wich can help me don't be shy please :)




best regards


Valued Contributor

Re: HP power protector doesn't run my batch file



Please refer to the following document  - HP Power Protector Software - Shutdown Script Does Not Work



Thanks & regards,



Thanks & regards,
I work for HP
A quick resolution to technical issues for your HP Enterprise products is just a click away HP Support Center Knowledge-base
See Self Help Post for more details
Was the post useful? Say thanks by clicking the white KUDOS Star!

Occasional Contributor

Re: HP power protector doesn't run my batch file



woooo thank you very much !

It work now :)


just two details

first, the path specified 3 time at the end of the document is wrong for me :


-> /usr/local/HP/PowerProtector/bin/ (no virt_tools and u to

and second, there is a bug with perl when the run :

'https://<xx.xx.xx.xx>:443/sdk/vimService.wsdl'; at /usr/lib/perl5/5.10.0/VMware/ line 545.

There is a simple way to correct it : just add at the top of the script :



[EDIT] third, ssh is not allowed on VMa after an installation we need to edit /etc/hosts.allow and add a ligne :

sshd: ALL: ALLOW


It work fine for me now :)



Best regards


Established Member

Re: HP power protector doesn't run my batch file

Hi john, 

how do you do it.

i have same problem using the sample script.

on my case i realy need to use this sample script to shutdown ESX 6.0 with all vms, 3par and  storeonce.

i have 1 script based in powershell, to do the job but all the options that i try do execute failed.