Page 1 of 1

WMI AUTH with text file not working on windows WMI wizard

Posted: Mon Oct 10, 2016 6:40 pm
by williama
The environment is a naxios XI image deployed to VMware.
We are busy with a POC to determine if the product is suitable.

When I set up a windows wmi server for monitoring with the credentials in a text file the tool complains about permissions.
The file is under /home/nagios/.oppas and it is owned by apache and nagios.

When I set the check up with the normal wmi with the credentials typed out the host communication and the setup works but the checks fail due to syntax issues.

As the password complexity rules are quite strict the password does contain a ! .

When I then manually edit these checks and I point them at the credentials file they work fine, so permissions do not seem to be an issue.

Is there a specific location or permission set required on the wmi auth files ?

Unfortunately we have hundreds of windows hosts so manually fixing every service check is not an option.

Re: WMI AUTH with text file not working on windows WMI wizar

Posted: Tue Oct 11, 2016 2:16 pm
by rkennedy
When I set up a windows wmi server for monitoring with the credentials in a text file the tool complains about permissions.
The file is under /home/nagios/.oppas and it is owned by apache and nagios.
Where do you see this error? Could you show us a screenshot? If it was the wizard, it may have been permissions in the /home/nagios directory.

Are you able to get it working over the CLI as the nagios user? For example -

Code: Select all

[nagios@localhost libexec]$ ./check_wmi_plus.pl -H 192.168.47.8 -u 'wmiagent' -p 'wm14gent.' -m checkmem
OK - Physical Memory: Total: 4GB - Used: 614.051MB (15%) - Free: 3.4GB (85%)|'Physical Memory Used'=643878912Bytes; 'Physical Memory Utilisation'=15%;
What are the full permissions on your auth file? ls -la /home/nagios/.oppas

Re: WMI AUTH with text file not working on windows WMI wizar

Posted: Tue Oct 11, 2016 7:14 pm
by williama
[root@localhost ~]# ls -la /home/nagios/.oppass
-r--r----- 1 apache nagios 50 Oct 10 12:51 /home/nagios/.oppass

Re: WMI AUTH with text file not working on windows WMI wizar

Posted: Tue Oct 11, 2016 7:44 pm
by williama
Good morning

When I do the operations manually as the nagios user they work.

[nagios@localhost ~]$ whoami
nagios
[nagios@localhost ~]$ /usr/local/nagios/libexec/check_wmi_plus.pl -H 172.21.32.28 -A /home/nagios/.oppass -m checkprocess -s Commandline -a 'notepad.exe' -c ItemCount=1
OK - Found 0 Instance(s) of "notepad.exe" running (0 excluded). |'Process Count'=0; 'Excluded Process Count'=0;
[nagios@localhost ~]$ /usr/local/nagios/libexec/check_wmi_plus.pl -H 172.21.32.28 -u 'YOUI/username' -p 'complicated!@#password' -m checkprocess -s Commandline -a 'notepad.exe' -c ItemCount=1
OK - Found 0 Instance(s) of "notepad.exe" running (0 excluded). |'Process Count'=0; 'Excluded Process Count'=0;
[nagios@localhost ~]$

The issue comes in when running the configuration wizard.

The screenshots for those have been posted below.
nagios issue screenshots.pdf
Regards

Re: WMI AUTH with text file not working on windows WMI wizar

Posted: Wed Oct 12, 2016 10:43 am
by rkennedy
This makes sense, as the actual checks will run as the nagios user. The problem here, is that the wizard is using the apache user, to try and access the /home/nagios folder. You would need to open the permissions up on this directory.

Could you either A. Move the file into a folder which all users have access, or B. Change permissions of the /home/nagios folder and let us know if that helps?

Re: WMI AUTH with text file not working on windows WMI wizar

Posted: Wed Oct 12, 2016 6:22 pm
by williama
Good Morning,

That resolved the issue.
And that makes perfect sense.

Thank you for that.

So these files should be accessible by user apache and nagios?

The reason I ask is because they contain credentials the access to them should be restricted as much as possible.

Regards
William

Re: WMI AUTH with text file not working on windows WMI wizar

Posted: Thu Oct 13, 2016 10:21 am
by avandemore
If it's only the single file in question, you can just change ownership to of the file to apache:nagios perms 640 . For multiple files create a directory and give the appropriate perms.