Loading ...

UPS Send Alert Using Web Request | UPS Management Devices & PowerChute Software

Home » Spaces » UPS Management Devices & PowerChute Software » discussion » General » UPS Send Alert Using Web Request

UPS Send Alert Using Web Request

Discussion in UPS Management Devices & PowerChute Software started by Zack , 4/11/2020 5:22 AM
Login to follow, share, and participate in this space.
Not a member?Join now
Announcement 

Please review Schneider Electric Knowledge Base articles for assistance with most technical support questions.  http://www.apc.com/us/en/faqs

Posted in: General

UPS Send Alert Using Web Request

Subscribe to RSS
  • ThePie

    Hello,

    In the Notifications section I see you can send SMTP mails when a alert is triggered. Is there a way to send a alert using a HTTP POST request or Web Request?

     

    Thanks.

  • wpasquil

    Hi,

    On 4/11/2020 1:22 AM, Zack said:

    In the Notifications section I see you can send SMTP mails when a alert is triggered. Is there a way to send a alert using a HTTP POST request or Web Request?

    There is no built in option however, PowerChute provides the option to run command file / script when an event occurs. You could write a command file / script that would send the notification you require.

    I ran a web search "command file to send http post" and found many entries that offer assistance with writing the command file / scripting. 

  • ThePie

    @Bill

    What command file types are supported? .ps1 files? 

    Also is there a way to "Test" the command?

  • wpasquil

    Hi,

    PowerChute will run a .cmd or .bat. You can trigger a .ps1 from within a .cmd using a syntax similar to C:\path-to-file\test-script.ps1

    I usually test by setting the command file to be run when a self-test is run. I then triggering a self-test from within PowerChute. Another option is to set the file to run for an on-battery event and cut AC to the UPS so it switches to battery output. 

  • ThePie

    Thanks for that info. Are there parameters or variables that can be used in the command files as well? Like $(EventName) to get the name of the event that was triggered?

    If you have multiple events enabled, you could used the same file to simple write out the event name. However, if something like that isn't supported then you would have to create a slightly different file for every single event you want a action for, which would not be fun.

  • wpasquil

    Hi,

    On 4/15/2020 3:40 PM, Zack said:

    Thanks for that info. Are there parameters or variables that can be used in the command files as well? Like $(EventName) to get the name of the event that was triggered?

    No. You could write a script that would send you the content of the most recent APCPBEAgent entry in the system application log. When an event occurs the PowerChute Agent logs and entry in the system application log. Go to Control Panel, Administrative Tools, Event Viewer, Application. You will see entries for APCPBEAgent. Each event will have a code and description. The codes are available in Schneider Electric FAQ FA228995  The Get-EventLog cmdlet for PowerShell should provide you with what you want. 

  • ThePie
    On 4/16/2020 3:28 PM, Bill said:

    Hi,

    On 4/15/2020 3:40 PM, Zack said:

    Thanks for that info. Are there parameters or variables that can be used in the command files as well? Like $(EventName) to get the name of the event that was triggered?

    No. You could write a script that would send you the content of the most recent APCPBEAgent entry in the system application log. When an event occurs the PowerChute Agent logs and entry in the system application log. Go to Control Panel, Administrative Tools, Event Viewer, Application. You will see entries for APCPBEAgent. Each event will have a code and description. The codes are available in Schneider Electric FAQ FA228995  The Get-EventLog cmdlet for PowerShell should provide you with what you want. 

    Bill,

    I don't see the self-test showing up in the PowerChute logs. Is running a Self-Test going to record a event? 

    I also do not see any events posted in the Event Viewer -> Windows Logs -> Application section.

    Also which one of the below events would be triggered by running a self-test?

    UPS On Battery
    Input Power Restored
    Runtime exceeded
    Runtime is sufficient
    Runtime remaining below threshold
    Runtime remaining above threshold
    Battery Discharged
    Battery Recharged
    Bypass due to hardware error or overload
    Maintenance Bypass
    Manual Bypass
    Bypass ended
    Communication lost while on Battery
    NMC cannot communicate with the UPS
    PowerChute cannot communicate with the NMC
    Communication established
    UPS Temperature Overheated
    UPS Temperature Normal Again
    UPS Overloaded
    UPS Overload Corrected

     

     

  • wpasquil

    Hi,

    I apologize. I thought you were running PowerChute Business Edition. You have PowerChute Network Shutdown installed. For PowerChute Network Shutdown, events that are log are saved in the EventLog.txt file. If installed to the default path on Windows system the file is in C:\Progarm Files\APC\PowerChute\group1 If installed to the default on a Linux system the file is in /opt/APC/PowerChute/group1 

    Take a look at Schneider Electric FAQ FA239561 The attached command file should help you. It is written to launch a messaging app but can be modified to suet your needs. 

    PowerChute Network Shutdown only logs events that may affect the OS. Event such as self-test are not logged in PCNS. The network card logs all events that occur on the UPS in its event log. However, the network card does not offer the ability to run scripts or command files. To receive notifications for the network card you would configure SMTP, SNMP, or syslog. 

    Again, sorry for the confusion. Your posts clearly show the network card and PCNS but for some reason I was thinking about PowerChute Business Edition. 

  • ThePie

    Hi Bill,

    Is one better than the other? PowerChute Network Shutdown vs PowerChute Business Edition. Will the events I'm looking for be logged in PCBE?

    I do not have the UPS connected via a cable. I am communicating to it from a VM over the network.

    Thanks.

  • wpasquil

    Hi,

    I recommend staying with PowerChute Network Shutdown for VMware. PowerChute Business Edition is designed to work with a single ESXi host. It is not designed to work with vCenter Server. 

    If you were to use PowerChute Business Edition you would need to first install VMware vMA that is close to end of life. Connect serial cable between the ESXi server and the UPS. Configure the vMA to utilize the serial port. Install Business Edition on the vMA and configure it to communicate with the UPS. 

    Documentation can be found at these links

    Business Edition Install Guide https://download.schneider-electric.com/files?p_Doc_Ref=SPD_PMAR-9BUL4B_EN

    Business Edition VMware User's Guide https://download.schneider-electric.com/files?p_Doc_Ref=SPD_PMAR-935CKU_EN

    Business Edition UPS User's Guide https://www.apc.com/us/en/download/document/SPD_PMAR-9BULAD_EN/

     

  • ThePie

    Ah alright, that's good info then. I will stick with Network Shutdown. I would like to make a software feature request.

    It is essential to test the command files (in the below screenshot) so there should be a way to trigger each event via software. I am not physical near the UPS, so unplugging it or doing any operations like that is not possible. Just add another column to the table that says "Test" and you can click the button and trigger the event.

  • ThePie

    bill , any updates on when we can expect to see a update to the software?

  • ThePie

    Trying to use the @Bill tagging option doesn't seem to provide the desired results...  How are you supposed to @ someone in this forum software...

  • wpasquil

    Hi,

    The next release of PowerChute Network Shutdown is slated for July 2020. 

Page 1 of 1 (14 items)
Choose your language:  
powered by Communifire
Version 7.0.7485.25369