New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


How to err the right way

Votes:

0

Your Vote:

Up

Down

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 by  orenshani7 (0) 1



Replies

Nobody has replied yet

Why not be the first?

Please log in or register to enter your reply.


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.