Skip to content Skip to sidebar Skip to footer

vmware nagios plugin Component installation failed. Uploaded zip file is not a component.

In this document, We see all necessary steps to monitor an ESXi host, We come across the nigh common parameters and values ​​that we can get to take a controlled environment by Nagios and Centreon! It's amazing all the information that we obtain! In other documents nosotros'll see other info we can get from vCenter and MVs, now play hosts!

Installation requirements,

Offset nosotros start installing all the necessary requirements to use one of the most common scripts we can employ. In Nagios Exchange We can go near any script nosotros need, and then nosotros after unload one that I unremarkably use to monitor ESXi four.x hosts, 5.x o 6.10. But before you have to install nagios machine in VMware SDK and everything you lot need before.

After having installed all requirements and proven to work the script to monitor ESXi servers, we can and leave console and use the Centreon interface to create ESXi hosts, services will monitor and the necessary commands. I hope you sympathize each other well, follow the steps!

Installing the requirements:

yum -y install openssl-devel perl-Archive-Zip perl-Form-MethodMaker uuid-perl perl-Lather-Low-cal perl-XML-SAX perl-XML-NamespaceSupport perl-XML-LibXML perl-MIME-Light perl-MIME-Types perl-MailTools perl-TimeDate uuid libuuid perl-Data-Dump perl-UUID make gcc perl-devel libuuid-devel cpan

We search web VMware downloads, el vSphere SDK para Perl, We download the gz package 64 chip.

We got on the Nagios server using WinSCP for example and leave it in the temporary directory '/ tmp /'. We unpack and install:

tar xvzf VMware-vSphere-Perl-SDK-xxxxxxx.tar.gz cd vmware-vsphere-cli-distrib/ ./vmware-install.pl

Nosotros installed with the default settings,

And later on a few seconds you have installed,

Instalamos UUID:

cd /usr/src wget http://search.cpan.org/CPAN/authors/id/J/JN/JNH/UUID-0.04.tar.gz tar -xzvf UUID-0.04.tar.gz -C /opt

compile it:

cd /opt/UUID-0.04 perl Makefile.PL make

And installed, and 'perl-Nagios-Plugin' also it is necessary:

brand install yum install perl-Nagios-Plugin

Install more requirements:

cpan GAAS/libwww-perl-5.837.tar.gz

And we're running with the latter!

cpan Monitoring::Plugin

At last, and nosotros tin download the script that will permit united states to obtain data from hosts here https://commutation.nagios.org/directory/Plugins/Operating-Systems/*-Virtual-Environments/VMWare/check_vmware_api/details in one case downloaded exit file 'check_vmware_api.pl' en '/usr/lib/centreon/plugins/' and we volition executable 'chmod + x check_vmware_api.pl'. We will endeavour to execute it and if everything is right nosotros will become this screen indicating the options that we tin use.

Creating a user with privileges on ESXi,

El script inductive, y'all need to be validated against the ESXi host to get the information that interests u.s., therefore we create a user in each ESXi and give the necessary permissions.

In each ESXi, loguearnos after using the traditional client or web browser, we go to the expanse "Users" and we create 1, you'll also set the password.

In the tab "permissions", add this user to all possible field, and will add the role of 'Read-But'.

Now, We create the directory that interests us (I leave in the same plugins) a file, where users will store and password to validate the command when y'all employ the checkeos. In this example I go on in '/usr/lib/centreon/plugins/check_vmware_api.auth' the following format:

username=usuario password=Contraseña

And we can run any checkeo against an ESXi host, something elementary to try, CPU usage:

./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -l cpu -s usage -w eighty -c 90

The parameters accompanying the command are described beneath all, In the above command '-w' will be the % warning when Warning and '-c' when the value is critical. I mention this to you because information technology is mutual in almost all commands, and everyone who wants to apply the varemos, these documents yous will detect that commonly when you reach the lxxx% Alert will be something and when y'all reach the 90% Critical will be.

Now all that remains is to cull items that nigh interested us monitor, at the end of the document I will put all the possibilities that gives us this excellent control 'check_vmware_api.pl'. But for at present the most mutual examples I put to monitor information from an ESXi host:

Employ of Retentiveness RAM:

./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -l mem -s usage -w lxxx -c 90

Bandy Retention Usage

./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -fifty mem -southward swap -due west 1 -c ten

Retentiveness Usage Balloning

./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -fifty mem -s memctl -w ane -c 10

Network usage

./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -l net -s usage -w 10240 -c 102400

NIC observe if we have fallen,

./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -fifty cyberspace -s nic -west 1 -c two

VMFS datastores monitor, in this, the control returns the free apply, so indicate the following format in the Critical and Warning % clearance,

./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -50 vmfs -s LUN04 -w 10%: -c 5%:

For example with the parameter 'runtime' we will come across an overview of the server, and optionally we can add other options like 'health' for health, 'temperature' for the temperature sensors, o 'status' to see a summary among others.

./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -l runtime ./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -l runtime -s health ./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -l runtime -s temperature ./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -50 runtime -s status

If we use the parameter 'service' nosotros tin can meet the status of all ESXi services if they are running or non, and additionally we can add the name of the services that nosotros are interested merely monitor.

./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -l service ./check_vmware_api.pl -H SERVIDOR_ESXI -f check_vmware_api.auth -fifty service -due south DCUI vpxa

For at present I think it is worth us, no? Ya que el script 'check_vmware_api.pl' has still many things you tin can look effectually and we'll see other posts, Information technology would also be Clústers us to monitor hosts, Data Centers, Virtual machines, etc… another solar day ;), At present nosotros proceed with the hosts!

By creating a host,

Here at last nosotros volition already loftier in Nagios our showtime server, ESXi host! We will employ Centreon to facilitate all the work.

Since "Configuration" > "Hosts" > "Add", Nosotros add together our kickoff server, will complete at least the following fields:

  • Name: Server Name.
  • Alias: Alias ​​Server.
  • IP Address / DNS: The IP accost or DNS proper noun server.
  • SNMP Community & Version: In this case information technology would not be necessary.
  • Monitored from: The poller that will monitor this host.
  • Template: Seleccionamos 'generic-agile-host'.

By creating a Command,

Centreon define a command using variables to execute the commands we saw before, This command will so exist called from every service we to monitor CPU, RAM… What better than to see information technology to understand information technology 🙂

I commonly like to call the control like the script, because, In this example I will create the 'check_vmware_api.pl' command. For it, since "Configuration" > "Commands" > "Checks" > "Add". We indicate that it is a blazon command 'Cheque' and the 'Command line indicate':

$CENTREONPLUGINS$/check_vmware_api.pl -H $HOSTADDRESS$ -f $CENTREONPLUGINS$/check_vmware_api.auth -l $ARG1$ -s $ARG2$ -w $ARG3$ -c $ARG4$
  • La variable $CENTREONPLUGINS$ es '/usr/lib/centreon/plugins/'
  • The variable $ HOSTADDRESS $ would be the IP accost or FQDN server name to exist monitored.
  • ARG1 would be the offset argument that you lot laissez passer, if we retrieve you are the 'Command' which indicated subsequently '-l'.
  • ARG2 would exist the first argument that you lot laissez passer,if we remember it is the 'subcommand' which it indicated after '-s'.
  • ARG3 is the value of Warning.
  • ARG4 is the value of Critical.

click on "Depict arguments" to avoid having to memorize and know this.

So we acquaintance a unproblematic way what each statement, then when we believe services, I appreciate. "Salvage".

Creating services,

Here and we tin can finally create what services you lot want to monitor, sea CPU, RAM, NICs caidas, condition of datastores… for it, we will build as we said in the command y'all only created! Wait how easy:

In "Configuration" > "Services" > "Add", we will create our kickoff service! Will make full at to the lowest degree the following information:

  • Description: Service proper name, in my example CPU, Memoria RAM, Memoria Bandy…
  • Linked with Hosts: Here we add the host that nosotros created earlier, our server ESXi.
  • Template: Seleccionamos 'generic-active-service'.
  • Check Control: We choose the command that nosotros created earlier also, in my case to call the script every bit' check_vmware_api.pl'
  • arguments: We fill up all the arguments that we ask the command.
    • CPU usage: cpu / usage / 80 / 90
    • Memoria RAM: Mem / usage / lxxx / 90
    • Memoria Swap: Mem / swap / ane / 10
    • Memoria Balloning: Mem / memctl / one/ 10
    • Status NIC: net / zippo / one / two

recorded with "Save",

In social club to create other services, rather than create them all from scratch, be equally comfortable as duplicate, then nosotros'll merely edit the arguments and will be much easier to create services.

Once you have created all associated services to a ESXi host, if we now indistinguishable the work done to monitor another ESXi host that we, or all that nosotros, considering from "Configuration" > "Hosts", select the ESXi we accept and what nosotros double, with that generate a new host, that we have to alter the name, Allonym ​​and IP address and we will have another host ready with the same services!

And cipher, every bit usual, Upon completion piece of work, salvage changes, Cenreon generate nagios files necessary, "Configuration" > "Pollers" > "Export configuration",

We select our poller, we marker the checks and restart & "Export",

Once generated all, and we can go to the role of monitoring and checking that everything we've done works! Nosotros see all new services we have created that monitor dissimilar things. If we forcefulness the checkeo, we already know, Nosotros select the services that interest us and the philharmonic select 'Services – Schedule immediate check (Forced)'.

And hither are all the possibilities for command:

Usage: check_vmware_api.pl -D <data_center> | -H <host_name> [ -C <cluster_name> ] [ -N <vm_name> ]     -u <user> -p <pass> | -f <authfile>     -l <command> [ -s <subcommand> ] [ -T <timeshift> ] [ -i <interval> ]     [ -x <black_list> ] [ -o <additional_options> ]     [ -t <timeout> ] [ -w <warn_range> ] [ -c <crit_range> ]     [ -V ] [ -h ]  -?, --usage    Print usage information  -h, --aid    Impress detailed assist screen  -V, --version    Print version information  --extra-opts=[@file] Read options from an ini file.    for usage and examples.  -H, --host=<hostname>    ESX or ESXi hostname.  -C, --cluster=<clustername>    ESX or ESXi clustername.  -D, --datacenter=<DCname>    Datacenter hostname.  -Due north, --name=<vmname>    Virtual machine name.  -u, --username=<username>    Username to connect with.  -p, --password=<password>    Countersign to use with the username.  -f, --authfile=<path>    Authentication file with login and countersign. File syntax :    username=<login>    countersign=<password>  -w, --warning=THRESHOLD    Alarm threshold. Come across    for the threshold format. By default, no threshold is prepare.  -c, --critical=THRESHOLD    Critical threshold. See    for the threshold format. By default, no threshold is set.  -l, --command=Command    Specify control type (CPU, MEM, NET, IO, VMFS, RUNTIME, ...)  -due south, --subcommand=SUBCOMMAND    Specify subcommand  -S, --sessionfile=SESSIONFILE    Specify a filename to store sessions for faster authentication  -x, --exclude=<black_list>    Specify black list  -o, --options=<additional_options>    Specify additional control options (quickstats, ...)  -T, --timestamp=<timeshift>    Timeshift in seconds that could set issues with "Unknown error". Use values like 5, 10, 20, etc  -i, --interval=<sampling menses>    Sampling Period in seconds. Basic historic intervals: 300, 1800, 7200 or 86400. See config for whatever changes.    Supports literval values to autonegotiate interval value: r - realtime interval, h<number> - historical interval specified past position.    Default value is 20 (realtime). Since cluster does not take realtime stats interval other than 20(default realtime) is mandatory.  -M, --maxsamples=<max sample count>    Maximum number of samples to recall. Max sample number is ignored for historic intervals.    Default value is 1 (latest bachelor sample).  --trace=<level>    Set up verbosity level of vSphere API asking/reply trace  --generate_test=<file>    Generate a test instance script from the executed command/subcommand and write information technology to <file>.   If <file> is "stdout", the examination case script is written to stdout instead.  -t, --timeout=INTEGER    Seconds before plugin times out (default: xxx)  -5, --verbose    Show details for control-line debugging (can repeat up to 3 times) Supported commands(^ - blank or not specified parameter, o - options, T - timeshift value, b - blacklist) :     VM specific :         * cpu - shows cpu info             + usage - CPU usage in pct             + usagemhz - CPU usage in MHz             + look - CPU await time in ms             + ready - CPU ready time in ms             ^ all cpu info(no thresholds)         * mem - shows mem info             + usage - mem usage in percentage             + usagemb - mem usage in MB             + swap - bandy mem usage in MB             + swapin - swapin mem usage in MB             + swapout - swapout mem usage in MB             + overhead - additional mem used by VM Server in MB             + overall - overall mem used past VM Server in MB             + active - active mem usage in MB             + memctl - mem used past VM retentiveness control driver(vmmemctl) that controls ballooning             ^ all mem info(except overall and no thresholds)         * cyberspace - shows net info             + usage - overall network usage in KBps(Kilobytes per 2nd)             + receive - receive in KBps(Kilobytes per 2d)             + send - send in KBps(Kilobytes per 2nd)             ^ all net info(except usage and no thresholds)         * io - shows disk I/O info             + usage - overall disk usage in MB/s             + read - read disk usage in MB/s             + write - write disk usage in MB/s             ^ all disk io info(no thresholds)         * runtime - shows runtime info             + con - connection state             + cpu - allocated CPU in MHz             + mem - allocated mem in MB             + state - virtual machine country (UP, Down, SUSPENDED)             + status - overall object condition (grayness/light-green/red/yellow)             + consoleconnections - console connections to VM             + invitee - guest Bone status, needs VMware Tools             + tools - VMware Tools condition             + issues - all problems for the host             ^ all runtime info(except con and no thresholds)     Host specific :         * cpu - shows cpu info             + usage - CPU usage in percentage                 o quickstats - switch for query either PerfCounter values or Runtime info             + usagemhz - CPU usage in MHz                 o quickstats - switch for query either PerfCounter values or Runtime info             ^ all cpu info                 o quickstats - switch for query either PerfCounter values or Runtime info         * mem - shows mem info             + usage - mem usage in percentage                 o quickstats - switch for query either PerfCounter values or Runtime info             + usagemb - mem usage in MB                 o quickstats - switch for query either PerfCounter values or Runtime info             + swap - swap mem usage in MB                 o listvm - turn on/off output list of swapping VM'southward             + overhead - additional mem used past VM Server in MB             + overall - overall mem used past VM Server in MB             + memctl - mem used by VM memory control commuter(vmmemctl) that controls ballooning                 o listvm - turn on/off output listing of ballooning VM's             ^ all mem info(except overall and no thresholds)         * net - shows net info             + usage - overall network usage in KBps(Kilobytes per 2d)             + receive - receive in KBps(Kilobytes per Second)             + send - transport in KBps(Kilobytes per Second)             + nic - makes certain all active NICs are plugged in             ^ all internet info(except usage and no thresholds)         * io - shows deejay io info             + aborted - aborted commands count             + resets - bus resets count             + read - read latency in ms (totalReadLatency.average)             + write - write latency in ms (totalWriteLatency.average)             + kernel - kernel latency in ms             + device - device latency in ms             + queue - queue latency in ms             ^ all disk io info         * vmfs - shows Datastore info             + (name) - free infinite info for datastore with name (proper noun)                 o used - output used space instead of gratuitous                 o brief - list only alerting volumes                 o regexp - whether to treat name as regexp                 o blacklistregexp - whether to treat blacklist as regexp                 b - blacklist VMFS's                 T (value) - timeshift to detemine if we need to refresh             ^ all datastore info                 o used - output used space instead of complimentary                 o brief - list only alerting volumes                 o blacklistregexp - whether to care for blacklist as regexp                 b - blacklist VMFS's                 T (value) - timeshift to detemine if we demand to refresh         * runtime - shows runtime info             + con - connectedness state             + health - checks cpu/storage/retentivity/sensor status and propagates worst state                 o listitems - list all bachelor sensors(use for list purpose only)                 o blackregexpflag - whether to care for blacklist as regexp                 b - blacklist status objects             + storagehealth - storage condition check                 o blackregexpflag - whether to treat blacklist every bit regexp                 b - blacklist status objects             + temperature - temperature sensors                 o blackregexpflag - whether to treat blacklist as regexp                 b - blacklist condition objects             + sensor - threshold specified sensor             + maintenance - shows whether host is in maintenance style                 o maintwarn - sets warning state when host is in maintenance way                 o maintcrit - sets critical state when host is in maintenance mode             + list(vm) - listing of VMware machines and their statuses             + status - overall object status (greyness/green/red/yellow)             + issues - all issues for the host                 b - blacklist issues             ^ all runtime info(health, storagehealth, temperature and sensor are represented as one value and no thresholds)         * service - shows Host service info             + (names) - cheque the state of one or several services specified past (names), syntax for (names):<service1>,<service2>,...,<serviceN>             ^ show all services         * storage - shows Host storage info             + adapter - list charabanc adapters                 b - blacklist adapters             + lun - listing SCSI logical units                 b - blacklist LUN'due south             + path - list logical unit paths                 b - blacklist paths             ^ bear witness all storage info         * uptime - shows Host uptime                 o quickstats - switch for query either PerfCounter values or Runtime info         * device - shows Host specific device info             + cd/dvd - list vm's with attached cd/dvd drives                 o listall - list all bachelor devices(use for listing purpose merely)     DC specific :         * cpu - shows cpu info             + usage - CPU usage in percentage                 o quickstats - switch for query either PerfCounter values or Runtime info             + usagemhz - CPU usage in MHz                 o quickstats - switch for query either PerfCounter values or Runtime info             ^ all cpu info                 o quickstats - switch for query either PerfCounter values or Runtime info         * mem - shows mem info             + usage - mem usage in percentage                 o quickstats - switch for query either PerfCounter values or Runtime info             + usagemb - mem usage in MB                 o quickstats - switch for query either PerfCounter values or Runtime info             + bandy - bandy mem usage in MB             + overhead - boosted mem used past VM Server in MB             + overall - overall mem used by VM Server in MB             + memctl - mem used by VM memory control driver(vmmemctl) that controls ballooning             ^ all mem info(except overall and no thresholds)         * net - shows internet info             + usage - overall network usage in KBps(Kilobytes per 2nd)             + receive - receive in KBps(Kilobytes per Second)             + send - transport in KBps(Kilobytes per Second)             ^ all net info(except usage and no thresholds)         * io - shows disk io info             + aborted - aborted commands count             + resets - bus resets count             + read - read latency in ms (totalReadLatency.average)             + write - write latency in ms (totalWriteLatency.boilerplate)             + kernel - kernel latency in ms             + device - device latency in ms             + queue - queue latency in ms             ^ all deejay io info         * vmfs - shows Datastore info             + (proper noun) - costless space info for datastore with proper noun (name)                 o used - output used space instead of complimentary                 o cursory - list only alerting volumes                 o regexp - whether to treat name as regexp                 o blacklistregexp - whether to treat blacklist as regexp                 b - blacklist VMFS's                 T (value) - timeshift to detemine if we need to refresh             ^ all datastore info                 o used - output used space instead of gratuitous                 o brief - list just alerting volumes                 o blacklistregexp - whether to treat blacklist as regexp                 b - blacklist VMFS's                 T (value) - timeshift to detemine if we demand to refresh         * runtime - shows runtime info             + list(vm) - list of VMware machines and their statuses             + listhost - list of VMware esx host servers and their statuses             + listcluster - listing of VMware clusters and their statuses             + tools - VMware Tools status                 b - blacklist VM'due south             + condition - overall object status (gray/green/cherry/yellow)             + problems - all problems for the host                 b - blacklist issues             ^ all runtime info(except cluster and tools and no thresholds)         * recommendations - shows recommendations for cluster             + (name) - recommendations for cluster with name (proper noun)             ^ all clusters recommendations     Cluster specific :         * cpu - shows cpu info             + usage - CPU usage in pct             + usagemhz - CPU usage in MHz             ^ all cpu info         * mem - shows mem info             + usage - mem usage in per centum             + usagemb - mem usage in MB             + bandy - bandy mem usage in MB                 o listvm - plough on/off output list of swapping VM'south             + memctl - mem used by VM memory control driver(vmmemctl) that controls ballooning                 o listvm - turn on/off output list of ballooning VM's             ^ all mem info(plus overhead and no thresholds)         * cluster - shows cluster services info             + effectivecpu - total available cpu resources of all hosts within cluster             + effectivemem - total amount of machine memory of all hosts in the cluster             + failover - VMware HA number of failures that tin can exist tolerated             + cpufairness - fairness of distributed cpu resources allocation             + memfairness - fairness of distributed mem resource allotment             ^ only effectivecpu and effectivemem values for cluster services         * runtime - shows runtime info             + list(vm) - listing of VMware machines in cluster and their statuses             + listhost - list of VMware esx host servers in cluster and their statuses             + status - overall cluster status (gray/dark-green/cherry-red/yellow)             + bug - all issues for the cluster                 b - blacklist issues             ^ all cluster runtime info         * vmfs - shows Datastore info             + (name) - gratuitous space info for datastore with name (name)                 o used - output used space instead of free                 o cursory - list only alerting volumes                 o regexp - whether to treat proper noun as regexp                 o blacklistregexp - whether to treat blacklist every bit regexp                 b - blacklist VMFS'southward                 T (value) - timeshift to detemine if we need to refresh             ^ all datastore info                 o used - output used space instead of free                 o brief - list only alerting volumes                 o blacklistregexp - whether to treat blacklist as regexp                 b - blacklist VMFS'south                 T (value) - timeshift to detemine if we need to refresh
  • Author
  • Recent Posts

rhodesthenthe.blogspot.com

Source: https://www.bujarra.com/nagios-monitorizando-hosts-esxi/?lang=en

Post a Comment for "vmware nagios plugin Component installation failed. Uploaded zip file is not a component."