Monitoring ESXi host using Nagios

0

Today I was trying to find out a way to add our new esxi host to our existing nagios cluster. I’ve got different opinion from different people to use different monitoring tools. Then my eyes got stuck with a python script (http://www.claudiokuenzler.com). This script is working perfectly in our new esxi server. I think, sharing my experience will be very helpful to others. I wrote this tutorial with an assumption that the readers are much familiar with nagios configuration and administration.

Installation Steps:

1. Download the check_esxi_hardware.py script from http://www.claudiokuenzler.com.

2. Copy the script in the default nagios plugin directory (default location /usr/local/nagios/libexec).

3. Assign executable permission to the nagios user.

4. Add host definition in your nagios configuration (Assuming that you know the basic nagios administration).

5. Add the following code in your commands.cfg file.

6. Finally add the service configuration in your nagios configuration. Actual hack is in this part. First create a file called .esxipass which stores the login details of your esxi server. It should be in a secure location in your nagios server. File content should be as follows.

<username> <password>

eg: root jkosn2sdf

7. Now add the following in your nagios service configuration. We’re using dell hardware. If you’re using hp hardware you can change dell with hp. More detailed syntax you can refer the developer site More >

Converting a thick provisioned hdd to thin in a vmware esxi/esx host

2

Couple of days back I got a task to migrate couple of VM’s from a Vmware Workstation to our Vmware Esxi server.I was using vmware convertor to do the task.After the migration process, I could see drastic decrease in free space of one of the datastore.From further investigation I could understand that, I forgot to enable thin provisioning of hard disks while migrating the vm’s through vmware convertor. So I’m gonna share the steps to convert a thick provisioned hard disk to thin using command line console.

1. Poweroff the virtual machine.

2. Login to the command line console of the esxi server.

3. Locate the directory in which the .vmdk (hard disk) file is located.

4. Execute the following command in the command line console.

vmkfstools –i hard-diskfile-thick.vmdk –d thin hard-diskfile-thin.vmdk

where hard-diskfile-thick.vmdk is the thick provisioned hard drive and the hard-diskfile-thin.vmdk is the newly created thin provisioned disk file.

5. Login to the vsphere client.Delete the old hard drive and add new thin provisioned hard drive to the virtual machine.

6. Start the virtual machine with the modified configuration.

Tip:

Sometimes you may need to use thick provisioned hard drives in order to support clustering feature.In that kind of circumstances you can use the same command with a little modification to convert thin provisioned hard drive to a thick provisioned one.

vmkfstools –i hard-diskfile-thin.vmdk –d thick hard-diskfile-thick.vmdk

You need to More >

How to check the CPU is VT capable or not in Linux

0

Today I was trying to configure XEN in a test environment.So I was trying to figure out whether my cpu is VT capable or not.Without VT you cannot use HVM (Hardware Assisted Virtual Machines) feature or full hardware virtualization in any hypervisors like vmware or xen.

Its very simple to find out, if your host machine is running with Linux. you can figure it out using the following command.

[root@beta ~]# cat /proc/cpuinfo | grep svm (For AMD processors)

or

cat /proc/cpuinfo | grep vmx (For intel processors)

Command output in VT enabled Intel core 2 duo processor

If the grep command gives empty output , either you don’t have a VT capable CPU or the feature is not enabled in your system.You need to check your hardware vendor’s documentation in order to enable this feature.You can use a Linux live cd to check the processor capability before installing any hypervisors.

Peace <3

Importing VMWARE vmdk disk to ORACLE virtualbox

0

Yesterday I was looking for a desktop virtulization solution for my personal laptop.We all know that vmware workstation is the best desktop virtualization solution because its stable and very flexible to work on.But as a free software supporter,I was searching for an alternative virtualization solution in the opensource world and I think I found the best one.Oracle virtual box (Sun Virtualbox) is having almost all the features of vmware workstation.And you can use it without paying a penny.Interesting right?

So today I’m gonna share how to import a vmware disk file to oracle virtualbox installed in a Windows host.As a first step you need to download the latest version of Virtualbox from www.virtualbox.org depending on your hardware architecture and install it in your machine. Here I’m using Virtualbox 3.2.10.

1. Double click the Virtualbox desktop icon and then click the create new VM button

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3. In this tutorial, I’m going to use a centos5.4 vmdk file which is created by vmware workstation to create a new VM(Virtual Machine).So I’m naming this new VM as centos5 and select the appropriate distro from the OS Type drop down boxes.After that click next and move on to the next phase.

4. As a next step we need to specify the RAM size.Allocate appropriate ram size to the VM (you must have enough memory in your host machine).Here I’m setting up ram memory as 512M.Then click next.

5. Now we need to select the vmdk file and attach it as a More >

Go to Top