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  nwheeler (0) 1



Best Answer

Accepted Answer

Votes:

2

Your Vote:

Up

Down

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
  • 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 [Paessler Support] (9,613) 3 3

Last change on Oct 5, 2011 9:23:27 AM by  Dirk Paessler [Paessler Support] (9,613) 3 3



3 Replies

Votes:

-2

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  Gerard Feijth (4,203) 3 2



Accepted Answer

Votes:

2

Your Vote:

Up

Down

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
  • 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 [Paessler Support] (9,613) 3 3

Last change on Oct 5, 2011 9:23:27 AM by  Dirk Paessler [Paessler Support] (9,613) 3 3



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  Gerard Feijth (4,203) 3 2



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.

PRTG
Network Monitor
Intuitive to Use.
Easy to manage.

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

Visit
www.paessler.com

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