APC UPS Data Center & Enterprise Solutions Forum
Schneider, APC support forum to share knowledge about installation and configuration for Data Center and Business Power UPSs, Accessories, Software, Services.
Posted: 2021-07-01 03:26 AM . Last Modified: 2024-03-05 10:50 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:26 AM . Last Modified: 2024-03-05 10:50 PM
Hi!
I have a SmartUPS 1000 connected via USB to an ESXi host. Then I have PowerChute installed on a virtual machine running Windows Server 2012 (running on the ESXi host). I have PowerChute Agent, Server and Console installed on the same server.
Everything is working as expected, I can monitor the UPS through the software or through SNMP, alerts are working and so on. However, my custom script is just not executing.
I have my Shutdown Sequence configured to start a custom bat-file with 0 minutes delay and 10 minutes later shutdown the operating system. The total shutdown sequence is configured to take 11 minutes and 30 seconds.
Under Power Failure I have told PowerChute to begin the shutdown procedure when the UPS is at runtime limit.
What the script does is that it SSHs into my ESXi and shut down all the VMs and then shut down itself. It also SSHs into my NAS and shut it down. The whole process takes about 5 minutes, meaning that PowerChute will never be able to shut the operating system down since the VM will already be powered off at that time.
The expected senario when the power fails is that the UPS should run on battery for about one hour, and when the runtime is 11 minutes left, PowerChute whould execute my custom script and shut down the whole enviroment, and then the UPS would shut down itself after 11 minutes and 30 seconds.
However, this is not the case.
The actual senario is that the UPS runs on battery for about one hour until the runtime is 11 minutes left, then PowerChute shut down the operating system, and then the UPS shut itself down after 1 minute and 30 seconds (meaning my NAS and my ESXi server and all running VMs is taken down abruptly).
To confirm that the bat-script is working, I have clicked the "Test"-button under Configure Shutdown Sequence, and that did work as expected.
Both the PowerChute services runs as Local System.
The bat-script is executing from C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles where SYSTEM has R/W access.
Here is the log from the UPS:
14:38:52 Monitoring Stopped
14:38:50 Sufficient Runtime Available
14:38:42 Insufficient runtime has been detected, PowerChute Business Edition will now start an immediate shutdown.
14:38:42 Shutdown process started
14:38:42 Low Runtime Remaining
13:28:18 Power Failed
Here is the bat-script (please not that sensitive information is replaced with X):
@echo off
C:
cd "C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles"
echo y | plink.exe -ssh 192.168.X.XXX -l XXXXX -pw XXXXX exit
plink.exe -ssh 192.168.X.XXX -l XXXXX -pw XXXXX /etc/init.d/poweroff
echo y | plink.exe -ssh 192.168.X.XXX -l XXXXX -pw XXXXX exit
plink.exe -ssh 192.168.X.XXX -l XXXXX -pw XXXXX /sbin/poweroff
exit
My question now is why the bat-script is not executing. It is working properly and it does the job when i test the script from PowerChute.
Thanks in advance for any help!
Best Regards,
Lucas Hökerberg
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:26 AM . Last Modified: 2024-03-05 10:50 PM
Lucas,
Write a second command file that has 1 line. The second file will call - execute the original file. Example in PowerChute enter the command file kickoff.cmd the file has 1 line in it "C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles\OringinalFileName"
You should also check out Kbase FA168226 http://www.apc.com/site/support/index.cfm/faq/
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-07-01 03:26 AM . Last Modified: 2024-03-05 10:50 PM
Lucas,
Write a second command file that has 1 line. The second file will call - execute the original file. Example in PowerChute enter the command file kickoff.cmd the file has 1 line in it "C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles\OringinalFileName"
You should also check out Kbase FA168226 http://www.apc.com/site/support/index.cfm/faq/
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.