Page 1 of 1

Long URL monitoring

Posted: Mon Jul 15, 2013 7:50 am
by dlevin
Hello,

We have very long URL http://domain.com/rsi-v1.svc/ContentTre ... ecurityXXX

I have been trying to escape this URL about week. :cry:

OK this command works fine from command line but does not work from nagios

/usr/local/nagios/libexec/check_http -H domain.com -u "/rsi-v1.svc/ContentTreeNodes('Csh"'!'"WKUS_TAL_262%2523ab8a05c47b701000bd9d001b78be8c7801--33381870-1878-11de-8c30-0800200c9a66----00001C7d48ae28%257C00017Cd30a6de6%257C00002Ccd137323%257C00001TWKUS_TAL_262--00000TWKUS_TAL_262%257C00001Tdc24887c--7CAD6D844EC2A418--WKUS_TAL_262--WKUS_TAL_262%2523ab8a05c47b701000bd9d001b78be8c7801')/Children/?$orderby=Index&$skip=0&$top=26&_dc=1362147914899&ApiKey=XXXXXXXXX&authorization=Basic%XXXSecurityXXX" -s "Children"

I opened debug file and found following. i see that the issue with ($) symbol.

[1373892293.017461] [2048.0] [pid=28388] WARNING: Could not find a macro matching 'orderby=Index&'!
[1373892293.017464] [2048.0] [pid=28388] WARNING: An error occurred processing macro 'orderby=Index&'!

I've tried to escape with different ways 1) I used double $$ 2) I used "$$" 3 \$$
I'b still not able to resolve this issue.

I would be grateful if you could help me to resolve it.

Re: Long URL monitoring

Posted: Mon Jul 15, 2013 9:59 am
by lmiltchev
I'm not sure if this will help, but you can try using "\\$$". This helped some XI customers - see here. You can probably use the same method to escape "$" in Nagios Core.

Re: Long URL monitoring

Posted: Fri Jul 19, 2013 6:58 am
by dlevin
For some reasons '\\$$' does not help me :cry:

I've got following
WARNING: Could not find a macro matching ''!

Re: Long URL monitoring

Posted: Fri Jul 19, 2013 2:08 pm
by sreinhardt
Have you tried url encoding things like the $ and & with percent encoding or similar?

Re: Long URL monitoring

Posted: Fri Jul 19, 2013 2:10 pm
by yancy
dlevin,

Try URL encoding

Code: Select all

/usr/local/nagios/libexec/check_http -H domain.com -u"%2Frsi-v1.svc%2FContentTreeNodes(%27Csh%22%27!%27%22WKUS_TAL_262%252523ab8a05c47b701000bd9d001b78be8c7801--33381870-1878-11de-8c30-0800200c9a66----00001C7d48ae28%25257C00017Cd30a6de6%25257C00002Ccd137323%25257C00001TWKUS_TAL_262--00000TWKUS_TAL_262%25257C00001Tdc24887c--7CAD6D844EC2A418--WKUS_TAL_262--WKUS_TAL_262%252523ab8a05c47b701000bd9d001b78be8c7801%27)%2FChildren%2F%3F%24orderby%3DIndex%26%24skip%3D0%26%24top%3D26%26_dc%3D1362147914899%26ApiKey%3DXXXXXXXXX%26authorization%3DBasic%25XXXSecurityXXXX" -s "Children"