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

How to run a command file on PCNS Virtual Appliance

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
  • How to run a command file on PCNS Virtual Appliance
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-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:04 AM

0 Likes
13
5411
  • 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-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:04 AM

How to run a command file on PCNS Virtual Appliance

My name is Norman, I have a Smart UPS  RT 10000XL. I Need to configure a Notification email to tell me qhen the UPS is on battery. The NMC does not support gmail account config (you cant configure port and SSL/TLS) I install a PCNS in a Windows Server 2008 and connect it to my UPS. Inside I configured it to shoutdown and run a command file I(the bach file send me an email) stored in my disk. I need to do the same with a PCNS Virtual Appliance, and I dont know how to execute a script, I don know the syntax.

I know that I cannot run a batch file on PCNS VA, what kind of file I need to run? what is the syntax? or the full path in PCNS VA ? where should I store the file?

Thanks for the help

 run command file

Attachments
Labels
  • Labels:
  • UPS Management Devices & PowerChute Software
  • Tags:
  • command
  • file
  • pcns
  • VirtualAppliance
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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:02 AM

0 Likes
0
5407
  • 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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:02 AM

Hi

Yes the path is /opt/APC/apc_on_batt.sh. 

See Answer In Context

Reply

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

Replies 13
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:04 AM

0 Likes
0
5407
  • 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-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:04 AM

Hi,

The PCNS Appliance is a Linux operating system so you will need a shell script. Here is a Google link that will help with learning how to write shell scripts. 

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=how+to+write+shell+scri...

This is a link to Schneider Electric FAQ FA158559 that will help with syntax and troubleshooting the script.

As for where to save / store the file that is up to you. I suggest saving / storing it in /opt/APC/PowerChute That way it will be easy for anyone else to find and associate with PowerChute. 

On 1/27/2017 5:46 PM, Norman said:

I have a Smart UPS  RT 10000XL. I Need to configure a Notification email to tell me qhen the UPS is on battery. The NMC does not support gmail account config (you cant configure port and SSL/TLS) I install a PCNS in a Windows Server 2008 and connect it to my UPS.

What is the exact model of the RT10000? You can find the exact model information on the bar code sticker on the back or front of the unit.

 

Also, what model is the network card that is installed in the RT10000 and what firmware version is running on the card? That information can be found by logging into the card. If the card is an older model the information will be found under Administration, General, About. If the card is a newer model the information is under About, Network. 

The newer model network cards with updated firmware do support SSL/TLS. Those cards are model AP9630, AP9631, AP9635, AP9637SUM

Attachments
Reply

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

Anonymous user
Not applicable

Posted: ‎2021-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:04 AM

0 Likes
0
5407
  • 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-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:04 AM

Bill thanks for the help, 

I could wrote a very simple Shell script that sends me an email alert:

#!/bin/sh

ssmtp -v norman.fricker@gmail.com < msg.txt

I login my PCNS Virtual Appliance using putty and execute the file and works ok. But when I try to execute that file using the web interface it says that he can´t find the file.

I´ve send you two print screens.

THX

Attachments
Reply

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

BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:04 AM

0 Likes
0
5407
  • 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-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:04 AM

Hi,

Close the web interface and then re-launch it. If the script is still not recognized close the interface, stop and restart the PCNS daemon. The commands to stop and restart are service PowerChute stop, service PowerChute start. Once the daemon has restarted re-launch the web interface and the script should be available. 

Reply

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

voidstar_apc
Janeway voidstar_apc
Janeway

Posted: ‎2021-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:03 AM

0 Likes
0
5407
  • 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-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:03 AM

Also make sure your script is executable (ie, chmod 755) so you can run it via "./apc.sh" rather than "sh apc.sh"

Reply

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

Anonymous user
Not applicable

Posted: ‎2021-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

0 Likes
0
5407
  • 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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

Bill, thanks  it worked ok. It recognized the file. From now on you are in my speed dial. Also thanks to voidstar

Last question, I ve Installed the VA, I need to install a PCNS in all my VM? or the Virtual Appliance does this for me? ( I know that in my host I have to set Guest Shutdown in VM Start up/shutdown) Do you have a Users manual with this configuration?

Thanks

Reply

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

BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

0 Likes
0
5407
  • 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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

Hi,

On 1/31/2017 4:58 PM, Norman said:

Last question, I ve Installed the VA, I need to install a PCNS in all my VM? or the Virtual Appliance does this for me?

The PCNS Appliance sends a signal to the ESXi host that it needs to power down. The host will first send a power down signal to the VMs wait for the VMs to power down and then it will power down. You must install VMware tools on each VMs and configure guest startup/shutdown (as you mentioned). We have FAQ FA159688 that discusses this set-up and the PowerCbute Network Shutdown VMware User's Guide. 

All of this is assuming the PCNS Appliance is configured to power down a single ESXi host. If The PCNS Appliance has been configured to communicate with the ESXi host through vCenter Server then you can configured the VM shut down through PCNS. You will find information on PCNS and vCenter Server in Application Note 180, and PowerChute Network Shutdown VMware User's Guide. 

Reply

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

Anonymous user
Not applicable

Posted: ‎2021-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

0 Likes
0
5407
  • 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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

Bill how are you?

I configured the Virtual Appliance, the web console recongnized my *.sh files, it recognized the full path of the files . I tested all the *.sh files in the console, one by one, all the files send an email just fine. But the web console don´t execute the files. Possibly I have written the wrong syntax, I tried /opt/APC/./apc_on_batt.sh,  /opt/APC/apc_on_batt.sh and  /opt/APC/sh apc_on_batt.sh (doesn't recognize the path) . Also make sure your script is executable (ie, chmod 755) and nothing. I have the same similar scripts in a PCNS on windows and the BAT files execute without problems.

in advance thanks for the help

Reply

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

BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

0 Likes
0
5407
  • 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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

Hi,

After placing the .sh in /opt/APC did you stop and restart the PowerChute daemon? As I mentioned on 31 Jan sometimes you need to log out of the web interface and then log back in and if that does not resolve the issue you need to restart the service. If that does not work send a screenshot of /opt/APC after running the command ls -la 

Reply

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

BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

0 Likes
0
5407
  • 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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

Hi,

Not sure what is going wrong for you. I created a test script on my PCNS Appliance and it work properly.

The script reads

#!/bin/sh

echo "This is a test script" >> /opt/APC/PowerChute/test.txt

data >> /opt/APC/PowerChute/time.txt

When the script is run by PCNS it creates 2 text files in /opt/APC/PowerChute a test.txt file and a time.txt file.

Reply

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

Anonymous user
Not applicable

Posted: ‎2021-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

0 Likes
2
5407
  • 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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:03 AM

Hi, ok, but what is the correct syntax in the full path "/opt/APC/apc_on_batt.sh" ? is this correct? somethig is not executinf the sh file in windows I dont have problems the bat files execute without problems.

In windows the full path " c:\APC\apc_on_batt.bat"

THANKS

Reply

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

BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:02 AM

0 Likes
0
5408
  • 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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:02 AM

Hi

Yes the path is /opt/APC/apc_on_batt.sh. 

Reply

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

Jasonk
Jasonk
Cadet

Posted: ‎2022-01-06 08:23 AM

In response to Anonymous user
0 Likes
1
4867
  • 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-01-06 08:23 AM

Were you able to get this working? I have what sounds like the same problem. I am running the virtual appliance v 4.4.1. When I console into the VM or SSH I am able to execute command files. However when PCNS tries to execute a command file via a triggered event, it doesn't work. FWIW Event Viewer on the web UI does show "Running Command File" when the event is triggered. I created a simple .sh file that executes 

 

#!/bin/sh
echo "This is a command file test." >> /test.txt

 

It works when I execute it via console or SSH but not when called by PCNS. I set the file to chmod 755 and placed it in the /opt/APC/PowerChute/user_files directory.

  • 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-01-06 01:10 PM . Last Modified: ‎2022-01-06 01:11 PM

In response to Jasonk
0 Likes
0
4859
  • 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-01-06 01:10 PM . Last Modified: ‎2022-01-06 01:11 PM

@Jasonk 

 

Create the script in /opt/APC/PowerChute/user_files with the extension.txt. Then run the command chmod 755 scriptName.txt to make the script executable. Finally test the script. 

 

I tested with PCNS 4.4.1 virtual appliance and below are the results. My test script is named script.txt

scriptTest.png

 

NOTE: I deleted your duplicate post.  

  • 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