New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.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


Creating a problem and using PRTG to access it

Votes:

0

Your Vote:

Up

Down

Hi. I have tried to look through all your articles re the REST API but my understanding is that this can only be used if I write an EXE to connect to PRTG to access monitoring information.

What I want is vice-versa. I'm a .NET developer and I would like to build a Web Service that returns something. To keep the example simple let's say I want to create a web service that returns a True or False depending on some business logic during the day. I would like PRTG to connect and communicates with this web service and if it receives a FALSE it will display that as an "ERROR". Hence, during the day the PRTG server would poll my application at different intervals and if it receives an error it will raise the alert.

The example above is quite trivial, but on more complex scenarios I could return a list of error codes or numbers or a percentage. The more flexible the better!

create-a-probe rest web-api

Created on Apr 6, 2015 6:42:48 PM by  bb (0) 1



4 Replies

Votes:

1

Your Vote:

Up

Down

Hi,

You can use the EXE/Script Advanced Sensor for XML results or the EXE/Script Sensor for single returned values, like true (1) or false(0) in your example.

So you can create this custom sensor which queries your webserver, form a valid XML or single result, and create thresholds in the Channel Settings of the sensor.

For more detailed information regarding custom sensors, please have a look at the API Documentation: Setup | PRTG API | Custom Sensors

Best regards

Created on Apr 8, 2015 12:03:28 PM by  Felix Saure [Paessler Support]



Votes:

0

Your Vote:

Up

Down

I had a quick look again at the documentation but it seems that I have to create an EXE, that writes a text file, which is read by PRTG for every web-service I want to use. I thought there is some more simpler way whereby I can place HTTP headers and verbs and sent a REST call to my webservice that would return a JSON. Is this option possible please?

Created on Apr 8, 2015 12:34:29 PM by  bb (0) 1



Votes:

4

Your Vote:

Up

Down

Hi,

why aren't you simply using a powershell script for example with invoke-webrequest to your webservice and check the output and format the result in XML for proper display in PRTG?

You can then run this powershell script via exe/xml sensor.

KR Lars

Created on Apr 8, 2015 1:51:46 PM by  Lars (1,150) 2 1



Votes:

0

Your Vote:

Up

Down

Ok.. thanks... will give that option a try as well...

Created on Apr 9, 2015 12:26:02 PM by  bb (0) 1



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.