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

HTTP XML/REST Value

Votes:

0

I am doing a rest query to a webservice and getting a string for a status value not a number.

In my case it is NewRelic, and I want to monitor the service health for one of my services.

The NewRelic API returns Green, Yellow, Red or Gray - depending on the service status within that particular application.

I can happily return this information to PRTG but I can't do anything with it.

I'm hoping there is a way to do a "reverse lookup" similar to how this can be done with an SNMP Custom Sensor so that I can get an Alarm when it is Red and a Warning when it is Yellow

custom-lookup rest string

Created on Mar 26, 2018 5:57:51 AM



1 Reply

Votes:

0

You'll need to come up with a PowerShell script that evaluates the result and puts it into a numerical form. Like this:

$Result = (Invoke-Webrequest <NewRelicURl>).Content

if($Result -eq "Green")
{ Write-Host "0:Application State OK"; exit 0; }
if($Result -eq "Yellow")
{ Write-Host "0:Application State WARNING"; exit 1; }
if($Result -eq "Red")
{ Write-Host "0:Application State DOWN"; exit 2; }
if($Result -eq "Gray")
{ Write-Host "0:Application State Unknown"; exit 1; }

Note that this is just a mockup and may need tinkering to suit your needs.


Kind regards,
Stephan Linke, Tech Support Team

Created on Mar 26, 2018 7:59:18 AM by  Stephan Linke [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.