Monitoring of Data Store in VCenter

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Monitoring of Data Store in VCenter

Post 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 ?
kyang

Re: Monitoring of Data Store in VCenter

Post 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
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Monitoring of Data Store in VCenter

Post 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?
kyang

Re: Monitoring of Data Store in VCenter

Post 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
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Monitoring of Data Store in VCenter

Post 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.
kyang

Re: Monitoring of Data Store in VCenter

Post 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?
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Monitoring of Data Store in VCenter

Post by amitgupta19 »

@ kyang: version is as follows:

0.5.0
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring of Data Store in VCenter

Post 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?
^^
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Monitoring of Data Store in VCenter

Post by amitgupta19 »

please find attached the screenshot attached for the command that i am using.
Attachments
Command for the VCenter
Command for the VCenter
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Monitoring of Data Store in VCenter

Post 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.
Former Nagios employee
https://www.mcapra.com/
Locked