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

Can I use a script to have a sensor in error state return an integer value?



I have had several remote systems where the Cisco Switches have somehow went back to factory settings recently so I lose SNMP communication to the Switch while the Router is still up at the site.

My thought process is to set up a Factory Sensor with logic operations to compare a sensor on the Router with a sensor on the Switch so I can set up a notification to be emailed only when the Router is online and the Switch is offline.

The issue I ran into is when the Switch is offline, its sensors go into the error state so the Factory Sensor goes into error as it can't do any logic at that point. The remote site is not always up so I don't want to be emailed when the whole site is offline.

My question is, is there a way I can run a custom sensor script to have a sensor in error status return a integer value or even show that the sensor is still up with an integer? I'm not familiar with the PRTG scripts but do understand basics of programming. If someone could help me out or point me in the right direction, that would be appreciated. Thanks.

error exexml script

Created on Dec 12, 2014 6:20:47 PM

3 Replies



Dear thunderdood

The factory sensor can have a custom status formula to override the default status of the sensor. Please find the status formula documentation in the sensor factory manual https://www.paessler.com/manuals/prtg/sensor_factory_sensor.htm, chapter "Define Sensor Status—status() Function"

Created on Dec 15, 2014 12:01:48 PM by  Arne Seifert [Paessler Support]



Thanks for the reply. I was trying that earlier and I found that the current version I'm running looks like it doesn't support the "status" operation. I currently have version 8. Are there any updates or patches that would allow this operation? I'm still trying to figure out a work around as I have limited resources.

Created on Dec 15, 2014 3:55:44 PM



Dear thunderdood

The status() function was introduced with PRTG 9. To obtain this feature, please update to the current version (version 14.)

I am sorry, there are no patches to include features of a later version into a previous one.

Created on Dec 16, 2014 10:59:00 AM by  Arne Seifert [Paessler Support]

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.