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 can I get custom value from sensor?

Votes:

0

I need to get custom value from ping sensor (Packet loss) and push it through EXE notification. Can't find placeholder or something to do that.

notifications placeholders prtg

Created on Sep 3, 2015 9:16:45 AM



1 Reply

Votes:

0

Hello Gleb, thank you for your inquiry.

There are 3 distinct ways to achieve what you desire:

1. Change Sensor's primary channel

Set the Packet Loss channel as primary. Then use the %lastvalue placeholder in notifications. A notification can only contain the value of the primary channel.

2. Create a Sensor Factory Sensor

Create a Sensor Factory Sensor which reads the value of any channel of the original sensor and displays it as primary channel. Configure the notification on the sensor factory sensor and use the %lastvalue placeholder. Fore more details on using the Sensor Factory Sensor please refer to this article.

3. Customize your script/exe notification

Even thought there are no placeholders for additional channel values in notifications, the triggered notification can query the HTTP API and get the data for additional channels.
The API query would be similar to this:

/api/table.xml?content=values&output=xml&columns=datetime,value_&count=1&id=2106

This returns the last reading of all sensors for a single sensor. For a ping sensor the XML result looks like this:

<?xml version="1.0" encoding="UTF-8"?>
  <values totalcount="576" listend="0">
   <prtg-version>15.3.18.3616</prtg-version>
   <item>
    <datetime>01.09.2015 12:40:00 - 12:45:00</datetime>
    <datetime_raw>42248.4479166667</datetime_raw>
    <value channel="Ping Time" channelid="0">237 msec</value>
    <value_raw channel="Ping Time" channelid="0">237.2800</value_raw>
    <value channel="Minimum" channelid="1">237 msec</value>
    <value_raw channel="Minimum" channelid="1">237.0000</value_raw>
    <value channel="Maximum" channelid="2">240 msec</value>
    <value_raw channel="Maximum" channelid="2">240.0000</value_raw>
    <value channel="Packet Loss" channelid="3">0 %</value>
    <value_raw channel="Packet Loss" channelid="3">0.0000</value_raw>
    <value channel="Downtime" channelid="-4">0 %</value>
    <value_raw channel="Downtime" channelid="-4">0.0000</value_raw>
   </item>
  </values>

You can find more details about PRTG's API here:

Created on Sep 3, 2015 10:46:08 AM by  Luciano Lingnau [Paessler]




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.