NSClient++ authentication problem with nagios3

7,289

Solution 1

This likely means that that somehow "secret-password" is not being passed properly to Nagios when it runs the command. Sometimes it can be strange expansion issues or quoting issues.

I recommend enabling debuging in Nagios to see what command is actually being run:

debug_level=-1
# DEBUG VERBOSITY
# This option determines how verbose the debug log out will be.
# Values: 0 = Brief output
#         1 = More detailed
#         2 = Very detailed
debug_verbosity=2
# DEBUG FILE
# This option determines where Nagios should write debugging information.   
debug_file=/usr/local/nagios/var/nagios.debug

Solution 2

It is likely that you haven't set the password in check_nt command definition:

define command{
    command_name    check_nt
    command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -s s3cret -v $ARG1$ $ARG2$
    }
Share:
7,289

Related videos on Youtube

Caterpillar
Author by

Caterpillar

Updated on September 18, 2022

Comments

  • Caterpillar
    Caterpillar almost 2 years

    I have installed & configured NSClient++ in windows xp host and set the default password to test which will be there in C:\Program Files\NSClient++\NSC.ini.

    The nagios is showing windows services but it says NSClient - ERROR: Invalid password.

    I am using the default password which is there in NSC.ini file. and it works when I run the below command from linux box and I have enabled the port too.

    Check CPU Load

    /usr/lib/nagios/plugins/check_nt -H '192.168.36.177' -s 'secret-password' -p 12489 -v CPULOAD -w 80 -c 90 -l 5,80,90,10,80,90


    Check USED DISK SPACE

    /usr/lib/nagios/plugins/check_nt -H '192.168.36.177' -s 'secret-password' -p 12489 -v USEDDISKSPACE -d SHOWALL -l c

    Please anyone can tell me where might I have gone wrong?

    • beakersoft
      beakersoft almost 13 years
      Just as a side note you might also want to look at a plugin that uses WMI to do your checks, it means you dont need an agent on the windows machine. there is a good one at thibault.info/node/2
  • Caterpillar
    Caterpillar almost 13 years
    Thanks I enabled the debug mode & I came to know that the default password was not working. I changed the password in the both ends from secret-password to some single string password. Then It started working. But dont you think its weired. It should work with what ever password we assign right?