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

API: Sensor is Down. Using the API how can I find out which channel failed?

Votes:

0

Hi. I have a sensor of type "REST Custom BETA". It has multiple channels. For one of them I defined the "Value Lookup and Limits" to "Enable based on limits". Via the API I set the Upper Error Limit (limitmaxerror attribute) to a value lower than the current value. So it will generate an alert. Ok. In the UI the status of the sensor changes to Down. Message in the upper part of the sensor details window becomes red and it says "78 # (regulationTemperature) is above the error limit of 50 # in regulationTemperature." In the UI, all is good, I can tell why the sensor is failing. But how can I do the same using the API?

I have tried the standard call of getting the status of a sensor: /api/getobjectstatus.htm?id=sensorId&name=status I correctly get back status 5(Down). But still no clue as to why it is failing.

1 have retrieved all channels in the sensor via a call like: /api/table.json?noraw=1&content=channels&sortby=name&columns=name=textraw,minimum,maximum,condition,lastvalue,objid&id=sensorId I indeed get back the channels list but still no fields tells me which channes gived the error in the sensor.

I even tried with the sensortree call: /api/table.xml?content=sensortree This time fr the sensor I get a tag <statusmessage>78 # (regulationTemperature) is above the error limit of 50 # in regulationTemperature.</statusmessage> Still nothing else related to the cause of failure.

Pls advise on how I should retrieve which channel gives the error in the sensor and why. I would basically like to be able to say "My sensor fails because its channel id=4 has a bigger current value than the limitmaxerror one which has been set".

api channel prtg sensor

Created on Aug 5, 2020 2:25:05 PM



2 Replies

Votes:

0

Hello,

Thank you for your post.

You can get the last message of the sensor with the following API call:

/api/getobjectstatus.htm?id=objectid&name=message&show=text

You would just need to replace the "objectid" with the ID of your sensor.


Kind regards,
Sasa Ignjatovic, Tech Support Team

Created on Aug 6, 2020 12:12:31 PM by  Sasa Ignjatovic [Paessler Support]



Votes:

0

Ok, thanks for this info. So this is the only way to find out the reason my sensor is failing? By parsing a String text and hope I detect a channel name? My sensor has many channels. It does not seem a reliable solution to just parse a String representing the status message and look for another String representing the channel name. But ok, at least here is a way :o)

Created on Aug 7, 2020 4:23:01 AM




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.