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

JSON Return value not found

Votes:

0

Hi, I am trying to make a "HTTP XML/REST Value" to retrieve a JSON document and select a value from the returned document. For some reason it keeps on coming back with the message "Node /cb/ops/GetsRaw/count not found in XML result.".

When I copy & paste the URL used in the sensor in my browser I get the response I am expected. A JSON document.

When trying to retrieve the first value, just for starters, I get the error message. The start of the JSON document is below. I did not paste the complete document as it would make the post very long.

{
"cb": {"ops": {"GetsRaw": {"count":8126574,"sum":127941537366800,"min":0,"max":18900854700,"mean":1.574360085403763e+07,"p25":1003675,"p50":4005400,"p75":10996700,"p90":29114940,"p99":184729708}, "Incr": {"count":9199,"sum":80663536000,"min":0,"max":2473108300,"mean":8.768728774866832e+06,"p25":987300,"p50":1004700,"p75":5997200,"p90":232311530,"p99":852207675}, "Write(raw)": {"count":12205,"sum":90264111600,"min":0,"max":1643077900,"mean":7.395666661204425e+06,"p25":993700,"p50":1993500,"p75":3005100,"p90":4999940,"p99":157136311}, "Write(raw|addonly)": {"count":132,"sum":24322355200,"min":0,"max":1006045200,"mean":1.8426026666666666e+08,"p25":2260900,"p50":17502800,"p75":352517375,"p90":591725120,"p99":993174671}, "casNext": {"count":3304059,"sum":14070360215100,"min":0,"max":18909846000,"mean":4.258507555434089e+06,"p25":975200,"p50":1003500,"p75":6999825,"p90":36002640,"p99":216140193}}, "pools": {"10.80.136.214:11210": {"count":4051212,"sum":7761584200,"min":0,"max":112999500,"mean":1915.867202210104,"p25":0,"p50":0,"p75":0,"p90":0,"p99":0}, "10.80.136.215:11210": {"count":4356194,"sum":6524166800,"min":0,"max":94003700,"mean":1497.6759069958775,"p25":0,"p50":0,"p75":0,"p90":0,"p99":0}, "10.80.136.226:11210": {"count":3044769,"sum":5502410500,"min":0,"max":88004400,"mean":1807.168458428209,"p25":0,"p50":0,"p75":0,"p90":0,"p99":0}}},
"cmdline": ["C:\\Program Files (x86)\\Couchbase\\sync_gateway.exe","C:\\Program Files (x86)\\Couchbase\\config.json"],
"goroutine_stats": 

When I paste the return in a JSON validation tool it returns with the message it is valid. So I am assuming the brackets are all in the correct place.

When I manually create a new document and type all the values myself and run it I do get the response I need.

{
	"cb": {
		"ops": {
			"GetsRaw": {
				"count":8105315,
				"sum":127662848204900
			}
		}
	}
}

So, where am I taking a wrong turn? Or is the original JSON document incorrect?

json not-found value

Created on Dec 6, 2017 1:38:25 PM



10 Replies

Votes:

0

Hi there,

I tried to reproduce this issue on our end, unfortunately, we get the correct value without any issue. I just created a ".json", pasted your second code (correctly formatted json) and created the sensor. The sensor then gets the value "8105315" correctly.

Please activate the "Write sensor result to disk (Filename: "Result of Sensor [ID].txt")"-Option and post the results, they most likely help us further.

Best regards.

Created on Dec 7, 2017 9:41:48 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi, sorry for the late reply.

The "Result of sensor" file gives me this

[Probe]
12/18/2017 4:15:33 PM
Microsoft Windows Server 2012 R2 Standard 6.2.9200.0 en-US
[Sensor]
XMLValue 16.1.2
Run by PRTG probe.
[Parameters]
-u=http://amsapp124.pvhcorp.com:4985/_expvar -n=cb/ops/GetsRaw/count -t=60 -ssl3 -debug=D:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)\Result of Sensor 15900.txt 
[Trace]
Sending request
Reply received
[Error]
Node cb/ops/GetsRaw/count not found in xml result.
Exitcode custom_error}}}

And the .Data file provides me with this

{{{
Data['blockedsens'].asString := '';
Data['canlinux'].asString := '0';
Data['channelinfos'].asString := '{"0":{"Unit":"oukCustom","CustomUnit":"#","ValueLookupName":"","LimitMode":"0","LimitMinError":"","LimitMinWarning":"","LimitMaxError":"","LimitMaxWarning":""},"1":{"Unit":"oukTimeResponse","CustomUnit":"","ValueLookupName":"","LimitMode":"0","LimitMinError":"","LimitMinWarning":"","LimitMaxError":"","LimitMaxWarning":""}}';
Data['channelnames'].asString := 'Value'#$D#$A + 
'0'#$D#$A + 
'Execution Time'#$D#$A + 
'1'#$D#$A + 
'';
Data['environment'].asString := '';
Data['exefile'].asString := 'XMLValue.exe';
Data['exeparams'].asString := '-u="http://myServerName.pvhcorp.com:4985/_expvar" -n="cb/ops/GetsRaw/count" -t="60" -ssl3';
Data['fastcount'].asString := '0';
Data['host'].asString := 'myServerName.PVHCORP.COM';
Data['hostv6'].asString := '';
Data['inerror'].asString := '1';
Data['interfacenumber'].asString := '';
Data['inum'].asString := '';
Data['ipversion'].asString := '0';
Data['isexesensor'].asString := '1';
Data['lastmsg'].asString := 'Node cb/ops/GetsRaw/count not found in xml result. ';
Data['lastuptime'].asString := '0';
Data['linuxlogindomain'].asString := '';
Data['linuxloginpassword'].asString := '***';
Data['monitorchange'].asString := '0';
Data['mutexname'].asString := 'ptfxmlrestvalueID15900';
Data['notonpod'].asString := '0';
Data['ptfwriteresult'].asString := '1';
Data['reboot'].asString := '43086.6328852199';
Data['reqmsginterval'].asString := '60';
Data['requiredotnetversion'].asString := '40';
Data['sensorid'].asString := '15900';
Data['simulate'].asString := '0';
Data['timeout'].asString := '60';
Data['tlsexplicit_default'].asString := '';
Data['tlsexplicit_ftp'].asString := '';
Data['tlsexplicit_imap'].asString := '';
Data['tlsexplicit_pop3'].asString := '';
Data['tlsexplicit_port'].asString := '';
Data['tlsexplicit_smtp'].asString := '';
Data['uptimecount'].asString := '0';
Data['usednstime'].asString := '0';
Data['usewindowsauthentication'].asString := '';
Data['valuetype'].asString := '1';
Data['windowslogindomain'].asString := 'MyDomainName';
Data['windowsloginpassword'].asString := '***';
Data['windowsloginusername'].asString := 'myServiceAccount';
Data['writeresult'].asString := '0';

I also pasted some of the JSON code, not all of it so it is missing the end brackets.

{  
   "cb":{  
      "ops":{  
         "GetsRaw":{  
            "count":8971227,
            "sum":144555679535000,
            "min":0,
            "max":18932848100,
            "mean":1.611325625078933e+07,
            "p25":16001800,

Further down in the same JSON file I can retrieve numbers. Different sections.

Created on Dec 18, 2017 3:20:29 PM



Votes:

0

Hi there,

With your provided JSON-Code, I am able to get the data from the node "cb/ops/GetsRaw/count". Could you try to open the URL "http://myServerName.pvhcorp.com:4985/_expvar" in a browser on the Core Server to see what data is displayed there?

Best regards.

Created on Dec 19, 2017 10:43:25 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Sorry, got side tracked with other issues for a while.

Going back to this. ;-)

The URL opens the JSON document for me. And I can copy and paste the code into a JSON Beautifier to make it more readable.

The only config I have in the sensor at the moment is the URL: http://amsapp124:4985/_expvar XML Node (and optional property): cb/ops/GetsRaw/count

The log files still tells me the below. I don't get it.

[Probe] 1/19/2018 5:01:23 PM Microsoft Windows Server 2012 R2 Standard 6.2.9200.0 en-US [Sensor] XMLValue 17.1.1 Run by PRTG probe. [Parameters] -u=http://amsapp124:4985/_expvar -n=cb/ops/GetsRaw/count -t=60 -rn -debug=D:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)\Result of Sensor 17826.txt [Trace] Sending request Reply received [Error] Node cb/ops/GetsRaw/count not found in xml result. Exitcode custom_error

Created on Jan 19, 2018 4:01:56 PM



Votes:

0

Hi there,

As described, when I use the JSON code you provided, I can successfully add the sensor. Please post the exact data that is offered when PRTG connects to "http://amsapp124:4985/_expvar". When we have the source data, which PRTG requests, then we are most likely able to reproduce the issue.

Best regards.

Created on Jan 22, 2018 2:05:26 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

This is a copy and paste of the data that ia returned to me.

<Deleted as it is too long>

Created on Jan 23, 2018 2:06:38 PM

Last change on Jan 24, 2018 8:41:31 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi there,

Is this the entire returned JSON? I ask, because it doesn't end properly and breaks just in the middle:

...
		507,
		474,
		543,
		545,
		569

So there are no ending brackets/braces.

Best regards.

Created on Jan 24, 2018 8:43:03 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

I can copy and paste the contents of the page locally. All the information is there. I am wondering if the page is either too long for the forum and / or even too long for the sensor?

I can email the contents of the page if you have an email address for me?

Created on Jan 25, 2018 9:11:06 AM



Votes:

0

Hey,

Kindly forward the complete result as a zip file to [email protected] by referring to this Knowledge Base post. Thanks!

Best regards, Felix

Created on Jan 25, 2018 9:16:59 PM by  Felix Saure [Paessler Support]



Votes:

0

Hi,

The email with the ZIP file has been sent this morning.

Created on Jan 26, 2018 7:59:54 AM




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.