Page 1 of 1

Auto-Discovering Datastores and ESX hosts in VMware

Posted: Wed May 21, 2014 12:19 pm
by barathia
I have configured VMware monitoring of vcenter and esx hosts.

I used the following wizard for it. http://exchange.nagios.org/directory/Ad ... rd/details

Now in this wizard I have to enter the name of the Datastore to config a check for it.

I am able to use the auto-discovery to detect esx hosts but not Datastores (since they don't have an IP address associated with them)

In this case how can I auto-detect datastore and esx hosts given the vcenter server?

At this point I am open to options.

Kind regards.

Re: Auto-Discovering Datastores and ESX hosts in VMware

Posted: Wed May 21, 2014 1:13 pm
by slansing
Are you talking about running that specific wizard against them? Or using the actual "Auto-Discovery" wizard? They are two completely different tools. In either case, as far as Datastores go, I know for a fact that the new box293 virtualization monitoring plugin can check datastores, he is currently working on a wizard, but if you wanted to manually add the checks for some of the more intricate and specific devices/systems/vm's you would like to check I'd highly recommend following his documentation:

http://exchange.nagios.org/directory/Pl ... re/details

Re: Auto-Discovering Datastores and ESX hosts in VMware

Posted: Wed May 21, 2014 2:09 pm
by barathia
Hi slansing

Thanks for that I can see that the VMA with box293 approach can monitor a lot more I like this approach, but when I went through the document I see the same problem.

Say we have 100+ Datastores and 100+ esx hosts. They change often in our environment. They are very dynamic more like in a cloud environment but not cloud.

How are we going to detect these changing ESX Hosts and Datastores and how can we add and delete relevant ESX hosts and Datastores as they change. The request is to make these checks auto configured.

I have already configured checks and added them to a single host_group that way when an esx host is added to the hostgroup they will obtain all relevant checks we require, likewise when a datastore is added with will obtain its relevant check..

The problem is how can I discover datastores or ESX host be discovered. As I must refer to Vcenter and add it nagios. Wondering if nagios can detect it these changes (ESX Host and Datastores) in vcenter and we can use that to auto-configure.

My question was more on the auto-discovery part.

Many thanks.

Re: Auto-Discovering Datastores and ESX hosts in VMware

Posted: Wed May 21, 2014 2:39 pm
by barathia
I had been looking at how I am going to find the results of auto discovery and I did found the place. Its located in

/usr/local/nagiosxi/html/includes/components/autodiscovery/jobs

I can grep the hostname of new servers from here and add it into hostname.cfg which will be placed in the /usr/local/nagios/etc/import/ directory. That way I can automate it.

But the problem remains on how I can discover when a datastore is added or removed.

Kind regards

Re: Auto-Discovering Datastores and ESX hosts in VMware

Posted: Wed May 21, 2014 2:52 pm
by sreinhardt
At this point to discover if a datastore was added\removed, you would need to have a script that is able to query the available datastores and store the last result for comparison. Then if a change was made, it must have the logic to either alert you or make the needed config changes and apply config. I do not believe anything, short of maybe box263's agent would have any of this logic presently.

Re: Auto-Discovering Datastores and ESX hosts in VMware

Posted: Wed May 21, 2014 5:05 pm
by barathia
thanks very much sreinhardt

I think I will look into those options. We can close it here.

many thanks.