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.
Configuration in Freshservice:
Step 1:
Head to the Admin panel, scroll down to IT Operations Management, and select Monitoring Tools.
If your account has more than one workspace, navigate to Admin > {Worskpace Name} > IT Operations Management> Monitoring Tools.
Step 2:
You are now on the Monitoring Tools list page. Select Add monitoring tool to add a new integration.
Step 3
You will see a list of pre-configured integrations, the gateway to custom integration using webhooks, and the option to use email as a channel for alerts. Select PRTG.
Step 4
Get the Endpoint URL and the Auth key for PRTG by following the integration setup.
Configuration in PRTG:
Prerequisites:
PRTG will send notifications to FS by executing a program when an alert is triggered.
- Create a text file with the following content and save it as shown in the example.
- 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] $commentsdevice, [string] $commentssensor, [string] $coverage, [string] $deviceid, [string] $lastcheck, [string] $downtime, [string] $group, [string] $_home, [string] $linkdevice, [string] $linksensor, [string] $lastdown, [string] $location, [string] $statesince, [string] $timezone, [string] $amsURL = "<Substitute your Freshservice AMS Integration URL>", [string] $amsAuthKey = "Substitute your Freshservice AMS Integration Auth-Token here>" ) #RestAPI headers $AuthHeader = @{ "Content-Type" = "application/json"; "Authorization" = $amsAuthKey } #payload construction $jsondata = @{ device = $device; sensor = $sensor; lastvalue = $lastvalue; message = $message; laststatus = $laststatus; objecttags = $objecttags; systemdatetime = $systemdatetime; commentsdevice = $commentsdevice; commentssensor = $commentssensor; coverage = $coverage; deviceid = $deviceid; lastcheck = $lastcheck; downtime = $downtime; group = $group; home = $_home; linkdevice = $linkdevice; linksensor = $linksensor; lastdown = $lastdown; location = $location; statesince = $statesince; timezone = $timezone; } #remove empty keys ($jsondata.GetEnumerator() | ? { -not $_.Value }) | % { $jsondata.Remove($_.Name) } #convert to json object $Body = ConvertTo-Json $jsondata # 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" -commentsdevice "%commentsdevice" -commentssensor "%commentssensor" -coverage "%coverage" -deviceid "%deviceid" -lastcheck "%lastcheck" -downtime "%downtime" -group "%group" -_home "%home" -linkdevice "%linkdevice" -linksensor "%linksensor" -lastdown "%lastdown" -location "%location" -statesince "%statesince" -timezone "%timezone"
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.