Brand Logo
Help
  • Get started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Help
  • Get started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
close
  • Community Home
  • Forums
    • By Topic
    • By Topic
      EcoStruxure Building
      • Field Devices Forum
      • SmartConnector Forum
      EcoStruxure Power & Grid
      • Gateways and Energy Servers
      • Metering & Power Quality
      APC UPS, Critical Power, Cooling and Racks
      • APC UPS Data Center & Enterprise Solutions Forum
      • APC UPS for Home and Office Forum
      EcoStruxure IT
      • EcoStruxure IT forum
      Remote Operations
      • EcoStruxure Geo SCADA Expert Forum
      • Remote Operations Forum
      Industrial Automation
      • Alliance System Integrators Forum
      • AVEVA Plant SCADA Forum
      • CPG Expert Forum DACH
      • EcoStruxure Automation Expert / IEC 61499 Forum
      • Fabrika ve Makina Otomasyonu Çözümleri
      • Harmony Control Customization Forum
      • Industrial Edge Computing Forum
      • Industry Automation and Control Forum
      • Korea Industrial Automation Forum
      • Machine Automation Forum
      • Modicon PAC Forum
      • PLC Club Indonesia
      Schneider Electric Wiser
      • Schneider Electric Wiser Forum
      Power Distribution IEC
      • Eldistribution & Fastighetsautomation
      • Elektrik Tasarım Dağıtım ve Uygulama Çözümleri
      • Paneelbouw & Energie Distributie
      • Power Distribution and Digital
      • Solutions for Motor Management
      • Specifiers Club ZA Forum
      • Електропроектанти България
      Power Distribution NEMA
      • Power Monitoring and Energy Automation NAM
      Power Distribution Software
      • EcoStruxure Power Design Forum
      • LayoutFAST User Group Forum
      Light and Room Control
      • SpaceLogic C-Bus Forum
      Solutions for your Business
      • Solutions for your Business Forum
      Support
      • Ask the Community
  • Knowledge Center
    • Building Automation Knowledge Base
    • Geo SCADA Knowledge Base
    • Industrial Automation How-to videos
    • Digital E-books
    • Success Stories Corner
  • Events & Webinars
    • All Events
    • Innovation Talks
    • Innovation Summit
    • Let's Exchange Series
    • Partner Success
    • Process Automation Talks
    • Technology Partners
  • Ideas
    • EcoStruxure Building
      • EcoStruxure Building Advisor Ideas
      Remote Operations
      • EcoStruxure Geo SCADA Expert Ideas
      • Remote Operations Devices Ideas
      Industrial Automation
      • Modicon Ideas & new features
  • Blogs
    • By Topic
    • By Topic
      EcoStruxure Power & Grid
      • Backstage Access Resources
      Remote Operations
      • Remote Operations Blog
      Industrial Automation
      • Industrie du Futur France
      • Industry 4.0 Blog
      Power Distribution NEMA
      • NEMA Power Foundations Blog
      Light and Room Control
      • KNX Blog
      Knowledge Center
      • Digital E-books
      • Geo SCADA Knowledge Base
      • Industrial Automation How-to videos
      • Success Stories Corner

How to run a command file on PCNS Virtual Appliance

APC UPS Data Center & Enterprise Solutions Forum

Schneider Electric support forum for our Data Center and Business Power UPS, UPS Accessories, Software, Services, and associated commercial products designed to share knowledge, installation, and configuration.

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
  • Communities
  • 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 Exchange 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
5022
voidstar_apc
Janeway voidstar_apc
195
Erasmus_apc
Sisko Erasmus_apc
111
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
nfricker_apc
Crewman nfricker_apc
Crewman

Posted: ‎2021-06-29 06:04 AM

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

Posted: ‎2021-06-29 06:04 AM

How to run a command file on PCNS Virtual Appliance

This was originally posted on APC forums on 1/27/2017


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
Share
  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:05 AM

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

Posted: ‎2021-06-29 06:05 AM

This reply was originally posted by Bill on APC forums on 3/6/2017


Hi

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

See Answer In Context

Reply
Share
Replies 13
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:04 AM

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

Posted: ‎2021-06-29 06:04 AM

This reply was originally posted by Bill on APC forums on 1/30/2017


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
Share
nfricker_apc
Crewman nfricker_apc
Crewman

Posted: ‎2021-06-29 06:04 AM

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

Posted: ‎2021-06-29 06:04 AM

This was originally posted on APC forums on 1/31/2017


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
Share
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:04 AM

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

Posted: ‎2021-06-29 06:04 AM

This reply was originally posted by Bill on APC forums on 1/31/2017


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
Share
voidstar_apc
Janeway voidstar_apc
Janeway

Posted: ‎2021-06-29 06:04 AM

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

Posted: ‎2021-06-29 06:04 AM

This was originally posted on APC forums on 1/31/2017


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

Reply
Share
nfricker_apc
Crewman nfricker_apc
Crewman

Posted: ‎2021-06-29 06:05 AM

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

Posted: ‎2021-06-29 06:05 AM

This was originally posted on APC forums on 1/31/2017


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
Share
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:05 AM

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

Posted: ‎2021-06-29 06:05 AM

This reply was originally posted by Bill on APC forums on 2/1/2017


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
Share
nfricker_apc
Crewman nfricker_apc
Crewman

Posted: ‎2021-06-29 06:05 AM

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

Posted: ‎2021-06-29 06:05 AM

This was originally posted on APC forums on 3/2/2017


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
Share
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:05 AM

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

Posted: ‎2021-06-29 06:05 AM

This reply was originally posted by Bill on APC forums on 3/3/2017


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
Share
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:05 AM

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

Posted: ‎2021-06-29 06:05 AM

This reply was originally posted by Bill on APC forums on 3/6/2017


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
Share
nfricker_apc
Crewman nfricker_apc
Crewman

Posted: ‎2021-06-29 06:05 AM

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

Posted: ‎2021-06-29 06:05 AM

This was originally posted on APC forums on 3/6/2017


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
Share
BillP
Administrator BillP Administrator
Administrator

Posted: ‎2021-06-29 06:05 AM

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

Posted: ‎2021-06-29 06:05 AM

This reply was originally posted by Bill on APC forums on 3/6/2017


Hi

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

Reply
Share
Jasonk
Jasonk
Cadet

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

In response to nfricker_apc
0 Likes
1
1642
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
Share

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
Share
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
1634
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
Share

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
Share
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

Additional options
You do not have permission to remove this product association.
 
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 forum after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the forum - 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 © 2023 Schneider Electric, Inc