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 - getting system status, number of sensors up / down / paused

Votes:

0

Hello,

I'm just getting started using the API and I've been able to get back some of the info I've been looking for, but I can't seem to get back system status information, like the number of sensors up / down / warning / paused. I figured this was what I was looking for in the documentation:

Getting PRTG System Status:

You can also get the PRTG system status such as the number of alarms or messages using the following API calls.

Live system status in the JavaScript Object Notation (JSON) format:

/api/getstatus.json?id=0

When I get the above call, however, all I get is the following:

<HTML><BODY class="no-content"><B class="no-content">Not Found</B></BODY></HTML>

I'm using the call exactly as written above, with id=0. Am I missing something to get this working? Is system status what I'm looking for to get up / down / warnings / etc?

Thanks!

api http-api prtg-api

Created on Dec 3, 2020 5:13:03 AM



7 Replies

Accepted Answer

Votes:

2

Hello,

Thank you for your message.

There is indeed a mistake in the manual, the API call related to system status "/api/getstatus.json?id=0" is not correct. Please, use the following call instead: /api/getstatus.htm?id=0

If you have further questions, let us know.

Kind regards.

Created on Dec 3, 2020 10:49:38 AM by  Florian Lesage [Paessler Support]

Last change on Dec 3, 2020 10:49:52 AM by  Florian Lesage [Paessler Support]



Votes:

0

Thank you so much, that worked and returned in JSON!

FYI, the server doesn't seem to be on the latest version. Version is "20.3.60.1623". If there are any relevant updates to the API in subsequent versions, I can try to talk to the administrator about updating.

A couple follow ups, if I could trouble you:

(1) New alarms seem to go straight to "Alarms" and then to "AckAlarms" after acknowledgment. How is "NewAlarms" meant to work?

(2) There doesn't seem to be a parameter like "down", just alarms. Am I missing something, or do I need to accomplish everything I need to do related to down sensors with alarms? That is probably fine, I just wanted to make sure before I write an implementation using only alarms.

Created on Dec 3, 2020 6:59:41 PM



Votes:

2

Hello,

Regarding the API, we indeed fixed some issues since version 20.3.60, you will find the information in our release notes: https://www.paessler.com/prtg/history/stable

(1) New alarms seem to go straight to "Alarms" and then to "AckAlarms" after acknowledgment. How is "NewAlarms" meant to work?

The object NewAlarms represents the number of sensors going in DOWN state which have not been reviewed yet in PRTG. The number will automatically be set to 0 when you click on the button New Alarms in the web interface, or when you acknowledge the corresponding sensors.


(2) There doesn't seem to be a parameter like "down", just alarms. Am I missing something, or do I need to accomplish everything I need to do related to down sensors with alarms? That is probably fine, I just wanted to make sure before I write an implementation using only alarms.

The object "Alarms" actually represents the number of sensors in DOWN state, as you can see in PRTG by comparing the values.

Regards.

Created on Dec 4, 2020 8:02:22 AM by  Florian Lesage [Paessler Support]

Last change on Dec 4, 2020 8:03:32 AM by  Florian Lesage [Paessler Support]



Votes:

0

Thanks very much. I've got all the API functionality I need working now. Still having one issue though - when sensors go down, they go right into Alarms, they skip NewAlarms. This happens even when there is no web interface open. Is there a setting on the server side that could cause this, or could it be a bug?

Thanks!

Created on Dec 5, 2020 11:27:17 PM



Votes:

2

Thank you for your feedback.

Can you please provide us the following information:

  • Version of PRTG
  • Number of Users
  • Is PRTG Desktop used ?

Please, also try to simulate an error on a sensor and then execute the API call when it goes into DOWN state. Does the NewAlarms object increased ? Did you get the red button New alerts in the web interface on PRTG, next to the other statuses?

Regards.

Created on Dec 7, 2020 10:01:02 AM by  Florian Lesage [Paessler Support]



Votes:

0

Certainly:

Version of PRTG - 20.4.64.1402

Number of users = 2. The administrator and a dedicated user for my API calls.

PRTG desktop is has not been used for these tests, nor is it typically used.

We've run this test with both a real error and a simulated error with the same result. When the sensor goes down a red "new alarms" button appears on the web interface next to the other statuses. Without clicking that button, when we do an API call, it shows up in the "Alarms" object, and "NewAlarms" object remains "0". We've also tested it without having the web interface open - it still goes straight to "Alarms". We've not been able to see any data in the "NewAlarms" object at all during any of our testing.

Perhaps its a bug? Let us know if we can do anything else to help.

Created on Dec 7, 2020 6:03:56 PM



Votes:

0

Thank you for the information.

Do you use the username as well as passhash of your account to execute the API call, if so this is normal that "NewAlarms" stays at 0. Here is a KB article regarding that matter: https://kb.paessler.com/en/topic/60253-getstatus-xml-not-delivering-correct-counts-for-newmessages-newalarms-when-using-passhash

Therefore, when using the API call with the credentials (username and passhash) to check the number of new alarms, DOWN sensors are automatically "acknowledged" by PRTG, the button New Alarms also disappeared in the web interface, as well as the New log entries button.

I'm afraid that there is nothing to do regarding that behavior.

Created on Dec 8, 2020 8:25:04 AM by  Florian Lesage [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.