check_nt broken

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

check_nt broken

Post 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
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: check_nt broken

Post 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.
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: check_nt broken

Post by tgfde »

From the NSClient log:

2011-08-11 14:38:45: debug:NSClient++.cpp:1143: 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:1106: Injecting: CheckDriveSize: D, nsclient
2011-08-11 14:38:45: debug:NSClient++.cpp:1142: Injected Result: OK '85422608384&107364544512'
2011-08-11 14:38:45: debug:NSClient++.cpp:1143: 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 ($).
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nt broken

Post 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:

Code: Select all

password=mypassword
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

Code: Select all

; password=mypassword
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: check_nt broken

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nt broken

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: check_nt broken

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_nt broken

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked