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

Basic Api Submission

Votes:

0

Hello,

i am a programmer trying to send errors raised through log4net to our PRTG account. I have spent several hours searching your site and KB for some relevant info but without any success. What I need is is info about about how to push JSON or XML formatted error data to a PRTG REST api endpoint.

  1. Our company already has a PRTG account, where can I find or generate my API key?
  2. What is the data format of the submission?
  3. what is the URL endpoint that I should submit the request to?

It is likely that is what all your sensors are doing under the covers, but I haven't been able to locate any info about it. If you can provide me with this info, I can take care of the rest.

api json log4net prtg rest

Created on May 10, 2017 11:10:05 PM

Last change on May 11, 2017 5:42:30 AM by  Luciano Lingnau [Paessler]



1 Reply

Votes:

0

Hello there,
thank you for your KB-Post.

Did you check the sensor's documentation? There's a "how-to" section in the sensor's documentation:

But regarding your questions:

1. Our company already has a PRTG account, where can I find or generate my API key?
2. What is the data format of the submission?

The API key is a per-sensor key. You'll need to have a sensor created before you can push data to it. After the sensor's creation you will be able to review the API Key in the sensor's settings. As for the data format, it uses PRTG's XML/JSON custom-sensor API format. This format is documented under Setup > PRTG API in the web-interface. It's also described in this KB-Post:

You may also refer to:

Please keep in mind that the data pushed into a PRTG sensor should consist of one or more numerical values. You can also push text using the <text> tag, but this text will only be displayed in the interface, but won't be stored or produce alerts by itself.

3. what is the URL endpoint that I should submit the request to?

Your PRTG Server may have one or more so called "Probes" (Local or Remote). The URL will depend on the probe where it was deployed, it will be the address of the PRTG Probe. If the sensor is deployed on the local probe, it will be the same address as PRTG's web-interface, but on a different port. For instance a get request to Push data to a sensor on the local probe with token XYZ123 would look like this:

http: prtgserver.domain.tld:5050/XYZ123?content=<prtg><result><channel>MyChannel</channel><value>10</value></result><text>this%20is%20a%20message</text></prtg>

I've just googled log4net and it appears to be Apache related. You might be interested to know that you can also use the same API data format (XML/JSON) but instead of pushing the data to PRTG, publish it under a unique URL on your webserver (https://webserver/prtg_status.xml for instance) and then simply deploy an HTTP Data Advanced sensor in PRTG pointed at that URL.

PRTG will query the URL on every scanning interval and parse the XML/JSON as a sensor. This set-up may prove easier/faster to implement especially if you already have a webserver in place.


Best Regards,
Luciano Lingnau [Paessler Support]

Created on May 11, 2017 5:59:50 AM by  Luciano Lingnau [Paessler]

Last change on May 11, 2017 6:00:10 AM by  Luciano Lingnau [Paessler]




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.