Test check works in CCM, but fails once applied

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Test check works in CCM, but fails once applied

Post 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...
You do not have the required permissions to view the files attached to this post.
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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$.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

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

Post by vAJ »

Or change my service acct password to not include illegal characters?

Where are the illegal characters listed again?
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

Code: Select all

$ grep illegal /usr/local/nagios/etc/nagios.cfg
illegal_macro_output_chars=`~$&|'"<>
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

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

Post 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$!!!!!
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

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

Post 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
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

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

Post by vAJ »

Yes, it is failing in the main UI with the error show above.
Andrew J. - Do you even grok?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

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

Post 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
Andrew J. - Do you even grok?
Locked