Page 3 of 3

Re: How can use complex password in check_http for url

Posted: Tue Jul 09, 2024 9:18 am
by lgute
Hi @baber,

I think the single quotes may be in the wrong place.
baber wrote: Tue Jul 09, 2024 1:38 am I changed it such as follow

Code: Select all

define service{
        use                     local-service
        host_name               subs
        service_description     mebp
        servicegroups           OD
        check_command           check_http!' -H mb.com -w 5 -c 10 -p 8980 -u /mb/ai/branch/all  -a mba:785\!"@"Nobv'
}

Is that correct ?
You previously posted, that running the check_http command with the username and password in single quotes does work.
baber wrote: Tue Jul 02, 2024 11:16 am so thanks now when I am running

/usr/local/nagios/libexec/check_http -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a 'john:555!@BabP'

on nagios it is working but ...
I think your single quotes need to be in the same place as what you were using when running the check command in the terminal.

Code: Select all

         check_command           check_http! -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a 'john:555\!@BabP'
Or with your latest example (assuming the double quotes are not actually a part of the password).

Code: Select all

         check_command           check_http! -H mb.com -w 5 -c 10 -p 8980 -u /mb/ai/branch/all  -a 'mba:785\!@Nobv'

Re: How can use complex password in check_http for url

Posted: Wed Jul 10, 2024 1:31 am
by baber
lgute wrote: Tue Jul 09, 2024 9:18 am Hi @baber,

I think the single quotes may be in the wrong place.
baber wrote: Tue Jul 09, 2024 1:38 am I changed it such as follow

Code: Select all

define service{
        use                     local-service
        host_name               subs
        service_description     mebp
        servicegroups           OD
        check_command           check_http!' -H mb.com -w 5 -c 10 -p 8980 -u /mb/ai/branch/all  -a mba:785\!"@"Nobv'
}

Is that correct ?
You previously posted, that running the check_http command with the username and password in single quotes does work.
baber wrote: Tue Jul 02, 2024 11:16 am so thanks now when I am running

/usr/local/nagios/libexec/check_http -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a 'john:555!@BabP'

on nagios it is working but ...
I think your single quotes need to be in the same place as what you were using when running the check command in the terminal.

Code: Select all

         check_command           check_http! -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a 'john:555\!@BabP'
Or with your latest example (assuming the double quotes are not actually a part of the password).

Code: Select all

         check_command           check_http! -H mb.com -w 5 -c 10 -p 8980 -u /mb/ai/branch/all  -a 'mba:785\!@Nobv'
Thanks. solved with your solution

Re: How can use complex password in check_http for url

Posted: Thu Jul 11, 2024 8:35 am
by lgute
Hi @baber,

Thank you for the update. I'm glad I could help.

Since you have a resolution, I am going to lock this thread and mark it Resolved.