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 to put Advanced Custom sensor in error state but still get values for channels which are active

Votes:

0

I've created an Advanced Custom sensor (EXEXML), and am trying to handle error conditions across multiple channels. What i want is for the sensor to go into error state if a single channel is in error state. I've achieved this by using the <LimitMinError> and <Value> tags. I've specified different error messages per channel using the <LimitErrorMsg> tag. This way i can see which channels are in alert state. The only problem here is I can't specify a sensor level error message stating all the channels which are down using the <Text> tag. The sensor level error message only specified the error message of the first channel which is in alert state. I've pasted a sample output. The sensor level message i get here is "0 # (Service 2) is below the error limit of 1 #. Service 2 down.", even though there are TWO services in error state, and I can see this if i go to the live data tab.

<prtg> <result> <Channel> Service 1</Channel> <Value>1</Value> <LimitMinError>1</LimitMinError> <LimitErrorMsg> Service 1 down.</LimitErrorMsg> <LimitMode>1</LimitMode> </result> <result> <Channel> Service 2</Channel> <Value>0</Value> <LimitMinError>1</LimitMinError> <LimitErrorMsg> Service 2 down.</LimitErrorMsg> <LimitMode>1</LimitMode> </result> <result> <Channel>Service 3</Channel> <Value>1</Value> <LimitMinError>1</LimitMinError> <LimitErrorMsg>Service 3 down.</LimitErrorMsg> <LimitMode>1</LimitMode> </result> <result> <Channel>Service 4</Channel> <Value>1</Value> <LimitMinError>1</LimitMinError> <LimitErrorMsg>Service 4 down.</LimitErrorMsg> <LimitMode>1</LimitMode> </result> <result> <Channel>Service 5</Channel> <Value>0</Value> <LimitMinError>1</LimitMinError> <LimitErrorMsg>Service 5 down.</LimitErrorMsg> <LimitMode>1</LimitMode> </result> <Text>The service(s) : The service(s) Service 2, Service 5 are down.</Text> </prtg>

advanced-script-sensor custom-script-exe error-handling exexml multiple-channel

Created on May 31, 2013 5:43:00 AM

Last change on Mar 19, 2015 3:49:51 PM by  Martina Wittmann [Paessler Support]



5 Replies

Votes:

0

If you still need data on the other channels, you should run this sensor twice, one instance for the alarming, and the other for having the measured values without interuptions.

Created on Jun 3, 2013 1:27:38 PM by  Dirk Paessler [Founder Paessler AG] (11,025) 3 6



Votes:

0

i'm not sure i understand. I'm running the sensor script at a 5 minute interval. Do you mean to say i should set up two sensors, one solely for the alarming, and the other for checking the actual values across the channels?

Created on Jun 3, 2013 10:52:09 PM



Votes:

0

The problem, that you will only receive the message for the first channel that is down can not be changed at the moment. But we can offer, that you can improve how the data is displayed. If we understand correctly, you send a 1 to the channel if the service is running and a 0 is the service is down. If you used format for your return, the channels qould show "On" and "Off" and the sensor would turn red if on of the services was "Off".

<prtg> <result> <Channel> Service 1</Channel> <Value>1</Value> <ValueLookup>prtg.standardlookups.offon.stateonok</ValueLookup> </result> <result> <Channel> Service 2</Channel> <Value>0</Value> <ValueLookup>prtg.standardlookups.offon.stateonok</ValueLookup> </result> <result> <Channel>Service 3</Channel> <Value>1</Value> <ValueLookup>prtg.standardlookups.offon.stateonok</ValueLookup> </result> <result> <Channel>Service 4</Channel> <Value>1</Value> <ValueLookup>prtg.standardlookups.offon.stateonok</ValueLookup> </result> <result> <Channel>Service 5</Channel> <Value>0</Value> <ValueLookup>prtg.standardlookups.offon.stateonok</ValueLookup> </result> <Text>The service(s) : The service(s) Service 2, Service 5 are down.</Text> </prtg>

This will only work if you add a new sensor. You can edit the channel settings of an existing channel and use the valuelookup "prtg.standardlookups.offon.stateonok" is you want the same behavior for existing sensors. (We recommend to either use lookups or values - not both mechanisms at the same time)

You can improve this by defining your own lookup values and the according states, if you want. A description how to do this can be found here.

Created on Jun 4, 2013 3:26:51 PM by  Johannes Herrmann [Paessler Support] (1,360) 2 2



Votes:

0

I've created my own lookup and marked 1 as error and 0 as OK, and it seems to be working. I get the text "Service running" or " service stopped" as it should be. But when i switched to using lookups, the meter display (something like a speedometer in the new version) doesnt appear any longer. Do lookups not support the meter display?

Created on Jun 7, 2013 2:47:12 AM



Votes:

0

We didn't find a solution, how to put different status on our gauges(that is the official name for the "meter display"). As of now, we've disabled the gauges for lookup channels, until we can find a good way how to visualize them. We can assure you, that the sensor and especially the warnings and notifications will work, even though the gauge is not visible for this channel.

Created on Jun 7, 2013 10:27:31 AM by  Johannes Herrmann [Paessler Support] (1,360) 2 2




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.