What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Sending JSON on sensor Error.

Votes:

0

Your Vote:

Up

Down

Hello. Please tell me how you can set up sending JSON when the sensor has an error? Is there such functionality in PRTG? I have sensor configured SMTP&IMAP Round Trip sensor, when an error appears on the sensor, need to send JSON.

alert json prtg

Created on Oct 21, 2021 11:42:04 AM by  7Yang7 (0) 1



3 Replies

Votes:

0

Your Vote:

Up

Down

Hello,

Thank you for your message.

To send a JSON when a sensor goes in down state, you can use the Execute Program action of the notification template and then pass the values you desire (could be placeholders) to the custom script.

You will find the available placeholders for notifications in this manual: https://www.paessler.com/manuals/prtg/list_of_placeholders_for_notifications

If you have questions, do not hesitate.

Regards.

Created on Oct 21, 2021 12:40:27 PM by  Florian Lesage [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Thank you for the link. I have a new problem, unable to forward placeholders to script Powershell :( Please tell me where can I find examples of Powershell scripts passing placeholders? If possible, tell me how placeholders are passed correctly.

Created on Oct 26, 2021 12:05:24 PM by  7Yang7 (0) 1



Votes:

0

Your Vote:

Up

Down

Hello,

Thank you for your feedback.

To use placeholders with the script, you have the possibility to use named parameters in PowerShell. To do so, in your script you must have the following placed at the beginning:

Param (
    $Param1 = "",
    $Param2 = ""
    ...
)

Then, in your script you can use these variables in your code.

In PRTG, you have two options to configure the placeholders to sent to the script, as illustrated below:

  • Add placeholders in the corresponding order (within quotation mark)
"%placeholder1" "%placeholder2"
  • Provide the name of the parameter and the argument you want to pass to it:
-Param1 "%placeholder1" -Param2 "%placeholder2"

Here is an article which shows how to use parameters in PowerShell: https://www.red-gate.com/simple-talk/sysadmin/powershell/how-to-use-parameters-in-powershell/

When configuring the notification template, you need to provide the placeholders in the Parameters field of the action "Execute Program".

Regards.

Created on Oct 27, 2021 6:12:46 AM by  Florian Lesage [Paessler Support]

Last change on Oct 27, 2021 6:12:59 AM by  Florian Lesage [Paessler Support]



Please log in or register to enter your reply.


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.