Alert management is currently in BETA


About this integration:

Monitor your whole IT infrastructure: LANs, WANs, servers, websites and applications to ensure that your computer systems are running smoothly using PRTG.

On integrating PRTG with Freshservice, multiple alert notifications sent from PRTG are aggregated into a single alert record for quick processing and resolution within Freshservice to help you h

Configuration in Freshservice:

  • Click on Admin > Alert Profiles > Create a New Alert Profile or open an existing Alert Profile.
  • Click on “Add Integration” to select the tool to integrate with
  • Select “PRTG” in the tool selection page. 
  • Get the Endpoint URL and the Authentication token for Site 24x7 by following the integration setup.


Configuration in PRTG:

Prerequisites:


PRTG will send notifications to FS by executing a program when an alert is triggered. 

  1. Create a text file with the following content and save it as shown in the example. 
  2. The value of <Integration Key> and <Auth Key> should be replaced with corresponding URL and Auth token from Freshservice 

        

Param(

  [string] $device,

  [string] $sensor,

  [string] $lastvalue,

  [string] $message,

  [string] $laststatus,

  [string] $objecttags,

  [string] $systemdatetime,

  [string] $host,

  [string]$amsURL = "<Integration URL>",

  [string]$amsAuthKey = "<Auth Key>"

)

#RestAPI headers

$AuthHeader = @{

  "Content-Type"  = "application/json";

  "Authorization" = "auth-key " + $amsAuthKey

}

#payload construction

$jsondata = @{
    device = $device;

    sensor = $sensor;

    lastvalue = $lastvalue;

    message = $message;

    laststatus = $laststatus;

    objecttags = $objecttags;

    systemdatetime = $systemdatetime;

    host = $host;

}

#remove empty keys

($jsondata.GetEnumerator() | ? { -not $_.Value }) | % { $jsondata.Remove($_.Name) }

#convert to json object

$Body = ConvertTo-Json $jsondata

Write-Host $Body

# Freshservice AMS restapi call

try {

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12

    Invoke-RestMethod -Method Post -Uri $amsURL -Headers $AuthHeader -Body $Body;

     exit 0;

} Catch {

    $ErrorMessage = $_.Exception.Message

    Write-Host "Error: " $ErrorMessage

}

Save the above file as follows “FreshserviceAMSIntegration.ps1” and place it in   \Notifications\EXE subfolder on your PRTG core server system in a cluster and copy your file to every cluster node.


Configure Notification Template:


Open the account settings of the user, select Setup > Account Settings  > Notification Templates from the main menu bar.


Hover over '+'  and select Add Notification Template from the menu to add a new notification template, or click the name of a notification template to edit it.



Fill the following template details:


Basic Settings

  • Template Name

  • Tags

  • Status (Should be set to Started)

  • Schedule (Should be set to None)

  • Notification Handling During Paused Status


Notification Summarization

  • Method - Set it as Always notify ASAP, never summarize

  • Set the Subject for Summarized Email or SNS Messages


Access Rights

Set access rights to manage this Notification Template


Execute Program

Select “Execute program” to enable  PRTG to send alert notifications  to Freshservice. 

  • Program file: Select the file “FreshserviceAMSIntegration.ps1” which we created from the list

  • Parameters - Use the below content

-device "%device" -sensor "%sensor" -lastvalue "%lastvalue" -message "%message" -laststatus "%laststatus" -objecttags "%objecttags" -systemdatetime "%systemdatetime" -host "%host"


  • Domain or Computer Name : Enter a Windows authority if you want to use a different security context for the program than the security context of the PRTG probe service.

  • Username: Enter the username for Windows access.

  • Password: Enter the password for Windows access.

  • Timeout: Enter a timeout in seconds. After this time has passed, PRTG stops the process if it has not terminated yet. Enter an integer value. 


After entering the details, click create to create a new Freshservice notification template


After you create notification templates in the system settings, you can select them on the Notification Triggers tab of probes, groups, devices, and sensors, as well as of the root group.


Notification Trigger


Notification triggers are the conditions that are evaluated for the probes, groups, devices, and sensors to trigger notifications accordingly

Notification triggers are of following types:

Regardless of trigger type, the steps to configure notification triggers are the same. Here are the steps:

  • Select the Notification Triggers tab of probes/groups/devices/sensors to create a notification trigger. This can be set at root level as well, so that all the resources under root will inherit it. 

  • Hover over '+' and add trigger (for eg: Add State Trigger) option from the menu to add a new state trigger, or click the Edit button next to a notification trigger to change it. Every notification trigger initiates one or more notifications.

  • Set your violation conditions

  • Select the notification template that you just created.

  • Save the state notification trigger.



When the trigger conditions match, alerts will be sent to Freshservice from PRTG.