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

Cannot Get Command File to Run after Runtime Below Threshold

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
  • Cannot Get Command File to Run after Runtime Below Threshold
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
Teken
Spock Teken
109
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to APC UPS Data Center & Enterprise Solutions Forum
cgsm
Crewman cgsm
Crewman

Posted: ‎2022-08-11 12:19 PM

0 Likes
9
1424
  • 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: ‎2022-08-11 12:19 PM

Cannot Get Command File to Run after Runtime Below Threshold

I have 2x identical UPSs running the "left" and "right" sides of my rack.  All equipment in the rack is powered by both PSUs.  The UPSs currently have 1h 50m of runtime and 35m of runtime just based on the current load distribution.

 

I am trying to configure a command file to run when my runtime is below a set value.  Is the threshold based on the sum of the runtimes from both UPSs?  Or is the threshold based on the lower of the two runtimes remaining?

 

I tested my command file by setting the threshold to a huge value (3 hours, 10,8000 seconds), pulling one the UPSs AC supply cables, and nothing...the command file would not run.  The command file does run if triggered manually.  I don't see anything in the event logs that provides any help.  What am I doing wrong here?

 

The end-goal is to have two command files:

  1. The first, to run a command file that shuts down some less important stuff (via UPS on battery event, say after 5 minutes of on-battery time).
  2. The second, to run a command file that shuts down highly important stuff (via the Runtime remaining below threshold, say 20 minutes remaining).

 

For reference:

  • Low Battery Duration is 20 minutes.  
  • Basic Low Battery Duration is 120 seconds.
  • Sleep Time is 0.0 hours.
  • PowerChute 4.4.1.
  • NMC3 AP9640

 

I would appreciate any help.

 

 

  • Tags:
  • english
Reply

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

  • All forum topics
  • Previous Topic
  • Next Topic
Replies 9
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2022-08-12 01:15 PM

0 Likes
8
1403
  • 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: ‎2022-08-12 01:15 PM

@cgsm 

 

I assume you have configured PCNS with redundant UPS? If so, they both would be required to fall below the threshold before the command file runs. 

  • Tags:
  • english
Reply

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

cgsm
Crewman cgsm
Crewman

Posted: ‎2022-08-15 09:42 AM

In response to BillP
0 Likes
7
1362
  • 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: ‎2022-08-15 09:42 AM

@BillP 

 

Yes, I have set up PCNS with redundant UPS.

 

If I understand you correctly, both UPSes would need to independently, not combined, reach the threshold I define for the command script to run.  Is this correct?

 

In this case, how do you suggest testing PCNS and the events/command scripts?  I was simply pulling the AC supply plug to the UPS to try and trip the event.  Based on your comment, the event will never get triggered.  Obviously, pulling the AC supply to both UPSes is not exactly ideal.  Thus, I ask, how do I test PCNS events to make sure the command scrips run?

 

Thanks

  • Tags:
  • english
Reply

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

BillP
Administrator BillP Administrator
Administrator

Posted: ‎2022-08-16 11:20 AM

In response to cgsm
0 Likes
6
1349
  • 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: ‎2022-08-16 11:20 AM

@cgsm 

 

If you want to test the UPS on battery event, you need to switch each UPS to run on battery. Just disable shutdown when UPS is on battery, so the shutdown is not triggered but leaves the command file enabled. Or, if you just want to test to verify PCNS will trigger the script, edit the pcnsconfig.ini file and add the command file to

 

event_MonitoringStarted_enableCommandFile = true
event_MonitoringStarted_commandFilePath = /opt/APC/PowerChute/user_files/myscript.sh

 

Once pcnsconfig.ini has been edited, stop the PowerChute service. The command is systemctl stop PowerChute. Wait 30 seconds and restart systemctl start PowerChute. The PowerChute service will start, monitoring will start, and the script will be triggered.

 

Once PowerChute has run the script it will add cmdfile.log to /opt/APC/PowerChute/group1

  • Tags:
  • english
Reply

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

cgsm
Crewman cgsm
Crewman

Posted: ‎2022-08-17 01:40 PM

In response to BillP
0 Likes
5
1325
  • 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: ‎2022-08-17 01:40 PM

@BillP 

 

Wow, is testing more convoluted than I expect.  I would have thought there was a "test command file" or "test event" functionality in the web GUI.  There should be!  Anyway, testing via the manner you provided does work even if it is a bit "hacky".

 

 

Back to my original question about "threshold".  Is the threshold of runtime remaining a sum of both UPSs?  Is the threshold the lesser of the two?  Is the threshold the greater of two?  The two, redundantly set up, UPSs could have unbalanced loads and therefore unequal runtimes remaining so I do not understand how to set the threshold, in seconds, for the event.

  • Tags:
  • english
Reply

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

BillP
Administrator BillP Administrator
Administrator

Posted: ‎2022-08-18 06:09 AM

In response to cgsm
0 Likes
4
1312
  • 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: ‎2022-08-18 06:09 AM

@cgsm 

 

When you configure "Runtime remaining below threshold" to trigger a shutdown, the shutdown process will begin when the UPS runtime falls below the set number. Example: threshold has been set at 900 seconds. The shutdown process will start when the runtime falls below 900 seconds (15 minutes).

When configuring with redundant UPS, both UPSs runtime would need to fall below the set threshold for the shutdown process to begin.

 

  • Tags:
  • english
Reply

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

cgsm
Crewman cgsm
Crewman

Posted: ‎2022-08-18 08:40 AM

In response to BillP
0 Likes
2
1309
  • 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: ‎2022-08-18 08:40 AM

@BillP 

 

Thanks for the help.  Let me see if I understand you correctly:

 

Normal, on AC running state: UPS 1 has 35min of runtime, UPS 2 has 1:15min of runtime.

Runtime reaming below threshold is set to 20min, 1200 seconds.

 

AC power is lost, batteries start draining.

AC power remains down, UPS 1 hits 19min of runtime remaining, UPS 2 hits 59min of runtime.  Event will not be triggered.

AC power remains down, UPS 1 dies, UPS 2 hits 40 min of runtime.  Event will not be triggered.

AC power remains down, UPS 2 hits 19min of runtime.  Event will be triggered.

 

Is my understanding correct?

  • Tags:
  • english
Reply

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

cgsm
Crewman cgsm
Crewman

Posted: ‎2022-08-24 09:49 AM

In response to BillP
0 Likes
0
1242
  • 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: ‎2022-08-24 09:49 AM

@BillP bump

  • Tags:
  • english
Reply

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

BillP
Administrator BillP Administrator
Administrator

Posted: ‎2022-08-24 02:53 PM . Last Modified: ‎2022-08-24 02:56 PM

In response to cgsm
0 Likes
1
1237
  • 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: ‎2022-08-24 02:53 PM . Last Modified: ‎2022-08-24 02:56 PM

 

Correct. 

 

If your UPSs have switched outlets, you can use the load shedding feature to trigger the PCNS shutdown and the outlet group/UPS shutdown. That way, the outlet group/UPS can be powered off. Doing that would save the battery from draining. When the second UPS takes over the entire load, it will drain faster, and with that UPS, you could set the load shedding threshold higher so the shutdown will be triggered sooner.

  

Example: UPS one has a runtime remaining threshold of 20 minutes. UPS two has a runtime remaining threshold of 60 minutes. UPS one powers down, UPS two reaches 59 minutes of runtime and triggers PCNS to shut the system/s down.

 

Outlet Group Config w-loadshedding.png

 

In the example above, I set the minimum return time to 15 minutes to allow time for the load to power on and off cleanly if an outage happens while the load is coming online.

You should set the outlet off delay on the longest running UPS to a significant enough time to allow PowerChute to shut everything down cleanly.

  • Tags:
  • english
Reply

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

cgsm
Crewman cgsm
Crewman

Posted: ‎2022-08-25 11:53 AM

In response to BillP
0 Likes
0
1223
  • 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: ‎2022-08-25 11:53 AM

@BillP 

 

I bit wordier and more advanced of an answer then I was looking for, but I think I understand what you are saying. 

 

I do not care about saving any battery runtime in case of a "power comes back on, stuff starts booting up, and power goes back our before battery is recharged".  I am going to run my batteries until near dead, taking into account shutting everything down cleanly with a command script.  This is why I am questioning at how the threshold works: I just want 20 minutes to shut everything down, and the 20 mins should be based upon both UPSs.

 

That being said, I plan on simply setting up the NMCs the same and setting the PCNS threshold to 20 minutes.  I just wish there was a way to test all this without having to pull the AC supply cords!

 

  • Tags:
  • english
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