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

Sensor to monitor AJA kipro

Votes:

0

I am trying to monitor the available storage on an AJA Ki pro and this is what i can do

by using this http request: http://device_ip/values?eParamID_CurrentMediaAvailable

i get this in response: var param_val = { name:"Media Available", value:"73" };

This works in a web browser.

Any way i can use that response i am getting and pull the number from the value and setup a channel?

http http-content-sensor xml-rest

Created on Feb 18, 2015 10:56:08 PM



3 Replies

Votes:

0

Hi,
are you getting back pure JSON e.g.

{ name:"Media Available", value:"73" }

or are you getting back the full line

var param_val = { name:"Media Available", value:"73" };

?

Created on Feb 23, 2015 9:18:03 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

I am getting back the full line. I have been trying different sensor and getting error messages with "The format of the URI could not be determined."

Was able to get the data in a different format:

[ {value:"78", text:"78", selected: "true"} ];

Not sure if that's any easier. Thanks for your help!

Created on Feb 23, 2015 12:14:08 PM



Votes:

0

The second data format would be quite easier to handle. But as it is still not native JSON, a custom sensor might be necessary. Please check the below code, which should work out pf the box (only with given example):

param(
    [string]$url="http://127.0.0.1"
)
$page = $(Invoke-WebRequest "https://10.0.2.140/public/test_cust.htm")
$JSON = $page.Trim(";", " ") | ConvertFrom-Json
Write-Host ("{0}:Value" -f $JSON.value)
Exit 0

The script takes the parameter -url "YOUR_URL" which can be provided in the section Parameters on tab Settings of the EXE/Script Sensor.
Above Script is written in Powershell, the script file has to be named accordingly, e.g. SCRIPT.ps1 and the execution policy of the powershell has to vbe set to unrestricted or remote-signed.

Created on Feb 23, 2015 3:49:21 PM by  Konstantin Wolff [Paessler Support]

Last change on Feb 23, 2015 3:50:52 PM by  Konstantin Wolff [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.