Page 1 of 1
check_nt broken
Posted: Thu Aug 11, 2011 2:18 pm
by tgfde
I'm getting the following error when I run a command to check disk space on d drive:
NSClient - ERROR: Invalid password
The thing is, I didn't change the password.
Thanks,
tgfde
Re: check_nt broken
Posted: Thu Aug 11, 2011 2:22 pm
by tgfde
I forgot to mention that the password is commented out in the NSC.ini file. So I think the there is no password implemented at the initial setup.
Is this correct?
Thanks.
Re: check_nt broken
Posted: Thu Aug 11, 2011 3:00 pm
by tgfde
From the NSClient log:
2011-08-11 14:38:45: debug:NSClient++.cpp

Injected Performance Result: ''
2011-08-11 14:38:45: debug:modules\NSClientListener\NSClientListener.cpp:146: Data: &4&D
2011-08-11 14:38:45: debug:modules\NSClientListener\NSClientListener.cpp:171: Data: D
2011-08-11 14:38:45: debug:NSClient++.cpp

Injecting: CheckDriveSize: D, nsclient
2011-08-11 14:38:45: debug:NSClient++.cpp

Injected Result: OK '85422608384&107364544512'
2011-08-11 14:38:45: debug:NSClient++.cpp

Injected Performance Result: ''
2011-08-11 14:38:56: debug:modules\NSClientListener\NSClientListener.cpp:146: Data: $&4&C
2011-08-11 14:38:56: error:modules\NSClientListener\NSClientListener.cpp:160: Invalid password ($).
2011-08-11 14:39:00: debug:modules\NSClientListener\NSClientListener.cpp:146: Data: $&4&C
2011-08-11 14:39:00: error:modules\NSClientListener\NSClientListener.cpp:160: Invalid password ($).
2011-08-11 14:39:04: debug:modules\NSClientListener\NSClientListener.cpp:146: Data: $&4&D
2011-08-11 14:39:04: error:modules\NSClientListener\NSClientListener.cpp:160: Invalid password ($).
Re: check_nt broken
Posted: Thu Aug 11, 2011 4:18 pm
by lmiltchev
Probably something was not set right during the initial install. If you are using a password, it should be set in your NSC.ini file, for example:
Go to the Core Config manager and try to configure the "check disk space" service. You will have
-s "$ARG1$", where "$ARG1$" should be equal to "mypassword" from the NSC.ini file.
If your password is commented out in your NSC.ini file
then you should have an empty string for "$ARG1$" instead of "mypassword".
I would suggest to try a simple password in your NSC.ini file, restart the nsclient++ service and then reconfigure the "check disk space" service in Nagios XI with the new password.
Re: check_nt broken
Posted: Thu Aug 11, 2011 4:36 pm
by tgfde
Hi lmiltchev,
Thanks for your reply but I actually fixed the problem by editing the command.
Old:
./check_nt -H ecmpsql1 -s "$ARG1$" -p 12489 -v USEDDISKSPACE -l C -w 90 -c 95 $ARG4$
NSClient - ERROR: Invalid password.
New:
./check_nt -H ecmpsql1 -p 12489 -v USEDDISKSPACE -l C -w 90 -c 95 $ARG4$
C:\ - total: 19.77 Gb - used: 18.29 Gb (93%) - free 1.48 Gb (7%) | 'C:\ Used Space'=18.29Gb;17.79;18.78;0.00;19.77
I know this is probably a dumb question but is this a bug or did someone actually edited the command without telling me.
This is the second time it has happened to me and I don't want it to occur again because it took me a long time to figure this out especially the first time.
Thanks.
Re: check_nt broken
Posted: Fri Aug 12, 2011 9:29 am
by lmiltchev
I am glad your problem is fixed. As for the "bug" question, if you have -s "$ARG1S", you should have "something" as a password, even an empty string.
Also, after any change in the NSC.ini file, you should restart the nsclient++ service in order for the change to take effect. I am not sure what was the reason for your "NSClient - ERROR: Invalid password" but on my test machine, I used -s "$ARG1S", I changed my passwords a few times, commented out the password in my NSC.ini file and used an empty string for my "$ARG1S" and it worked every time. So I am not sure what changed in your environment. Let us know if you have any more troubles.
Re: check_nt broken
Posted: Fri Aug 12, 2011 3:48 pm
by tgfde
Here's one.
The command below is used as a scheduled check on Nagios to check CPU and works fine. However, when I run the same command via cmd locally from the Nagios server, I get the "NSClient - ERROR: Invalid password" error.
./check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v CPULOAD -l 5,85,95 $ARG4$
Then when I removed "s "$ARG1$" from the command above and run it via cmd locally from the Nagios server it works fine. We use this same command to monitor CPU, RAM, and disk space.
Thanks.
Re: check_nt broken
Posted: Mon Aug 15, 2011 11:33 am
by lmiltchev
Go to the Core Config Manager, click on "Services", find your service (check CPU), and click on the "Download" Action button (diskette icon). Open the file and examine your check command. You should see the password you are using. Is it the same password that you enter when running the check from the command line?