Page 1 of 1

SMB check argument

Posted: Fri Jun 05, 2015 2:24 pm
by emartine
I have an smb check argument where the account necessary to reach the share has ! in the password. Is there a way to bypass having nagios interpret the !s in the password?
I have tried adding the \ in front of the ! but when nagios saves the command, the password is interpreted as an argument for each ! and it separates the password into different fields.

Re: SMB check argument

Posted: Fri Jun 05, 2015 3:52 pm
by emartine
$USER1$/smb_checksize -H $HOSTADDRESS$ -S $ARG1$ -U $ARG2$ -P $USER11$ -W $ARG3$ -C $ARG4$ where user11 is the password but I get the response Error: Check Username/Password
this works fine on the command line. Just trying to get the syntax right. Password was defined in /usr/local/nagios/etc/resource.cfg as $USER11$=!blah!blah!blah

Re: SMB check argument

Posted: Mon Jun 08, 2015 8:34 am
by lmiltchev
Can you show us the actual service config? Please, hide the password.
Do you have one or two backslashes? Is the macro wrapped in a single or double quotes?
When you say it works from the command line, do you mean running the check in a terminal (ssh/putty session) or testing within the CCM?

Re: SMB check argument

Posted: Mon Jun 08, 2015 10:12 am
by emartine
Found out what was wrong. It required the domain in front of the username for the account to work.

Re: SMB check argument

Posted: Mon Jun 08, 2015 10:22 am
by lmiltchev
Found out what was wrong. It required the domain in front of the username for the account to work.
Great! I am marking this topic as resolved.