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 err the right way

Votes:

0

Hi All,

I am asking this after I tried to figure the answer out from the documentation but couldn't.

I am using python sensors, and as they are coded now, if something goes wrong, they print text based error messages and do not output valid JSON, which causes the sensor to display the "Structural error" message. I would like to fix that so that in case of an error, the sensor will return a valid JSON construct that will cause the banner in the sensor page to display a meaningful error message. Also, if possible, I would like the sensor to have a different status than if valid channel data was returned. For example, if I have a disk space sensor, I want the status of the sensor in case it couldn't get the disk space data, to be different than in case the data was fetched and shows that the disk is full.

Can you share the correct way to do that?

Many thanks,

Oren

error-messages json python-script-advanced-sensor

Created on Nov 5, 2019 11:11:09 AM



Replies

Nobody has replied yet


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.