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

Return codes does not effect prtg status

Votes:

0

Hello,

I wrote an custom sensor in C#. I want to create and alert, so I wrote the following statement:

Console.Write(Convert.ToInt64(3)+":" + failLocation);

This fairly works, except that the status bar in prtg is still green. Though the message I get is correct.

api c# custom-sensor

Created on Feb 5, 2014 10:06:17 AM



2 Replies

Votes:

0

I solved it by myself :)

The solution is to use Exit.Enviroment(3);

Created on Feb 5, 2014 3:14:02 PM



Votes:

0

Hello,

thank you very much for your KB-Post. It seems that your script returns the value:message for the sensor. To set the sensor into an error/warning state, please use the exit code of the script:

Value	Description
0	OK
1	WARNING
2	System Error (e.g. a network/socket error)
3	Protocol Error (e.g. web server returns a 404)
4	Content Error (e.g. a web page does not contain a required word)

best regards

Created on Feb 5, 2014 3:23:22 PM by  Torsten Lindner [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.