RESOLVED: How can use complex password in check_http for url
RESOLVED: How can use complex password in check_http for url
I am using check_http to check url . It is working while I have a simple password for authentication but cannot work with strong password that include !@#$%
/usr/local/nagios/libexec/check_http -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a john:555!@BabP
user=john
pass=555!@BabP
but it is working while remove !@ from password . how can solve it ?
/usr/local/nagios/libexec/check_http -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a john:555!@BabP
user=john
pass=555!@BabP
but it is working while remove !@ from password . how can solve it ?
Re: How can use complex password in check_http for url
Hi @baber,
I am curious what errors you're seeing when you try this. My first thought is to try quote wrapping the parameter after the -a flag, so:
You may need to escape the characters if this doesn't work. I found some more info in an older thread: viewtopic.php?t=39561
From this it looks like you may need to escape problematic characters variously with either a leading '\' character or by quote wrapping the problematic character. I would also try this:
Note that I put a \ before the ! and quote wrapped the @ character. I would suggest playing around with this and seeing if you can get it working from here. Let us know how it goes!
I am curious what errors you're seeing when you try this. My first thought is to try quote wrapping the parameter after the -a flag, so:
Code: Select all
/usr/local/nagios/libexec/check_http -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a 'john:555!@BabP'From this it looks like you may need to escape problematic characters variously with either a leading '\' character or by quote wrapping the problematic character. I would also try this:
Code: Select all
/usr/local/nagios/libexec/check_http -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a john:555\!"@"BabPRe: How can use complex password in check_http for url
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 when add it to check_command on nagios server for that host
check_command check_nrpe!check_http!' -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a 'john:555\!"@"BabP'
it is showing :
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
on nagios
/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 when add it to check_command on nagios server for that host
check_command check_nrpe!check_http!' -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a 'john:555\!"@"BabP'
it is showing :
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
on nagios
Re: How can use complex password in check_http for url
Can anyone help me to solve the issue ?
Re: How can use complex password in check_http for url
It looks like your second command has two check commands back to back:
Try removing the "check_nrpe!"
Code: Select all
check_command check_nrpe!check_http!' -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a 'john:555\!"@"BabP'Re: How can use complex password in check_http for url
If that doesn't work, seeing logs from NRPE might help (i believe it usually writes to /var/log/messages).
Re: How can use complex password in check_http for url
jsimon wrote: ↑Wed Jul 03, 2024 9:25 am It looks like your second command has two check commands back to back:
Try removing the "check_nrpe!"Code: Select all
check_command check_nrpe!check_http!' -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a 'john:555\!"@"BabP'
Thanks but we cannot remove check_nrpe
Code: Select all
define service{
use local-service
host_name subs
service_description mebp
servicegroups OD
check_command check_nrpe!check_http!' -H myurl.com -w 5 -c 10 -p 8980 -u /me/api/test/all -a john:555\!"@"BabP'
}
Re: How can use complex password in check_http for url
Would you please help me
Re: How can use complex password in check_http for url
It is showing follow error in /var/log/message on remote server
Code: Select all
nrpe[13277]: Error: Request contained illegal metachars!
Jul 6 13:07:37 serverA nrpe[13277]: Client request was invalid, bailing out...
Jul 6 13:07:44 serverA nrpe[13307]: Error: Request contained illegal metachars!
Jul 6 13:07:44 serverA nrpe[13307]: Client request was invalid, bailing out...
Re: How can use complex password in check_http for url
Would you please help me about it ?