Showing posts with label Monitoring. Show all posts
Showing posts with label Monitoring. Show all posts

Thursday, August 6, 2015

Monitoring ESXi Machines with Nagios

I was looking for a way to monitor my ESXi 6.0 machine and stumbled upon a script. However there were few issues with the script and I had to modify it.
You can download the modified version from my GitHub. Click here to download.

 

Dependency Packages


I'd assume you have a working Perl installation. Please install following packages using yum as well.

yum intall cpanm
yum erase perl-XML-SAX-Base-1.04-1.el6.rf.noarch
yum install perl-XML-SAX
yum install perl-Nagios-Plugin libuuid* perl-XML-LibXML
yum install perl-Crypt-SSLeay
yum install openssl-devel
yum install libuuid-devel perl-YAML perl-Devel-CheckLib gcc perl-CPAN libxml2-devel.x86_64


Also install the following Perl modules using CPAN and CPANM

cpan -i JSON::PP
cpan -i Fatal
cpan -i Class::MethodMaker
cpan -i Env
cpan -i Class::MethodMaker

cpanm Params::Validate
cpanm Monitoring::Plugin
cpanm XML::LibXML::Common XML::LibXML Class::MethodMaker

 

Installing vSphere Perl SDK for vSphere 6.0


Download vSphere Perl SDK for vSphere 6.0 from VMware downloads

Run the installation script in downloaded SDK to install as below,

./vmware-install.pl --prefix=/opt/vmwarecli EULA_AGREED=yes

 

Running the Script


Now you should be able to run the script and get status from the ESXi server.

EG:

To get CPU usage,

./check_vmware_api.pl -D hypervisor1 -u ESXi_USER -p ESXi_PASSWORD -l cpu -s useage -w 92 -c 98

To get up time,

./check_vmware_api.pl -H hypervisor1 -u ESXi_USER -p ESXi_PASSWORD -l uptime

Please run the script as below to get a full list of available options

./check_vmware_api.pl

Thursday, January 16, 2014

Monitoring NETGEAR ReadyNAS via PRTG

I use Paessler PRTG; to import this file, here's how you do it:

  1. Get Paessler MIB Importer v2 (a free download, http://www.paessler.com/tools/mibimporter)
  2. Download the ReadyNAS MIB file (search for SNMP on the ReadyNAS site, http://www.readynas.com/?cat=41)
  3. Launch MIB importer and select "Import | MIB File"
  4. Select the MIB file and click "Open". If all is well, it will think for a minute and then say "import successful".
  5. Click File | Save and save the file as "ReadyNAS.oidlib".
  6. Copy the oidlib file to your PRTG server in the folder C:\Program Files\PRTG Network Monitor\snmplibs
  7. Go to your PRTG user interface and right click on the ReadyNAS device. Select "Add Sensor".
  8. In the sensor select screen, choose "SNMP". 
  9. Click "SNMP Library" and select "readynas.oidlib". If the file doesn't show up yet, close and re-open your PRTG user interface and it will re-scan the folder and find your oidlib file.
  10. Click next and select all the monitors you care about.