Long URL monitoring

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dlevin
Posts: 2
Joined: Wed Jul 10, 2013 8:07 am

Long URL monitoring

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Long URL monitoring

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
dlevin
Posts: 2
Joined: Wed Jul 10, 2013 8:07 am

Re: Long URL monitoring

Post by dlevin »

For some reasons '\\$$' does not help me :cry:

I've got following
WARNING: Could not find a macro matching ''!
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Long URL monitoring

Post by sreinhardt »

Have you tried url encoding things like the $ and & with percent encoding or similar?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: Long URL monitoring

Post 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"
Locked