New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

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

Free PRTG
Download >>

 

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

 

Top Tags


View all Tags


Can I create a sensor to monitor the number of paused or unknown sensors?

Votes:

0

Your Vote:

Up

Down

I had a situation recently where I had a large number of sensors enter a paused (or unknown) state and no one was informed of the situation. I was wondering if their was a way to create a sensor that would notify the PRTG Network Monitor system admin if then number of Down, Paused, unknown sensors reached a specific threshold.

Basically a warning when too many errors are detected.

paused prtg-network-monitor reporting senors

Created on Mar 18, 2010 2:53:22 PM by  T. N. Wheeler (0) 1



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

This article applies to PRTG Network Monitor 17 or later

Monitoring Sensors with a Specific Status via the REST Custom Sensor

In order to monitor the number of sensors in a specific status, for example, paused or unknown sensors count, add a REST Custom Sensor to your PRTG installation.

For this purpose, PRTG comes with a REST configuration template out of the box. This template retrieves a JSON file via the PRTG API containing the current number of all sensor states and parses it. Additionally, you can define sensor limits depending on your needs. Set up the sensor as indicated below.

Steps to Go

  • Add a REST Custom Sensor to your PRTG installation. Because we want to monitor PRTG itself, it makes sense to add the sensor to the Probe Device of the Local Probe (127.0.0.1).
  • In step 2 of the Add Sensor dialog, make sure to set the Request Protocol to the protocol you are using to access PRTG (HTTP or HTTPS).
  • Under Certificate Acceptance, select Accept all certificates.
  • Provide the following URL in the REST Query.
/api/table.json?id=1&content=sensorxref&noraw=1&filter_basetype=probe&columns=totalsens=textraw,upsens=textraw,downsens=textraw,partialdownsens=textraw,warnsens=textraw,pausedsens=textraw,unusualsens=textraw,undefinedsens=textraw,downacksens=textraw&username=<USERNAME>&passhash=<PASSHASH>

Note: You need to replace the <USERNAME> and <PASSHASH> in the URL above with your own credentials in order to authenticate, as per the example below. You can find the passhash under Setup | Account Settings | My Account | Passhash.

  • Under REST Configuration, select prtg-sensor-stats.template.
  • You can leave all other settings unchanged.
  • Click Continue to create the sensor.
  • Define limits for warnings and alarms in the sensor’s channel settings.

This sensor monitors now the number of sensors in the defined status and goes into warning or alarm status depending on the defined limits.

Created on Jun 21, 2018 11:02:19 AM by  Brandy Mauff [Paessler Support]

Last change on Jul 13, 2018 12:37:20 PM by  Sven Roggenhofer [Paessler Technical Support]



5 Replies

Votes:

0

Your Vote:

Up

Down

Create a Custom Sensor using the API

Using the API it is possible to create a custom sensor that provides you with this information.

But what if this sensor suddenly goes into a warning state?

Created on Mar 19, 2010 8:12:21 AM by  PRTGToolsFamily [prtgtoolsfamily.com] (12,745) 3 4



Votes:

2

Your Vote:

Up

Down

Alternative Approach to the "Best Answer"

I would suggest to use customized web page template for the PRTG webserver, that displays the number of sensors in paused/warning/OK etc. status, plus a HTTP content sensor, that monitors this value.

Step 1: Creating your own API function

  • Create a new textfile "getsensorsbystate.htm" in the \website\api folder of your PRTG installation. Note: As of PRTG Network Monitor 13.2.3, the folder is \webroot\api. See this article for details.
  • Edit the file in a text editor, paste the following code, and save the file:
[<#graph graphcontent="statusoverview" show="textraw">]

Step 2: Creating a HTTP Content sensor to monitor the value

Create a new HTTP Content sensor and enter the following URL:

http://yourprtgserver.ip/api/getsensorsbystate.htm?name=downsens&username=xyz&password=abc

This URL will display the total number of sensors which are in Error state (red), shown as a number between brackets [].

[8]

Please note: If there is no sensor in error state, the brackets will only contain a whitespace:

[ ]

The HTTP Content sensor reads this information and uses it as sensor values. Now your can use limits and triggers to send notifications.

The possible values for the "name" parameter are:

NameDescription
upsensUp sensors
downsensDown sensors
downacksensAcknowledged Down alarms
warnsensWarning sensors
unusualsensUnusual sensors
pausedsensPaused sensors
undefinedsensUnknown sensors
totalsensTotal sensors

You can only request one value per request/sensor. So in order to monitor unknown and error sensors you need to set up two HTTP Content sensors.

Please have a look at the API documentation for more information about using the HTTP API: How can I use the PRTG application programming interface (API)?

Created on Mar 19, 2010 12:13:40 PM by  Dirk Paessler [Founder Paessler AG] (10,848) 3 4

Last change on Jun 26, 2013 12:01:57 PM by  Gerald Schoch [Paessler Support]



Votes:

1

Your Vote:

Up

Down

New Custom Sensor Available

What you basically want to do, is present a counter like the Gadget does. This routine is now implemented in a new Custom Sensor: SensorCount.

It requires the following parameters to query your PRTG server:

-s=ip-address[:portnumber] -u=username -p=password

Using (a combination of) the following switches you can count the sensors of your choice.

-u    count up sensors
-d    count down sensors
-a    count acknowledged down sensors
-w    count warning sensors
-u    count unusual sensors
-p    count paused sensors
-k    count unknown sensors

So in order to monitor unknown and error sensors you simply supply the -k and the -d switch.

Created on Mar 24, 2010 7:10:33 PM by  PRTGToolsFamily [prtgtoolsfamily.com] (12,745) 3 4

Last change on Aug 10, 2016 11:43:28 AM by  Erhard Mikulik [Paessler Support]



Votes:

1

Your Vote:

Up

Down

This article applies to PRTG Network Monitor 13.2 or later

Monitoring the Number of Sensors in a Specific Status

In order to monitor the number of sensors in a specific status, for example, paused or unknown sensors count, add an HTTP XML/REST Value Sensor to your PRTG installation.

Set up the sensor as indicated below. This approach will retrieve an XML file via PRTG API containing the current number of all sensor states and parses it. Provide the XML node denoting the sensor status you are interested in and define sensor limits depending on your needs.

Steps to Go

1. Add an HTTP XML/REST Value sensor to your PRTG installation.

2. In the sensor settings, provide the following URL:

http://yourprtgserver/api/gettreenodestats.xml

Note: You'll need to add the username and passhash/password of your PRTG server to the URL in order to authenticate, as per the example below:

/api/gettreenodestats.xml?username=myusername&passhash=hash

For details, please refer to PRTG Manual: HTTP API

3. Enter the XML node denoting the sensor status you are interested in. In order to monitor the number of paused sensors, use the parameter pausedsens. See below for other possible values.

4. You can leave all other settings unchanged.

5. Click Continue to create the sensor.

6. Define limits for warnings and alarms in the sensor’s channel settings.

You can use the following parameters for the XML node:

XML NodeDescription
upsensUp sensors
downsensDown sensors
downacksensAcknowledged Down alarms
warnsensWarning sensors
unusualsensUnusual sensors
pausedsensPaused sensors
undefinedsensUnknown sensors
totalsensTotal sensors

This sensor monitors now the number of sensors in the defined status and goes into warning or alarm status depending on the defined limits.

Created on Jun 26, 2013 11:56:13 AM by  Gerald Schoch [Paessler Support]

Last change on Aug 14, 2018 8:48:46 AM by  Brandy Mauff [Paessler Support]



Accepted Answer

Votes:

0

Your Vote:

Up

Down

This article applies to PRTG Network Monitor 17 or later

Monitoring Sensors with a Specific Status via the REST Custom Sensor

In order to monitor the number of sensors in a specific status, for example, paused or unknown sensors count, add a REST Custom Sensor to your PRTG installation.

For this purpose, PRTG comes with a REST configuration template out of the box. This template retrieves a JSON file via the PRTG API containing the current number of all sensor states and parses it. Additionally, you can define sensor limits depending on your needs. Set up the sensor as indicated below.

Steps to Go

  • Add a REST Custom Sensor to your PRTG installation. Because we want to monitor PRTG itself, it makes sense to add the sensor to the Probe Device of the Local Probe (127.0.0.1).
  • In step 2 of the Add Sensor dialog, make sure to set the Request Protocol to the protocol you are using to access PRTG (HTTP or HTTPS).
  • Under Certificate Acceptance, select Accept all certificates.
  • Provide the following URL in the REST Query.
/api/table.json?id=1&content=sensorxref&noraw=1&filter_basetype=probe&columns=totalsens=textraw,upsens=textraw,downsens=textraw,partialdownsens=textraw,warnsens=textraw,pausedsens=textraw,unusualsens=textraw,undefinedsens=textraw,downacksens=textraw&username=<USERNAME>&passhash=<PASSHASH>

Note: You need to replace the <USERNAME> and <PASSHASH> in the URL above with your own credentials in order to authenticate, as per the example below. You can find the passhash under Setup | Account Settings | My Account | Passhash.

  • Under REST Configuration, select prtg-sensor-stats.template.
  • You can leave all other settings unchanged.
  • Click Continue to create the sensor.
  • Define limits for warnings and alarms in the sensor’s channel settings.

This sensor monitors now the number of sensors in the defined status and goes into warning or alarm status depending on the defined limits.

Created on Jun 21, 2018 11:02:19 AM by  Brandy Mauff [Paessler Support]

Last change on Jul 13, 2018 12:37:20 PM by  Sven Roggenhofer [Paessler Technical 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.