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.
I am trying to setup check on my datastore through my esxi host using the vmfs command.
i have installed the plugin and created the commands, however im getting the following error in my command output:
[root@myserver01 ~]# /usr/local/nagios/libexec/check_vmfs.sh -S #.#.#.# -V /vmfs/volumes/VM-10GDATASTORE-1
which: no vmkfstools in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
CRITICAL - /usr/local/nagios/libexec/check_vmfs.sh: line 161: --username: command not found
Thanks
Last edited by dwhitfield on Thu Oct 06, 2016 1:58 pm, edited 1 time in total.
Reason:adding code blocks
==============
WHAT
===============
This Nagios Plugin gets the size (Kb, Mb, Gb) of the vmfs volumes (datastores) of a VMWare Server Esxi 4.x/5.x.
The VMWare VCLI must be installed and configured on the Nagios server (in my case, an Ubuntu server guest, inside the VMWare Server ESxi host), because we do use of the binary "vmkfstools" for getting the data.
Warning and critical levels can be set, and plugin gives us perfdata output too, so it can be graphed with graphical tools as pnp4nagios, besides the usual Nagios states (OK, WARNING and CRITICAL).
============================
PREREQUISITES & INSTALLATION
============================
VMWare Esxi 4.x/5.x
-------------------
1) For the check_vmfs.sh plugin to work, it needs VMWare VCLI installed. You can get it for free, after registration, here:
https://my.vmware.com/web/vmware/details?downloadGroup=VSP510-VCLI-510&productId=285
2) Besides the standard commands of any Linux's flavours (grep, cut, cat, rm & awk) we need to install the bc application, which
is used to work with fractionnary numbers in unit conversion tasks. it's found in standard repositories so, in a debian based Linux
just type:
$ apt-get install bc
3) To check into the server automatically, we need the credentials of the VMWare ESXi servers stored in a single config file.
By default it could be stored in nagios plugin path:
/usr/local/nagios/libexec/vmware_esxi_conf.txt
and this txt file should have, at least, these fields:
# VMWARE_SERVER1 USER1 PASSWORD1
# VMWARE_SERVER2 USER2 PASSWORD2
This file should be, by security, in 600 mode, and owner and group of Nagios user.
By Example:
chown vmware_esxi_conf.txt
chmod 600 vmware_esxi_conf.txt
4) check_vmfs.sh is placed in plugins Nagios path=>/usr/local/nagios/libexec
5) Checking if nagios default path is /usr/local/nagios/var. Script needs to create a file there called check_vmfs.err to handle errors.
If Nagios is installed in other place, just change this line in script:
ERR_LOG=/usr/local/nagios/var/check_vmfs.err
to your default nagios installation directory.
okay so some progress
i ran #yum install perl-CPAN -y
then reran the ./vmware-install.pl, this time it ran but returned a different error
"http_proxy not set. please set environment variable 'http_proxy' e.g. export
http_proxy=http://myproxy.mydomain.com:0000 .
ftp_proxy not set. please set environment variable 'ftp_proxy' e.g. export
ftp_proxy=http://myproxy.mydomain.com:0000."
does this need to be set?
and running the check_vmfs.sh command still gives an error:
/usr/local/nagios/libexec/check_vmfs.sh -S 10.10.10.81 -V /vmfs/volumes/VM-10GDATASTORE-1
which: no vmkfstools in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
CRITICAL - /usr/local/nagios/libexec/check_vmfs.sh: line 161: --username: command not found