Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

Monitor VMware ESXI in Cacti

Leer en espanol
Monitor VMware ESXI in Cacti

Table of contents

You can see the manual under Debian here: https://red-orbita.com/?p=5476 Once vSphere SDK for Per is installed ===

vmware-workstation-8-full-taringa

To monitor VMware ESXI servers we are going to install vSphere SDK for Perl 

You can see the manual under Debian here:

https://red-orbita.com/?p=5476

Once installed vSphere SDK for Perl  We download the check that we are going to use for monitoring.

We download the Template and the script to monitor it

https://red-orbita.com/archivos/esxi.xml

http://git.op5.org/git/?p=nagios/op5plugins.git;a=blob_plain;f=check_vmware_api.pl

We load the template

 Import Templates > We add the esxi.xml file downloaded previously > Import 

Pantallazo-1

Pantallazo-2

Once the Templete is added we move the check_vmware_api.pl script to the cacti script directory.

Bash
mv check_vmware_api.pl /var/www/cacti/scripts/

We add the following script to the path /var/www/cacti/scripts/:

CPU:

perl
#!/usr/bin/perl
$response = `/var/www/cacti/scripts/check_vmware_api.pl -H $ARGV[0] -u root -p $ARGV[1] -l cpu`;

chomp $response;

($load) = ($response =~ /cpu_usage=(\d+\.\d\d)\%/);
print «$load\n»;

Memory:

perl
#!/usr/bin/perl
$response = `/var/www/cacti/scripts/check_vmware_api.pl -H $ARGV[0] -u root -p $ARGV[1] -l mem`;

chomp $response;

($load) = ($response =~ /mem_usage=(\d+\.\d\d)\%/);
print «$load\n»;

 Grid:

perl
#!/usr/bin/perl
$response = `/var/www/cacti/scripts/check_vmware_api.pl -H $ARGV[0] -u root -p $ARGV[1] -l net`;

chomp $response;

($receive) = ($response =~ /receive=(\d+\.\d\d)\KB/);

($send) = ($response =~ /send=(\d+\.\d\d)\KB/);
print «receive:$receive send:$send\n»;

VMFS:

perl
#!/usr/bin/perl
$response = `/var/www/cacti/scripts/check_vmware_api.p-H $ARGV[0] -u root -p $ARGV[1] -l vmfs -s USAGE`;

chomp $response;
$response =~ tr/(«(«//d;
($load) = ($response =~ /MB (\d+\.\d\d)\%/);
print «$load\n»;

We create a new Device

Pantallazo-3

Once added we give  Create Graphs for this Host and we add the checks.

ATT00001

We fill in the fields with the root password and vcenter user and password,

ATT00002

Ready, once added to the project tree the new Device should graph correctly.

Regards, Rokitoh

:wq!

Comments