I'd really like to use the free push notification service ntfy with PRTG, is there some easy way to do this? https://ntfy.sh/

Also, I'd like to monitor my ntfy instance to make sure it's up and running, is that possible?


Article Comments

Using the script below, you can use the script notification with the following parameters to send a notification through the ntfy service.

Parameters

NTFY_ENDPOINT "[%sitename]" "%device" "%name" "%status" "%down" "(%message)"

Script (Powershell)

$ntfy_url = $args[0]

$site = $args[1]
$device = $args[2]
$name = $args[3]
$status = $args[4]
$down = $args[5]
$message = $args[6]

$pushMessage = @"
Site: $site
Device: $device
Name: $name
Status: $status
Down: $down
Message: $message
"@

Invoke-WebRequest -Uri $ntfy_url -Method POST -Body $pushMessage

If you are hosting your own ntfy server, you can also make sure it's up and running by setting up a REST Custom v2 sensor. The following settings work to show if it's up or down:

Request URL: NTFY_URL/v1/health

Channel #1 JSONPath/XPath: $.healthy

Channel #1 Value Type: Status (string)

Channel #1 Strings mapped to the 'Up' status: true


Jan, 2024 - Permalink