Page 1 of 2

Test check works in CCM, but fails once applied

Posted: Thu Oct 24, 2013 4:22 pm
by vAJ
I'm trying to add a check for testing DFS shares.

Using check_smb_share from the Exchange.

I tested from the command line:

Code: Select all

libexec]$  ./check_smb_share -H aus05nptpdfsr01.prod.****.com -s content -u "prod\svc_*********" -p "YmYU%gFv3zXj;@"
OK SMB Sharename:       content         Disk      Content Share
I created the command:

Code: Select all

$USER1$/check_smb_share -H $HOSTADDRESS$ -s $ARG1$ -u "$ARG2$" -p "$ARG3$"
Then I configured the service:
dfs_check_problem.jpg
Template assigned is "generic-service"

Testing here works good (notice that the CCM is escaping out the whack and semicolon:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_smb_share -H AUS05NPTPDFSR01.prod.****.com -s content -u prod\\svc_******** -p YmYU%gFv3zXj\;@
OUTPUT: OK SMB Sharename: 	content         Disk      Content Share
But as soon as I apply the config and go back out to the main UI, the check returns:

Code: Select all

CRITICAL SMB Sharename: content WARNING: The "idmap uid" option is deprecated
The same error code if I give it bad credentials in the CCM test

In the main ui, if I go to "Reconfigure this service" I show:

Code: Select all

check_smb_share!content!prod\******!YmYU%gFv3zXj;@!!!!!
Note the password here has a semicolon, but the test in the CCM didn't seem to care.

I've read through the wiki on problems with service checks and the PDF on Managing Plugins. I seem to be following the book, can't understand why the check doesn't work past the CCM/command line...

Re: Test check works in CCM, but fails once applied

Posted: Thu Oct 24, 2013 4:51 pm
by abrist
Your password includes 'illegal' meta characters. You will need to use the file /usr/local/nagios/etc/resource.cfg. Edit it to include (we will use $USER9$ for this example):

Code: Select all

$USER9$=YmYU%gFv3zXj;@
Then change your command to:

Code: Select all

$USER1$/check_smb_share -H $HOSTADDRESS$ -s $ARG1$ -u "$ARG2$" -p "$USER9$"
Restart nagios/apply configuration.
A few things you should know:
1. The test check command will fail as it does not support $USERn$ macros.
2. By changing the command as I had you do above, it will change all checks using the command check_smb_share to use the password set to $USER9$. If you need to specify other passwords for other check_smb_shares, do not change the command, but instead change $ARG3$ in the CCM from your password to $USER9$.

Re: Test check works in CCM, but fails once applied

Posted: Thu Oct 24, 2013 4:56 pm
by vAJ
Or change my service acct password to not include illegal characters?

Where are the illegal characters listed again?

Re: Test check works in CCM, but fails once applied

Posted: Fri Oct 25, 2013 12:07 pm
by abrist

Code: Select all

$ grep illegal /usr/local/nagios/etc/nagios.cfg
illegal_macro_output_chars=`~$&|'"<>
illegal_object_name_chars=`~!$%^&*|'"<>?,()=

Re: Test check works in CCM, but fails once applied

Posted: Fri Oct 25, 2013 1:42 pm
by vAJ
ok, I've set the macro in resources.cfg but the check still returns "CRITICAL SMB Sharename: content WARNING: The "idmap uid" option is deprecated"

Command comes through as:

Code: Select all

check_smb_share!content!prod\svc_****!$USER9$!!!!!

Re: Test check works in CCM, but fails once applied

Posted: Fri Oct 25, 2013 1:58 pm
by abrist
abrist wrote:1. The test check command will fail as it does not support $USERn$ macros.
Does the check itself work in the details ui?

Re: Test check works in CCM, but fails once applied

Posted: Fri Oct 25, 2013 2:09 pm
by yancy
vAJ,

Can you take a look at the nagios.log file and see what the service checks are running as (what the actual check command will be).

-Yancy

Re: Test check works in CCM, but fails once applied

Posted: Fri Oct 25, 2013 2:27 pm
by vAJ
Yes, it is failing in the main UI with the error show above.

Re: Test check works in CCM, but fails once applied

Posted: Mon Oct 28, 2013 10:22 am
by abrist
vAJ wrote:Yes, it is failing in the main UI with the error show above.
I think what yancy was looking for was the actual command that was run once nagios parsed the config and ran the check:

Code: Select all

grep "DFS Content Share" /usr/local/nagios/var/nagios.log

Re: Test check works in CCM, but fails once applied

Posted: Mon Oct 28, 2013 10:30 am
by vAJ
All I see in the nagios.log are the results. Do I need to crank up debug level somewhere for it to show what you're asking for?

Code: Select all

[1382974060] SERVICE ALERT: AUS05NPTPDFSR01.prod.****.com;DFS Content Share;CRITICAL;HARD;1;CRITICAL SMB Sharename: content WARNING: The "idmap uid" option is deprecated