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

Datacore monitoring over the Rest-Api

Votes:

0

Aloha,

i am trying to monitor our DataCore-Server over the Rest-Api because the oidlib / mib file which i build with this (http://rkconsultinggmbh.blogspot.de/2014/08/prtg-datacore-monitoring.html) tutorial arent working. When i try to add the sensor PRTG is just loading for ages and wont stop.

I am using the "Rest beta" sensor but i get the following errormessage:

Cannot load endpoint https://server/RestService/rest.svc/pools: expected status 200 OK but got 400 Bad Request.

If i am not wrong thats an authorization error cause it doesnt matter what kind of username or password i use, i always get the same message.

When i am using the PowerShell its workin quite fine. (https://docs.datacore.com/RESTSupport-WebHelp/using_windows_powershell_as_a_rest_client.htm)

api database rest

Created on Apr 26, 2018 7:06:25 AM



5 Replies

Votes:

0

Hi there,

The error message "400 Bad Request" indicates no authentication issue but that the call was invalid or consisted of bad parameters (headers for example). Could you post the current configuration of the REST Sensor? What Headers have you defined?

Best regards.

Created on Apr 26, 2018 1:37:02 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

I dont have any headers defined to be honest, i hoped that it is not needed because i am not sure what to enter there. As you might guessed already i am an bloody beginner when it comes to use PRTG / REST - Datacore-API. The documentation from Datacore is not 100% correct so i am fighting with Datacore and with PRTG at the same time. ;)

My settings are:

Sensor settings.

Created on Apr 27, 2018 6:47:53 AM



Votes:

0

Hi there,

As the linked PowerShell Example shows, you have to use certain headers for the request:

PS D:\> $headers.Add("ServerHost", "Server1")
PS D:> $headers.Add("Authorization", "Basic Administrator MyPassword!")

Please enable the "Eigene Header verwenden"-Option and try the following:

ServerHost: Server1
Authotization: Basic Administrator MyPassword!

Please change the values after the ":" accordingly (Server1..)

Does the call work afterwards?

Best regards.

Created on Apr 27, 2018 9:17:26 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

aaah great .. kinda easy if you know it ... its workin now ...

Now i am getting a lot of channels back.
I am using these syntax:

/RestService/rest.svc/object?id=6af98c60d2af430da8e70a63fd4742a8



As i dont understand the datacore-api-syntax completly i am asking myself how to get only one value specific value back instead of all at once.
For example: https://servername/RestService/rest.svc/object?id=6af98c60d2af430da8e70a63fd4742a8"&"type=Offline is not working.

Another problem which if have is a little bit more complicated to describe.

I've installed the DataCore Support software on an seperated server which is called "rest-server" (for example). When i try now to add an REST-Sensor on one of our DataCore-Server i am getting an error cause the url is wrong. PRTG is adding the devicename of the device where i add the REST-Sensor so the url looks like:

https://datacoreserver/RestService/rest.svc/object?id=00cb5b55d859405f967a262083861a25


Thats of course not workin cause the datacore-rest-software is running on an different server.

If i add the rest-server name to the field "Rest-Abfrage" the result is completly wrong:

https://rest-serverhttps://datacoreserver/RestService/rest.svc/object?id=6af98c60d2af430da8e70a63fd4742a8


So how do i solve the problem to tell the prtg sensor that he dont take the devicename where i add the sensor?

Created on Apr 27, 2018 10:51:52 AM

Last change on Apr 27, 2018 12:53:21 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi there,

To only get specific values you have to define a Rest-Custom Template as the "channelDiscovery" will create a channel for all found values. Within the template you can also define certain operations, logic and maths. To create this template please check the default templates on the Core Server under "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\rest\". Please also check the manual of the Rest Sensor:
https://www.paessler.com/manuals/prtg/rest_custom_sensor

To solve the second issue, you have to create a new device where you define the correct connection address in the device settings. Please note that the sensor always uses the entered IP/DNS in the device settings.

Best regards.

Created on Apr 27, 2018 12:56:09 PM by  Dariusz Gorka [Paessler Support]

Last change on Apr 27, 2018 12:56:18 PM by  Dariusz Gorka [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.