Page 1 of 3

Auth.txt Files Missing After Services Configs Imported

Posted: Thu May 17, 2018 12:18 pm
by Sarg0n
I recently upgraded our Nagios XI server and everything initially seems to be running beautifully after a steep learning curve but successful attempt at migrating hosts (thanks to you guys for helping me tremendously). However, there is still an issue happening for all the services running on our hosts. They all show Critical status and the Status Information states:

CHECK_ESX3.PL CRITICAL- Unable to open auth file "/usr/local/nagiosxi/etc/components/vmware/7.x.x.x_auth.txt"

(I "x"d out my IP info but it's the host auth.txt file)

I am not sure what role the auth.txt file plays but I am on a VMware platform with ESXi server. I am assuming this has something to do with it. When I tried to go to the directory where the auth.txt is, I can only go so far as /usr/local/nagiosxi/etc/components. The /vmware/host_auth.txt directory does not exist.

I am assuming that I need to move further configurations over maybe? Is this something I can simply create, as in make the /components/vmware directory for all of my hosts and create an auth.txt file with info? If so, what is included in the auth.txt file?

Thanks for your help.

Re: Auth.txt Files Missing After Services Configs Imported

Posted: Thu May 17, 2018 2:57 pm
by tgriep
Those auth files are where the username and password are stored for the check_esx3 plugin so it can authenticate to the VMWare servers.
If you want to create them, the following is an example of the permissions the file needs to have. (Adjust the name)

Code: Select all

-rw-r--r-- 1 apache nagios   45 Dec 14 12:49 192_168_1_1_auth.txt
And the contents of the username and password are as follows.

Code: Select all

username=vmwareusername
password=vmwarepassword

Any questions, let us know.

Re: Auth.txt Files Missing After Services Configs Imported

Posted: Fri May 18, 2018 7:04 am
by Sarg0n
So I changed the permissions to 644 and ownership to all of the auth.txt files after adding them in. I then changed the whole directory to the same permissions and ownership. It is still not able to read the file. Is there an internal log that I could watch to see why it's not reading it?

Re: Auth.txt Files Missing After Services Configs Imported

Posted: Fri May 18, 2018 8:09 am
by Sarg0n
Also, do I need to go further back in the directory for permissions and ownership? I even went back and tried 777 permissions but it's still not able to read the auth.txt file. What is trying to read it exactly, and maybe I need to change whatever that is to the correct ownership and permissions?

Re: Auth.txt Files Missing After Services Configs Imported

Posted: Fri May 18, 2018 9:27 am
by lmiltchev
Can you make sure that that name of the auth file includes the correct hostname? For example, if your host was named "VVMWARE_HOST", then the name of the auth file would be "VVMWARE_HOST_auth.txt".

Are there any special characters in the password?

Run the following commands and show the output:

Code: Select all

ls -lad /usr/local/nagiosxi/etc/components/vmware/
ls -la /usr/local/nagiosxi/etc/components/vmware/
file /usr/local/nagiosxi/etc/components/vmware/<hostname>_auth.txt
/usr/local/nagios/libexec/check_esx3.pl -H <ip address> -f "/usr/local/nagiosxi/etc/components/vmware/<hostname>_auth.txt" -l "CPU" -vvv

Re: Auth.txt Files Missing After Services Configs Imported

Posted: Fri May 18, 2018 9:58 am
by Sarg0n
I had to type this out because our Nagios XI server is on a secure network. There ARE special characters in the password, btw.

Here are the results:

Code: Select all

ls -lad /usr/local/nagiosxi/etc/components/vmware
drwxrwxrwx 2 apache nagios 4096 May 18 13:32 /usr/local/nagiosxi/etc/components/vmware
When I entered the command "ls -la /usr/local/nagiosxi/etc/components/vmware", I received all of the files in the vmware directory shown with all of the same permissions: rwxrwxrwx and same ownership of "apache nagios". (There are too many files to type, sorry I couldn't snip and send)

Code: Select all

file /usr/local/nagiosxi/etc/components/vmware/7.x.x.x_auth.txt
/usr/local/nagiosxi/etc/components/vmware/7.x.x.x_auth.txt: ASCII text

Code: Select all

/usr/local/nagios/libexec/check_esx3.pl -H 7.x.x.x -f "/usr/local/nagiosxi/etc/components/vmware/7.x.x.x_auth.txt" -l "CPU" -vvv
[extra-opts] check_esx3.pl -H 7.x.x.x -f /usr/local/nagiosxi/etc/components/vmware/7.x.x.x_auth.txt -l CPU -vvv CHECK_ESX3.PL CRITICAL - Unable to open auth file "/usr/local/nagiosxi/etc/components/vmware/7.x.x.x_auth.txt"

Re: Auth.txt Files Missing After Services Configs Imported

Posted: Fri May 18, 2018 10:53 am
by lmiltchev
Do you see any errors in the output, when you run following commands?

Code: Select all

sudo su nagios -c 'ls -al /usr/local/nagiosxi/'
sudo su nagios -c 'ls -al /usr/local/nagiosxi/etc/'
sudo su nagios -c 'ls -al /usr/local/nagiosxi/etc/components/'
sudo su nagios -c 'ls -al /usr/local/nagiosxi/etc/components/vmware/'
sudo su nagios -c 'cat /usr/local/nagiosxi/etc/components/vmware/7.x.x.x_auth.txt'
I noticed that the permissions on the vmware directory are missing the "s", which sets user or group ID on execution...

Yours are:

Code: Select all

drwxrwxrwx 2 apache nagios 4096 May 18 13:32 /usr/local/nagiosxi/etc/components/vmware
and mine are:

Code: Select all

drwsrwsr-x 2 apache nagios 4096 May 18 10:32 /usr/local/nagiosxi/etc/components/vmware
You can fix the permissions by running:

Code: Select all

chmod ug+s /usr/local/nagiosxi/etc/components/vmware
Also, I've seen the same errors (long time ago) with an older vmware wizard and plugin. Can you go to the Admin > Manage Config Wizards, and click on "Check for Updates"? If you see a new version of the vmware wizard, install it. This should also update the plugin. Restart apache:

Code: Select all

service httpd restart
and test your check again from the command line.

Let us know if this helped.

Re: Auth.txt Files Missing After Services Configs Imported

Posted: Fri May 18, 2018 12:33 pm
by Sarg0n
When I run the ls commands in the first code snippet, I see no errors other than some of the directories show "nagios nagios" instead of "apache nagios" as the owners.

I am unable to check for updates; my server is offline on a closed network. Do you have the link to the newest version that I could download?

Re: Auth.txt Files Missing After Services Configs Imported

Posted: Fri May 18, 2018 12:55 pm
by Sarg0n
Actually I found the VMware plugin online but it's from 2012. Not sure where to go from here. I don't understand why the ESX3.pl file can't see the auth.txt files. It doesn't make any sense to me at all.

Re: Auth.txt Files Missing After Services Configs Imported

Posted: Fri May 18, 2018 1:14 pm
by Sarg0n
btw, this is a new upgrade, so whatever plugins come with 5.4.13 is what is on there.