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-06-29 06:04 AM . Last Modified: ‎2024-03-13 12:04 AM
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
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
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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:02 AM
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-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.
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
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
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
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-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.
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-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"
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
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
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-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.
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
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
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-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
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-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.
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
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
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-06-29 06:05 AM . Last Modified: ‎2024-03-13 12:02 AM
Hi
Yes the path is /opt/APC/apc_on_batt.sh.
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: ‎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.
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: ‎2022-01-06 01:10 PM . Last Modified: ‎2022-01-06 01:11 PM
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
NOTE: I deleted your duplicate post.
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.