Loading ...
Home » Spaces » UPS Management Devices & PowerChute Software » discussion » General » How to run a command file on PCNS Virtual Appliance

How to run a command file on PCNS Virtual Appliance

Discussion in UPS Management Devices & PowerChute Software started by Norman , 1/27/2017 10:46 PM
Login to follow, share, and participate in this space.
Not a member?Join now
  • nfricker
    Norman
    Novice Novice
    Norman 1/27/2017 10:46 PM

    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
  • wpasquil
    Bill
    =S= Representative
    Bill 1/30/2017 3:31 PM (in response to Norman)

    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+script

    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
  • nfricker
    Norman
    Novice Novice
    Norman 1/31/2017 3:50 AM (in response to Bill)

    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
  • wpasquil
    Bill
    =S= Representative
    Bill 1/31/2017 1:44 PM (in response to Norman)

    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. 

  • voidstar
    voidstar
    Expert Expert
    voidstar 1/31/2017 9:09 PM (in response to Norman)

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

  • nfricker
    Norman
    Novice Novice
    Norman 1/31/2017 9:58 PM (in response to Bill)

    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

  • wpasquil
    Bill
    =S= Representative
    Bill 2/1/2017 1:19 PM (in response to Norman)

    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. 

  • nfricker
    Norman
    Novice Novice
    Norman 3/2/2017 11:51 PM (in response to Bill)

    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

  • wpasquil
    Bill
    =S= Representative
    Bill 3/3/2017 4:36 PM (in response to Norman)

    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 

  • nfricker
    Norman
    Novice Novice
    Norman 3/3/2017 8:50 PM (in response to Bill)

    I´m sending you the screenshot

    The syntax in PCNS, the full path, what is the correct one /opt/APC/apc_on_batt.sh ?

    Thx

    NWF

  • wpasquil
    Bill
    =S= Representative
    Bill 3/6/2017 4:19 PM (in response to Norman)

    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.

  • nfricker
    Norman
    Novice Novice
    Norman 3/6/2017 5:50 PM (in response to Bill)

    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

  • wpasquil
    Bill
    =S= Representative
    Bill 3/6/2017 8:56 PM (in response to Norman)

    Hi

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

  • Page 1 of 1 (13 items)
Choose your language:  
powered by Communifire
Version 5.2.6420.11692