What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How to setup notification on DingTalk

Votes:

0

Hi,

I want to receive a notification Via DingTalk for my PRTG. How can I do this? What steps are necessary?

Thank you

dingding dingtalk notification prtg

Created on Jan 31, 2023 1:11:14 AM

Last change on Jan 31, 2023 7:27:23 AM by  Chan Siau Hen [Paessler Technical Support]



1 Reply

Accepted Answer

Votes:

0

How to set up notifications on DingTalk for PRTG


In order for you to integrate with DingTalk, you can follow the steps below:

1. You can download DingTalk Desktop via https://www.dingtalk.com/en. After downloading, you can log in with your credentials.

2. On the Group, click on Group Settings (top right hand corner) > click on Group Assistant > click on Add Robot > click on Group Settings .

Group Assistant .

Add Robot

.

3. There will be a pop-up with the name ChatBot. Click on Add Robot > Select Custom (Custom message services via Webhook).

Custom

4. Click on Add. Add Robot

5. Put in the Group Name you preferred under Add to Group. Please select Security Settings that you preferred. Click on the I have read and accepted. For my example, I have put in the Custom Keyword of PRTG. Click Finished.

Add Robot

6. After that you will obtain the Webhook URL. Please keep this safe. You will require this later. Add Robot

7. Please do copy the script below (PowerShell script, please save as .ps1) and paste it to C:\Program Files (x86)\PRTG Network Monitor\notifications\exe in your PRTG core server. Please do ensure that your Powershell execution policy has been set properly, you can refer to https://kb.paessler.com/en/topic/71356-guide-for-powershell-based-custom-sensors.

Param(
    [string]$DingTalkWebHook,
    [string]$SiteName,
    [string]$Device,
    [string]$Status,
    [string]$Down,
    [string]$DateTime,
    [string]$Message,
    [string]$Probe,
    [string]$Group,
    [string]$SensorID,
    [string]$Name


)
$postDingTalkMessage = ConvertTo-Json -Depth 3 ([pscustomobject]@{
    actionCard=@{
        title = "PRTG";
        text =  "## $($sitename) `n`n"+
                "### Device Details- `n"+
                "- Probe- "+"$($Probe) "+
                "- Group- "+"$($Group) `n"+
                "- Name of Device- "+"$($Device) `n"+
                "### Sensor Details- `n"+
                "- Name Of Sensor- "+"$($Name) `n"+
                "- Status Of Sensor- "+"$($Status)$($Down) `n"+
                "- Event Date and Time- "+"$($DateTime) `n"+   
                "- Sensor Message-`n"+
                "> $($Message) `n";
				
        hideAvatar = "0";
    }
    msgtype = "actionCard";    
})

$postDingTalkMessage | Out-File utf8 -FilePath DingTalk.log
$postDingTalkMessage.text  | Out-File  utf8 -FilePath DingTalk.log -Append
Invoke-RestMethod -Method Post -ContentType 'application/json;charset=utf-8' -Uri $DingTalkWebHook -Body $postDingTalkMessage

8. Login to your PRTG web interface. Go to Setup > Account Settings > Notification Templates.

9. Press the + button to add Notification Template and select Execute Program.

10. For the executable file, select the PowerShell script name which you have saved in Step 7.

11. For parameters, please use the sample parameters below. Please do change the <insert URL here> with the Webhook URL which you have obtained in Step 6. Do fill in the Domain/Computer Name, Username, and password with the Administrative Rights.

-DingTalkWebHook '<insert URL here>' -SiteName '%sitename' -Device '%device' -Status '%status' -Down '%down' -DateTime '%datetime' -Message '%message'  -Probe '%probe' -Group '%group'  -Uptime '%uptime' -Downtime '%downtime' -Cumsince '%cumsince'  -PRTGHome '%home' -SensorID '%sensorid' -DeviceID '%deviceid' -Name '%name'

Execute Program

12. Then set up your Notification Triggers based on your own requirements. https://www.paessler.com/manuals/prtg/sensor_notifications_settings

Then you are all set.


Example of the notification I obtained from Ding Talk.

Alert in PRTG .

Example Notification

Created on Jan 31, 2023 7:08:00 AM

Last change on Jan 31, 2023 7:31:59 AM by  Chan Siau Hen [Paessler Technical Support]




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.