Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

PowerChute don't execute custom script

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.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • APC UPS, Critical Power, Cooling and Racks
  • APC UPS Data Center & Enterprise Solutions Forum
  • PowerChute don't execute custom script
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
BillP
Administrator BillP Administrator
5060
voidstar_apc
Janeway voidstar_apc
196
Erasmus_apc
Sisko Erasmus_apc
112
TheNotoriousKMP_apc
Sisko TheNotoriousKMP_apc
108
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to APC UPS Data Center & Enterprise Solutions Forum
Solved
Anonymous user
Not applicable

Posted: ‎2021-07-01 03:26 AM . Last Modified: ‎2024-03-05 10:50 PM

0 Likes
1
886
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

PowerChute don't execute custom script

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

Labels
  • Labels:
  • UPS Management Devices & PowerChute Software
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-07-01 03:26 AM . Last Modified: ‎2024-03-05 10:50 PM

0 Likes
0
887
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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/

See Answer In Context

Reply

Link copied. Please paste this link to share this article on your social media post.

Reply 1
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-07-01 03:26 AM . Last Modified: ‎2024-03-05 10:50 PM

0 Likes
0
888
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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/

Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of