Page 1 of 1

Submit NRDP with Curl

Posted: Tue Sep 05, 2017 10:04 am
by spurrellian
Hi,

I'm trying to send a passive check to my nagios host where the results has a space in it

Code: Select all

curl -X POST -L 'http://nagios-live/nrdp?cmd=submitcmd&token=****&command=PROCESS_SERVICE_CHECK_RESULT;wxapsdpoc03;SQL_Daily_1;1;Backup Failed' --insecure
When it displays in Nagios it misses off " Failed" and just displays the word Backup
sqldaily.PNG
Can anyone help with the syntax?

Thanks

Paul

Re: Submit NRDP with Curl

Posted: Tue Sep 05, 2017 10:08 am
by tmcdonald
You should replace all spaces with %20 as that is the URL-encoding of the space character - https://www.w3schools.com/tags/ref_urlencode.asp

Re: Submit NRDP with Curl

Posted: Tue Sep 05, 2017 10:26 am
by spurrellian
I tried with %20 and it didnt work. but using + did

You can close the call

Thanks :)

Re: Submit NRDP with Curl

Posted: Tue Sep 05, 2017 10:30 am
by tmcdonald
Ahh, yea my mistake. I think %20 would only work if the curl command was in double-quotes.

At any rate, glad to (sort of) help!