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

Sensorstate Sensor?

Votes:

0

Hi,

is it possible to konfigure a Sensor that reacts to every other Sensor? For example, when an error accours somewhere, that this Sensor also changes his state to error, or warning when there's a warning somewhere through the system?

I'd like to have this for notifications. We have a traffic light that should react to this. But with a normal trigger this is hardly possible, because it changes whenever there is a change of state, but ignores the state it had before that.

Any suggestions?

Greetings

custom-notification custom-sensor notifications prtg

Created on Jun 19, 2015 9:44:52 AM



Best Answer

Accepted Answer

Votes:

3

I wrote a skript in python, works fine with a trigger on status change and the API from PRTG.

Looks like this:

import urllib.request
import os
import json
import subprocess

url ='http://myserver/api/getstatus.htm?id=0&username=user&password=password'

response = urllib.request.urlopen(url)
data = json.loads(response.readall().decode('utf-8'))

print("Fehler: " + data['Alarms'])
print("Warnungen: " + data['WarnSens'])

args = ("C:\\USB_Ampel\\USBswitchCmd.exe")


Fehler = (data['Alarms'])
Warn = (data['WarnSens'])

if Fehler > '1' :
    args = args + "1 R"
elif Warn > '1' and Fehler == '':
    args = args + "1 Y"
elif Fehler == '' and Warn == '':
    args = args + "1 G"

os.system(args)

Created on Jun 22, 2015 12:51:40 PM

Last change on Jun 22, 2015 12:51:40 PM



6 Replies

Votes:

1

If this is a Cleware Trafficlight, please have a look at http://prtgtoolsfamily.com/us/products/notifiers/trafficlight

Created on Jun 19, 2015 12:37:44 PM



Votes:

0

Thanks, its working fine.

Is there a way to configure that the Warning light is turned off, if thers an error?

Created on Jun 19, 2015 1:51:19 PM



Votes:

0

If both the red and yellow licht are on, this indicates that your PRTG server reports both errors and warnings.

Created on Jun 19, 2015 2:21:23 PM



Votes:

0

I know, thats my point.

I don't want both lights to be on. I want only the red light to be on of there is an error. Regardless if there is a warning or not.

The notifications I want are:

  • Warning: yellow light
  • Error: red light
  • Error and Warning: red light, no yellow light
  • No Error/Warning: green light

Created on Jun 19, 2015 2:38:15 PM



Accepted Answer

Votes:

3

I wrote a skript in python, works fine with a trigger on status change and the API from PRTG.

Looks like this:

import urllib.request
import os
import json
import subprocess

url ='http://myserver/api/getstatus.htm?id=0&username=user&password=password'

response = urllib.request.urlopen(url)
data = json.loads(response.readall().decode('utf-8'))

print("Fehler: " + data['Alarms'])
print("Warnungen: " + data['WarnSens'])

args = ("C:\\USB_Ampel\\USBswitchCmd.exe")


Fehler = (data['Alarms'])
Warn = (data['WarnSens'])

if Fehler > '1' :
    args = args + "1 R"
elif Warn > '1' and Fehler == '':
    args = args + "1 Y"
elif Fehler == '' and Warn == '':
    args = args + "1 G"

os.system(args)

Created on Jun 22, 2015 12:51:40 PM

Last change on Jun 22, 2015 12:51:40 PM



Votes:

1

Hi Goebel,

I have added a setting to ignore warnings when there are down sensors. Effectively this will not lit the orange light when there are both warning and down sensors.

You can download the new version from http://prtgtoolsfamily.com/downloads/tools

Created on Jun 23, 2015 7:59:40 AM




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.