curl -X POST --data-urlencode 'token=xxxx&cmd=submitcheck&XMLDATA=<?xml version='\''1.0'\''?><checkresults><checkresult type='\''service'\''><hostname>localhost</hostname><servicename>Host Automation</servicename><state>1</state><output>Warning - this is a test</output></checkresult></checkresults>' http://xxxxx.itciss.com/nrdp/
And this is the output I get instead of the expected result of a successful processing:
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Steve, I must be blind as I don't see anything after nrdp/
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
curl -X POST --data-urlencode 'token=xxxx&cmd=submitcheck&XMLDATA=<?xml version='\''1.0'\''?>
when you escape the second single quote after version you are essentially breaking the --data-urlencode string. You need to escape the first one. Effectively you have this string:
curl -X POST --data-urlencode 'token=xxxx&cmd=submitcheck&XMLDATA=<?xml version="1.0"?><checkresults><checkresult type="service"><hostname>localhost</hostname><servicename>Host Automation</servicename><state>1</state><output>Warning - this is a test</output></checkresult></checkresults>' http://xxxxx.itciss.com/nrdp/
I also noticed this
<checkresult Type='\''service'\''> - working example
<checkresult type='\''service'\''> - your example
Is case sensitivity an issue?
Also, in the output I see the working example has a pipe character. Do you need to terminate with that?
<output>Warning - this is a test</output>
<output>Warning - this is a test|</output>
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github