Progress WhatsUp Gold

Send notifications to Squadcast from Progress WhatsUp Gold

This document will help you integrate Progress WhatsUp Gold with Squadcast.

Progress WhatsUp Gold provides complete visibility into the status and performance of applications, network devices and servers in the cloud or on-premises with its network availability and performance monitoring capabilities. Route detailed events from WhatsUp Gold to the right users in Squadcast.

How to integrate WhatsUp Gold with Squadcast

In Squadcast: Using WhatsUp Gold as an Alert Source

(1) On the Sidebar, click on Services

(2) Select an existing Service or Add service

(3) Click the corresponding Alert Sources

(4) Search for Progress WhatsUp Gold from the Alert Source drop down menu and copy the webhook

In WhatsUp Gold: Configuring the integration with Squadcast

(1) From the Home Page, select Settings

(2) Select the Actions & Alerts and then, select Actions and Policies

(3a) Under Action Library, click on the + icon to add an Action

(3b) Select Log to Text File

(3c) Fill in the necessary details as below:

  • Name: Trigger Log
  • Description: (Optional) Log to Text File Action
  • Log File: C:\Squadcast\Logs\action_%Device.HostName.log
  • Log file write mode: Select the option Overwrite
  • Log Message: Please paste the following content in the placeholder:
    alert_status::open;;
    device_active_monitor_down_names::%Device.ActiveMonitorDownNames;;
    device_active_monitor_up_names::%Device.ActiveMonitorUpNames;;
    device_address::%Device.Address;;
    device_database_id::%Device.DatabaseID;;
    device_display_name::%Device.DisplayName;;
    device_host_name::%Device.HostName;;
    device_notes::%Device.Notes;;
    device_role::%Device.Role;;
    device_role_guid::%Device.RoleGUID;;
    device_snmp_oid::%Device.SNMPOid;;
    device_state::%Device.State;;
    device_status::%Device.Status;;
    device_type::%Device.Type;;
    system_date::%System.Date;;
    system_display_names_down_devices::%System.DisplayNamesDownDevices;;
    system_display_names_down_monitors::%System.DisplayNamesDownMonitors;;
    system_display_names_up_devices::%System.DisplayNamesUpDevices;;
    system_display_names_up_monitors::%System.DisplayNamesUpMonitors;;
    system_install_dir::%System.InstallDir;;
    system_numberof_down_devices::%System.NumberofDownDevices;;
    system_number_of_down_monitors::%System.NumberOfDownMonitors;;
    system_numberof_up_devices::%System.NumberofUpDevices;;
    system_number_of_up_monitors::%System.NumberOfUpMonitors;;
    system_time::%System.Time;;
    passive_monitor_display_name::%PassiveMonitor.DisplayName;;
    passive_monitor_logged_text::%PassiveMonitor.LoggedText;;
    active_monitor_argument::%ActiveMonitor.Argument;;
    active_monitor_comment::%ActiveMonitor.Comment;;
    active_monitor_name::%ActiveMonitor.Name;;
    active_monitor_network_interface_address::%ActiveMonitor.NetworkInterfaceAddress;;
    active_monitor_payload::%ActiveMonitor.Payload;;
    active_monitor_state::%ActiveMonitor.State;;
    
  • Click on OK

(4a) Once again, under Action Library, click on the + icon to add another Action

(4b) Select Log to Text File

(4b) Fill in the necessary details as below:

  • Name: Resolve Log
  • Description: (Optional) Log to Text File Action
  • Log File: C:\Squadcast\Logs\action_%Device.HostName.log
  • Log file write mode: Select the option Overwrite
  • Log Message: Please paste the following content in the placeholder:
    alert_status::closed;;
    device_active_monitor_down_names::%Device.ActiveMonitorDownNames;;
    device_active_monitor_up_names::%Device.ActiveMonitorUpNames;;
    device_address::%Device.Address;;
    device_database_id::%Device.DatabaseID;;
    device_display_name::%Device.DisplayName;;
    device_host_name::%Device.HostName;;
    device_notes::%Device.Notes;;
    device_role::%Device.Role;;
    device_role_guid::%Device.RoleGUID;;
    device_snmp_oid::%Device.SNMPOid;;
    device_state::%Device.State;;
    device_status::%Device.Status;;
    device_type::%Device.Type;;
    system_date::%System.Date;;
    system_display_names_down_devices::%System.DisplayNamesDownDevices;;
    system_display_names_down_monitors::%System.DisplayNamesDownMonitors;;
    system_display_names_up_devices::%System.DisplayNamesUpDevices;;
    system_display_names_up_monitors::%System.DisplayNamesUpMonitors;;
    system_install_dir::%System.InstallDir;;
    system_numberof_down_devices::%System.NumberofDownDevices;;
    system_number_of_down_monitors::%System.NumberOfDownMonitors;;
    system_numberof_up_devices::%System.NumberofUpDevices;;
    system_number_of_up_monitors::%System.NumberOfUpMonitors;;
    system_time::%System.Time;;
    passive_monitor_display_name::%PassiveMonitor.DisplayName;;
    passive_monitor_logged_text::%PassiveMonitor.LoggedText;;
    active_monitor_argument::%ActiveMonitor.Argument;;
    active_monitor_comment::%ActiveMonitor.Comment;;
    active_monitor_name::%ActiveMonitor.Name;;
    active_monitor_network_interface_address::%ActiveMonitor.NetworkInterfaceAddress;;
    active_monitor_payload::%ActiveMonitor.Payload;;
    active_monitor_state::%ActiveMonitor.State;;
    
  • Click on OK

(5a) Now, under Action Library, click on the + icon to add another Action

(5b) Select Active Script Action

(5c) Fill in the necessary details as below:

  • Name: Squadcast Script
  • Description: (Optional) Active script action
  • Timeout (seconds): 10
  • Script type: JScript
  • Script text: Please paste the following content in the placeholder:
    var SQUADCAST_URL = <Enter the copied Webhook from Squadcast here>;
    var logFileLocation = "C:\\Squadcast\\Logs\\action_%Device.HostName.log";
    var fso  = new ActiveXObject("Scripting.FileSystemObject");
    var lf = fso.OpenTextFile(logFileLocation, 1, true);
    var attrs = lf.ReadAll().split(";;\r\n");
    lf.Close();
    var data = {};
    for (i in attrs) {
      var attr = attrs[i];
      var key = attr.split("::", 1)
      var val = attr.replace(/[a-zA-Z_]*::/, "").replace(/;;$/, "");
      data[key] = val;
    }
    // formURLEncodedBody is used to form the URL encoded body for the passed JS Object.
    function formURLEncodedBody(obj) {		
      var body = [];
      for (i in obj) {
          body.push(escape(i) + "=" + escape(obj[i]));
      }
      return body.join("&");
    }
    // sendToSquadcast is used to send the alert body to Squadcast
    function sendToSquadcast(squadcastURL, body) {
      var strResult = "";
      var returnCode = 0;
      try {
          var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
          WinHttpReq.Open("POST", squadcastURL, false);
          WinHttpReq.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded");
          WinHttpReq.SetRequestHeader("User-Agent", "Squadcast JScript/1.0 (compatible; Win32; WinHttp.WinHttpRequest.5)");
          WinHttpReq.Send(body);
          strResult = WinHttpReq.ResponseText;
          strResult = "Script executed successfully! : " + strResult;
      } catch (objError) {
          strResult += "WinHTTP returned error: " + (objError.number & 0xFFFF).toString() + "\n\n";
          strResult += objError.description;
          strResult = "Script failed: " + strResult.toString();
      }
      if (this.Context) {
          Context.SetResult(returnCode, strResult);
      } else {
          WScript.Echo("WARNING: The Script is not executed with the WhatsUp Gold Context. Please check your installation.");
          WScript.Echo("ReturnCode: " + returnCode.toString());
          WScript.Echo("Result: ", strResult);
      }
    }
    var reqBody = formURLEncodedBody(data);
    sendToSquadcast(SQUADCAST_URL, reqBody);
    
  • Click on OK

(6a) Next, under Actions & Policies, click on the + icon to add a Policy for Trigger

(6b) In Policy Name, enter a suitable name like Squadcast Action Policy, and click on Add

(6c) Here:

  • Select an action from the Action Library: Select Trigger Log from the dropdown
  • Execute the action on the following state change: Select Down from the dropdown
  • Click on OK

(6d) Click on the + icon to add a Policy for calling the Action Script during Trigger

(6e) Here:

  • Select an action from the Action Library: Select Squadcast script from the dropdown
  • Execute the action on the following state change: Select Down from the dropdown
  • Click on OK

(6f) Click on the + icon to add a Policy for Resolve

(6g) Here:

  • Select an action from the Action Library: Select Resolve Log from the dropdown
  • Execute the action on the following state change: Select Up from the dropdown
  • Only if the following state was reached: You can select whatever is most applicable to your requirement, here we have selected 0 minutes - (Down)
  • Click on OK

(6h) Click on the + icon to add another Policy for calling the Action Script during Resolve

(6i) Here:

  • Select an action from the Action Library: Select Squadcast script from the dropdown
  • Execute the action on the following state change: Select Up from the dropdown Only if the following state was reached: You can select whatever is most applicable to your requirement, here we have selected 0 minutes - (Down)
  • Click on OK

(6j) Finally, click on OK to save all the Action Policies added previously

(7) From the navigation bar on the top, now select My Network

(8) Then, choose the device(s) for which you want to associate this Squadcast integration with and right click on the Device Name. Here, select Device Properties

(9) Select Actions from the options in the left sidebar, then select Actions and Policies on the right

(10) Now, select Squadcast Action Policy from the dropdown

Once that is selected, you will be able to see the previously configured and currently applied list of Actions and Action Policies to the Device.

Repeat the same for all the Devices that you wish to receive alerts for its downtime in Squadcast.

That is it, you are good to go! Everytime there is an alert generated in WhatsUp Gold, an incident for the same will be created in Squadcast!