WMI_Authorization_File

This board serves as an open discussion and support collaboration point for Nagios XI. NOTE: Nagios XI customers should use the Customer Support forum to obtain expedited support.

Re: WMI_Authorization_File

Postby lmiltchev » Fri Oct 25, 2019 1:16 pm

Have you tried changing your password to something simple (no special characters)?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

Re: WMI_Authorization_File

Postby mamir » Mon Oct 28, 2019 2:58 pm

Yes i have made this password below, still the same error message. Please, help

WELcome12345678
mamir
 
Posts: 57
Joined: Tue Mar 12, 2019 9:50 am

Re: WMI_Authorization_File

Postby lmiltchev » Mon Oct 28, 2019 4:52 pm

Can you run the following commands from the command line, and show the output?

Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H <ip address> -u 'test.account' -p 'WELcome12345678' -m checkcpu -w '80' -c '90'
/usr/local/nagios/libexec/check_wmi_plus.pl -H <ip address> -A /usr/local/nagios/etc/authorization.txt -m checkcpu -w '80' -c '90'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

Re: WMI_Authorization_File

Postby mamir » Tue Oct 29, 2019 10:36 am

Attachment.
Attachments
Capture10.JPG
mamir
 
Posts: 57
Joined: Tue Mar 12, 2019 9:50 am

Re: WMI_Authorization_File

Postby mamir » Tue Oct 29, 2019 10:52 am

Please, keep in mind, when I try it the normal way, putting in username & password. It works perfectly fine, so there is no issues with the permission from the server side neither the credentials issue. It just this file method of authentication not working.
mamir
 
Posts: 57
Joined: Tue Mar 12, 2019 9:50 am

Re: WMI_Authorization_File

Postby lmiltchev » Tue Oct 29, 2019 11:23 am

I am not sure what you mean by "normal" way... It's totally normal to test your checks from the command line, and they should work... If they don't, this means that you are either using a wrong credentials or you don't have sufficient permissions.

Example of a working check from the command line (with username/password and an auth file):
Code: Select all
[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_wmi_plus.pl -H x.x.x.x -u 'my username' -p 'my password' -m checkcpu -w '80' -c '90'
OK (Sample Period 13 sec) - Average CPU Utilisation 9.75%|'Avg CPU Utilisation'=9.75%;80;90;

[root@main-nagios-xi libexec]# /usr/local/nagios/libexec/check_wmi_plus.pl -H x.x.x.x -A /usr/local/nagios/etc/authorization.txt -m checkcpu -w '80' -c '90'
OK (Sample Period 3 sec) - Average CPU Utilisation 0.37%|'Avg CPU Utilisation'=0.37%;80;90;
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

Re: WMI_Authorization_File

Postby mamir » Tue Oct 29, 2019 1:58 pm

The credentials are correct, by normal way I meant is to use the Auth Info method instead of the file. The same exact credentials works fine when using the Auth Info method, but same exact credentials don't work when using the file method. Do you think the file created not correctly or format is not correct? I created file by simply right clicking in the directory and create a text file. Please help.
mamir
 
Posts: 57
Joined: Tue Mar 12, 2019 9:50 am

Re: WMI_Authorization_File

Postby lmiltchev » Tue Oct 29, 2019 2:29 pm

It is possible that the format (EOL) of the auth file is set to "dos", not "unix", which can cause issues. Open the auth file in "vi" text editor:
Code: Select all
vi /usr/local/nagios/etc/authorization.txt

type:
Code: Select all
:set ff?

and hit "Enter". You should see:
Code: Select all
fileformat=unix

If you see "dos", then you would need to fix it by typing:
Code: Select all
:set ff=unix

and hitting "Enter", then save and exit by typing:
Code: Select all
:wq

and hitting "Enter".

You could also set line endings to "unix" via Notepad++ (if you have a GUI).

Edit > EOL Conversion > Unix (LF)

Note: Having said that, I would like to mention this again - if you check is NOT working when using " -u 'my username' -p 'my password' " this means it is NOT going to work with the auth file either... if you are using the same credentials that is. This check must work from the CLI:
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H <ip address> -u 'test.account' -p 'WELcome12345678' -m checkcpu -w '80' -c '90'

It was not working for you. Please double check your credentials. If your user is on a domain, you may need to use:
Code: Select all
/usr/local/nagios/libexec/check_wmi_plus.pl -H <ip address> -u 'domain\test.account' -p 'WELcome12345678' -m checkcpu -w '80' -c '90'
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

Re: WMI_Authorization_File

Postby mamir » Tue Oct 29, 2019 3:00 pm

Please, see the attachment.

I followed the instruction, I saw the format was fileformat=unix. I'm thinking since the file was created manually by simply right click create a text file is it right method? also at the end I have extension as .txt is it correct as well? What permissions should be setup on the authorization file itself?
Attachments
Capture11.JPG
mamir
 
Posts: 57
Joined: Tue Mar 12, 2019 9:50 am

Re: WMI_Authorization_File

Postby lmiltchev » Tue Oct 29, 2019 3:23 pm

Here's the permissions of the auth file on my test Nagios XI server:
Code: Select all
[root@main-nagios-xi libexec]# ll /usr/local/nagios/etc/authorization.txt
-rw-rw-r-- 1 apache nagios 37 Oct 28 16:12 /usr/local/nagios/etc/authorization.txt

I don't think this is your issue though... In the screenshot you posted, you are not even using the auth file, and your check is still failing. Please, review the KB article below on WMI troubleshooting:

https://support.nagios.com/kb/article/nagios-xi-wmi-troubleshooting-579.html

This is a good starting point for dealing with WMI issues.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 12681
Joined: Mon May 23, 2011 12:15 pm

Previous

Return to Nagios XI

Who is online

Users browsing this forum: No registered users and 17 guests