Page 1 of 2

Monitoring of Data Store in VCenter

Posted: Thu Feb 15, 2018 10:30 am
by amitgupta19
Hi All,

I am trying to monitor the Datastore for the VCenter. But it is giving the following error:

CHECK_ESX3.PL CRITICAL - Can't use an undefined value as an ARRAY reference at /usr/lib/nagios/plugins/check_esx3.pl line 2999.

Can any one suggest the pointers ?

Re: Monitoring of Data Store in VCenter

Posted: Thu Feb 15, 2018 4:43 pm
by kyang
What OS are you using?

What is the full command you are running to monitor the Datastore? What is the size?

Also what version of the check_esx3.pl plugin do you have?

Code: Select all

/usr/lib/nagios/plugins/check_esx3.pl -V

Re: Monitoring of Data Store in VCenter

Posted: Wed Mar 14, 2018 10:36 am
by amitgupta19
I only installed the NSClient++ on the VCenter.

Do i need to do any other steps for configuration, so that it works fine?

Do you have some defined steps which needs to be followed for configuring the monitoring?

Re: Monitoring of Data Store in VCenter

Posted: Thu Mar 15, 2018 10:40 am
by kyang
Are you only looking to monitor Data Store?

There may be a plugin specifically for checking data store on our Nagios Exchange.
https://exchange.nagios.org/directory/P ... nts/VMWare

Otherwise, we do have a doc on monitoring VMware if you wanted to use the check_esx3.pl plugin. (It says Nagios XI, but Nagios Core would just be creating the checks manually)
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Re: Monitoring of Data Store in VCenter

Posted: Thu Mar 15, 2018 11:07 am
by amitgupta19
@kyang : Thanks for the clarification.

I would like to inform you that, the Nagios Core setup that i am using is already monitoring the some VCenters.

But i don't know what was done to monitor the previous VCenters, as it was setup by our client.

Now i need to configure the monitoring for another VCenter.

Also Document does not guide about what changes i have to do on the Remote Host which needs to be monitored.

So i am looking for the steps which tells about what needs to be done on the remote host.

Re: Monitoring of Data Store in VCenter

Posted: Thu Mar 15, 2018 1:09 pm
by kyang
Oh okay. Thanks for letting me know. Since you are already monitoring some VCenters, then no worries.

Back to your original post.

What version of the check_esx3.pl plugin are you on?

Code: Select all

/usr/lib/nagios/plugins/check_esx3.pl -V
CHECK_ESX3.PL CRITICAL - Can't use an undefined value as an ARRAY reference at /usr/lib/nagios/plugins/check_esx3.pl line 2999
Also, what is the command you are using when you received this error?

Re: Monitoring of Data Store in VCenter

Posted: Fri Mar 16, 2018 6:36 am
by amitgupta19
@ kyang: version is as follows:

0.5.0

Re: Monitoring of Data Store in VCenter

Posted: Fri Mar 16, 2018 1:54 pm
by scottwilkerson
kyang wrote:
CHECK_ESX3.PL CRITICAL - Can't use an undefined value as an ARRAY reference at /usr/lib/nagios/plugins/check_esx3.pl line 2999
Also, what is the command you are using when you received this error?
^^

Re: Monitoring of Data Store in VCenter

Posted: Mon Mar 19, 2018 6:59 am
by amitgupta19
please find attached the screenshot attached for the command that i am using.

Re: Monitoring of Data Store in VCenter

Posted: Tue Mar 20, 2018 7:11 pm
by mcapra
It looks as though the datacenter is not returning any datastores. The 0.7.1 version of the plugin seems to have added handling for this condition:

Code: Select all

sub dc_list_vm_volumes_info
{
	my ($np, $subcommand, $blacklist, $perc, $addopts) = @_;

	my $host_views = Vim::find_entity_views(view_type => 'HostSystem', properties => ['name', 'datastore']);
	die "Runtime error\n" if (!defined($host_views));
	die "Datacenter does not contain any hosts\n" if (!@$host_views);

	my @datastores;
	foreach my $host (@$host_views)
	{
		push(@datastores, @{$host->datastore});
	}
	return datastore_volumes_info(\@datastores, $np, $subcommand, $blacklist, $perc, $addopts);
}
You might try using the 0.7.1 version of the plugin, but as the underlying function only has additional handling to detect if no datastores are returned. You might double check the permissions of the user you are hitting esx with or make sure the -D argument your service definition is passing via $ARG1$ is correct.