Password with exclamation sign (!) in command is not working
-
imran_khan
- Posts: 196
- Joined: Mon May 27, 2013 3:16 pm
Password with exclamation sign (!) in command is not working
Hello,
We are using password with exclamation sign (!) (Password:- xyzabc!!) in command to monitor link with authentication but it is not working, we are getting authentication failed error.
Normally this password is working fine while accessing link directly. There is no issue with username and password.
Thanks,
Imran Khan.
We are using password with exclamation sign (!) (Password:- xyzabc!!) in command to monitor link with authentication but it is not working, we are getting authentication failed error.
Normally this password is working fine while accessing link directly. There is no issue with username and password.
Thanks,
Imran Khan.
Re: Password with exclamation sign (!) in command is not wor
Exclamation points are used to separate command arguments, so they need to be treated somewhat differently.
http://support.nagios.com/forum/viewtop ... =16&t=8598
Basically you will want to edit /usr/local/nagios/etc/resource.cfg and make a new $USERX$ variable, and use that in your definition.
http://support.nagios.com/forum/viewtop ... =16&t=8598
Basically you will want to edit /usr/local/nagios/etc/resource.cfg and make a new $USERX$ variable, and use that in your definition.
Former Nagios employee
-
imran_khan
- Posts: 196
- Joined: Mon May 27, 2013 3:16 pm
Re: Password with exclamation sign (!) in command is not wor
Hello,
Thanks for the reply.
Please find my current command definition and service command details. Please suggest me on the basis of current details/setting.
check_sharepoint.pl command defination:-
command_name check_sharepoint.pl
command_line /usr/lib64/nagios/plugins/check_sharepoint.pl -H $ARG1$ -u $ARG2$ -p $ARG3$ -l $ARG4$ -s $ARG5$ -t $ARG6$
Service command:-
check_command check_sharepoint.pl!xyz![email protected]!xyzabc!!!'/SitePages/Home.aspx'!'Home'!15
Thanks,
Imran Khan.
Thanks for the reply.
Please find my current command definition and service command details. Please suggest me on the basis of current details/setting.
check_sharepoint.pl command defination:-
command_name check_sharepoint.pl
command_line /usr/lib64/nagios/plugins/check_sharepoint.pl -H $ARG1$ -u $ARG2$ -p $ARG3$ -l $ARG4$ -s $ARG5$ -t $ARG6$
Service command:-
check_command check_sharepoint.pl!xyz![email protected]!xyzabc!!!'/SitePages/Home.aspx'!'Home'!15
Thanks,
Imran Khan.
Re: Password with exclamation sign (!) in command is not wor
Did you read the link I posted?
You will need to edit /usr/local/nagios/etc/resource.cfg and make a new $USERX$ variable holding your password, and use that in your definition:
For example.
You will need to edit /usr/local/nagios/etc/resource.cfg and make a new $USERX$ variable holding your password, and use that in your definition:
Code: Select all
check_command [email protected]!$USER10$!'/SitePages/Home.aspx'!'Home'!15
Former Nagios employee
-
imran_khan
- Posts: 196
- Joined: Mon May 27, 2013 3:16 pm
Re: Password with exclamation sign (!) in command is not wor
Hello,
Getting below error while try to access url which posted you.
You are not authorised to read this forum.
Thanks,
Imran Khan.
Getting below error while try to access url which posted you.
You are not authorised to read this forum.
Thanks,
Imran Khan.
Re: Password with exclamation sign (!) in command is not wor
Here is the relevant post from that thread:
However you should be able to just make the edit to resource.cfg, restart nagios and get it working.scottwilkerson wrote:It does kind of depend on the quoting that may or may not be around the field you are using.
In your example instead of thisyou would need to go with this (removing the single quote)Code: Select all
/usr/local/nagios/libexec/check_mssql_server.py -H raqsql2 -U 'sa' -P '\$QLxxxx!' -p 1433 --averagewait --warning 20 --critical 30where you have added the following to the resources.cfg and restarted nagiosCode: Select all
/usr/local/nagios/libexec/check_mssql_server.py -H raqsql2 -U 'sa' -P \\$$QLxxxx$USER9$ -p 1433 --averagewait --warning 20 --critical 30Code: Select all
$USER9$="!"
Former Nagios employee
-
imran_khan
- Posts: 196
- Joined: Mon May 27, 2013 3:16 pm
Re: Password with exclamation sign (!) in command is not wor
Hello,
Is there any other way?
Thanks,
Imran Khan.
Is there any other way?
Thanks,
Imran Khan.
Re: Password with exclamation sign (!) in command is not wor
The steps I provided are the only way to get an exclamation mark in a command definition.imran_khan wrote:Hello,
Is there any other way?
Thanks,
Imran Khan.
Former Nagios employee
-
imran_khan
- Posts: 196
- Joined: Mon May 27, 2013 3:16 pm
Re: Password with exclamation sign (!) in command is not wor
Hello,
There is two exclamation in password (xyzabc!!). So please let me know, how I can do this?
Thanks,
Imran Khan.
There is two exclamation in password (xyzabc!!). So please let me know, how I can do this?
Thanks,
Imran Khan.
Re: Password with exclamation sign (!) in command is not wor
I have already told you.
You will need to edit /usr/local/nagios/etc/resource.cfg and enter in a new line with the following:
$USER10$=xyzabc!!
and save the file. You will obviously need to type in your password if it is not actually 'xyzabc!!'.
Then you will need to edit your command definition like so:
check_command check_sharepoint.pl!xyz![email protected]!$USER10$!'/SitePages/Home.aspx'!'Home'!15
and save that file. Then run:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios reload
and it should work.
The reason you cannot have a (!) in the command directly is because that character is used to separate out the command arguments, so when you put a (!) in as a password, nagios thinks that whatever comes after is a new command argument, which is wrong.
You will need to edit /usr/local/nagios/etc/resource.cfg and enter in a new line with the following:
$USER10$=xyzabc!!
and save the file. You will obviously need to type in your password if it is not actually 'xyzabc!!'.
Then you will need to edit your command definition like so:
check_command check_sharepoint.pl!xyz![email protected]!$USER10$!'/SitePages/Home.aspx'!'Home'!15
and save that file. Then run:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios reload
and it should work.
The reason you cannot have a (!) in the command directly is because that character is used to separate out the command arguments, so when you put a (!) in as a password, nagios thinks that whatever comes after is a new command argument, which is wrong.
Former Nagios employee