Page 1 of 1

Submitting a passive check using a curl command

Posted: Tue Apr 25, 2017 4:14 pm
by corkyman
I am trying to test submitting a check to NRDP using a curl command. Here is what I constructed and ran manually as a test:

curl -X POST --data-urlencode 'token=wspwebfarm&cmd=submitcheck&XMLDATA=<?xml version='\''1.0'\''?><checkresults><checkresult type='\''service'\''><hostname>VHLPNWSAS001</hostname><servicename>GWS_Timeouts</servicename><state>0</state><output>Ok|timeouts=0</output></checkresult></checkresults>' http://vhlgnngxi001.tvlport.net/nrdp

Here is a reply back:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://vhlgnngxi001.tvlport.net/nrdp/">here</a>.</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at vhlgnngxi001.tvlport.net Port 80</address>
</body></html>

What am I doing wrong? Please help.

Re: Submitting a passive check using a curl command

Posted: Tue Apr 25, 2017 4:23 pm
by cdienger
Looks like you just need a "/" at the end. Try:

curl -X POST --data-urlencode 'token=wspwebfarm&cmd=submitcheck&XMLDATA=<?xml version='\''1.0'\''?><checkresults><checkresult type='\''service'\''><hostname>VHLPNWSAS001</hostname><servicename>GWS_Timeouts</servicename><state>0</state><output>Ok|timeouts=0</output></checkresult></checkresults>' http://vhlgnngxi001.tvlport.net/nrdp/

Re: Submitting a passive check using a curl command

Posted: Tue Apr 25, 2017 4:40 pm
by corkyman
Additional info:
I am getting the same results on my Windows system when using the curl command. Submitting the command using the browser and using a VBScript works fine. I also replaced blanks with %20 in the XML data but this did not help.

Re: Submitting a passive check using a curl command

Posted: Wed Apr 26, 2017 8:12 am
by corkyman
Yes, thank you very much! Working now.