Posted on 31-08-2014
Filed Under (Virtualization, VMware/ESXi) by Arun Bagul


Sometime we need to login to Esxi server to check hardware/networking and performance/stats. Sharing few important ESXi commands..

a)  ESXi NIC List

~ # esxcfg-nics  --list
Name    PCI           Driver      Link Speed    Duplex MAC Address       MTU    Description
vmnic0  0000:01:00.00 tg3   Up   1000Mbps  Full  XX:10:55:DD:CC:XX 1500   Broadcom BCM5720 Gigabit Ethernet
vmnic1  0000:01:00.01 tg3   Up   1000Mbps  Full  XX:10:55:67:CC:XX 1500   Broadcom BCM5720 Gigabit Ethernet
vmnic2  0000:02:00.00 tg3   Up   1000Mbps  Full  XX:10:55:65:CC:YY 1500   Broadcom BCM5720 Gigabit Ethernet
vmnic3  0000:02:00.01 tg3   Up   1000Mbps  Full  XX:10:55:23:CC:00 1500   Broadcom BCM5720 Gigabit Ethernet
~ #
~ # esxcli network ip interface  list
Name: vmk0
MAC Address: 24:b6:fd:XX:XX:YY
Enabled: true
Portset: vSwitch0
Portgroup: Management Network
VDS Name: N/A
VDS Port: N/A
VDS Connection: -1
MTU: 1500
TSO MSS: 65535
Port ID: 33554438

b)  ESXi Storage/iSCSI stats

~# esxcli storage san iscsi stats get
Adapter: vmhba34
Total Number of Sessions: 20
Total Number of Connections: 20
IO Data Sent: 2647449088
IO Data Received: 107921345640
Command PDUs: 15509582
Read Command PDUs: 12353055
Write Command PDUs: 3156497
Bidirectional Command PDUs: 0
No-data Command PDUs: 30
Response PDUs: 15509582
R2T PDUs: 0
Data-in PDUs: 0
Data-out PDUs: 0
Task Mgmt Request PDUs: 0
Task Mgmt Response PDUs: 0
Login Request PDUs: 20
Login Response PDUs: 20
Text Request PDUs: 0
Text Response PDUs: 0
Logout Request PDUs: 0
Logout Response PDUs: 0
NOP-Out PDUs: 1767885
NOP-In PDUs: 1767885
Async Event PDUs: 0
Reject PDUs: 0
Digest Errors: 0
Timeouts: 0
No Tx Buf Count: 0
No Rx Data Count: 232170
~ #


c)  ESXi  ping-

Check connectivity to storage, jumbo frame etc

~ # vmkping  -c 5 -s 8972
PING ( 8972 data bytes
8980 bytes from icmp_seq=0 ttl=64 time=2.104 ms
8980 bytes from icmp_seq=1 ttl=64 time=0.693 ms
8980 bytes from icmp_seq=2 ttl=64 time=0.541 ms

d) VMKernel  VMNIC and Check connectivity with VMKernel Port

~ # esxcfg-vmknic  --list
Interface  Port Group/DVPort   IP Family IP Address     Netmask       Broadcast       MAC Address     MTU   TSO MSS Enabled Type
vmk0       Management Network  IPv4  XX:10:55:23:CC:00 1500  65535  true  STATIC
vmk1       iSCSI Kernel 1      IPv4  XX:10:XX:23:CC:YY 1500  65535  true  STATIC
vmk2       iSCSI Kernel 2      IPv4  00:50:56:XX:65:ZZ 1500  65535  true  STATIC     

~ # vmkping  -c 5 -s 8972 -I vmk1
PING ( 8972 data bytes
8980 bytes from icmp_seq=0 ttl=64 time=0.747 ms
8980 bytes from icmp_seq=1 ttl=64 time=0.481 ms
8980 bytes from icmp_seq=2 ttl=64 time=0.523 ms
8980 bytes from icmp_seq=3 ttl=64 time=0.615 ms
8980 bytes from icmp_seq=4 ttl=64 time=0.504 ms

--- ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.481/0.574/0.747 ms
~ #

e) vSwitch list

~ # esxcfg-vswitch --list
Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch0         128         47          128               1500    vmnic0,vmnic1
PortGroup Name        VLAN ID  Used Ports  Uplinks
NFS                   188      0           vmnic0,vmnic1
DMZ 192.168.X.0/24    1103     13          vmnic0,vmnic1
DMZ 192.168.Y.0/22    1102     22          vmnic0,vmnic1
DMZ 192.168.X.0/24    1101     8           vmnic0,vmnic1
Management Network    1102     1           vmnic0,vmnic1

Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch1         128         3           128               1500    vmnic2
PortGroup Name        VLAN ID  Used Ports  Uplinks
iSCSI Kernel 1        0        1           vmnic2

Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch2         128         3           128               1500    vmnic3
PortGroup Name        VLAN ID  Used Ports  Uplinks
iSCSI Kernel 2        0        1           vmnic3
~ #

Thank You,

(0) Comments   
Posted on 30-08-2014
Filed Under (Virtualization, VMware/ESXi) by Arun Bagul


Last month, while working on ESXi5.1 disconnect issue. we analyzed esxi logs for past 3/4 months. Just sharing information related to ESXi log rotation policy..

/var/log # esxcli system syslog config get
Default Rotation Size: 1024
Default Rotations: 8
Log Output: /scratch/log
Log To Unique Subdirectory: false
Remote Host: <none>
/var/log # cd /scratch/log
/vmfs/volumes/507a011b-acd45a80-9aed-e0db5501b632/log #


Thank you,
Arun Bagul

(0) Comments   

Difference between (Extended) ext2/3 and ext4 File System

* Ext2
-It was introduced in 1993. Developed by Remy Card.
-ext2 stands for second extended file system.
-This was developed to overcome the limitation of the original ext file system.
-ext2 does not have journaling feature.
-ext2 is recommended for flash drives, usb drives etc
-Maximum individual file size can be from 16GB to 2TB (depends on block size)
-Overall ext2 FS size can be from 2TB to 32TB

* Ext3
-It was introduced in 2001. Developed by Stephen Tweedie.
-ext3 stands for third extended file system.
    -The main benefit of ext3 is that it allows journaling.
-Journaling has a dedicated area in the file system, where all the changes are tracked. When the system crashes,file system
corruption chances are less because of journaling.
-Maximum individual file size can be from 16GB to 2TB
-Overall ext3 FS size can be from 2TB to 32TB
-There are three types of journaling available in ext3 file system.
1) Journal – both Metadata and Content are saved in the journal.
2) Ordered – Only metadata is saved in the journal. Metadata are journaled only after writing the content to disk. This is the default.
3) Writeback – Only metadata is saved in the journal. Metadata might be journaled either before or after the
content is written to the disk.
    -You can convert a ext2 file system to ext3 file system directly (without backup/restore).

* Ext4
-It was introduced in 2008.
-Ext4 stands for fourth extended file system.
-Starting from Linux Kernel 2.6.19 ext4 was available.
-Maximum individual file size can be from 16 GB to 16TB
-Overall maximum ext4 FS size is 1024PB (petabyte), 1PB = 1024TB (terabyte)
-Directory can contain a maximum of 64,000 subdirectories (as opposed to 32,000 in ext3)
-You can also mount an existing ext3 FS as ext4 fs (without having to upgrade it)
    -ext4 default inode size is 256 bytes.(in ext3 inode size is 128 bytes)
-Several other new features are introduced in ext4: multiblock allocation, delayed allocation, journal checksum. fast fsck, etc. All you need to know is that these new features have improved the performance and reliability of the filesystem when compared to ext3
-In ext4, you also have the option of turning the journaling feature “off”.
-Faster file system checking as Unallocated blocks are skipped during FS checking
-Improved timestamps- Up to the nanosecond. Which will defer the year 2038 problem
-Online Defragmentation

What is Extents?
-Ext3 uses a block mapping scheme (block 4Kb), the bigger the file needs huge block mapping will lead to slower handling.
-Ext4 introduces the concept of Extents. An extent is basically a “Bunch of blocks”.
Basically it say “write the data is in the next N blocks ie extent” instead of mapping each individual block separately.
-Ext4 will support up to 128Mb extents,This improve performance and also help in reducing fragmentation.

Multiblock Allocation-
-Ext3 uses a block allocator that decides which free blocks will be used to write the data. But this allocator
can only allocate one block at a time.
-Ext4 will support multi-block allocation, which allocates many blocks in a single call and avoids a lot of overhead.

Thank you,
Arun Bagul

(1) Comment   
Posted on 31-01-2013
Filed Under (Perl & Python) by Arun Bagul


I wrote this simple LDAP Caching unix daemon 2 yrs back when we faced lot of issue with Integrating Apache with LDAP authentication
using Apache ldap auth module. We were able to configure it properly however we faced slowness issue.

Basically We wanted to use Nagios (Check_mk Multisite) with LDAP authentication. So we wrote this unix daemon.
As of now this is very simple (no theading/forking and it is blocking) However it is working perfectly without any issue (for Nagios web interface authentication and few other web based tools, around 300+ users).

Download Perl files-



* Custom Apache Handler – to use this daemon for basic authentication

root@arunb:~# cat /etc/init.d/
use strict;
use warnings;
use Proc::Daemon;

no warnings ‘uninitialized’;
if ( $ARGV[0] =~ m/start/ ) {
my $continue = 1;
$SIG{TERM} = sub { $continue = 0 };
while ($continue) { eval { `/usr/local/ –daemon`;};}

} else { print ” * Usage: $0 {start}”;}
print “\n”;

Step 1] Run Daemon – (edit LDAP related varibles)

Copy perl file at following location on your system /usr/local/
OR Change path in “” startup file

* Start process-

root@:~# /etc/init.d/ start

* Make sure only one ldapcached process running?

root@:~# ps aux | grep ldap | grep -v grep
root 19441 0.0 0.0 6212 1408 ? S 15:03 0:00 /usr/bin/perl /etc/init.d/ start
root 19442 0.0 0.2 8656 4916 ? S 15:03 0:00 ldapcached

Step 2] How to test-

root@:~$ perl –client ‘my-ldap-user’ ‘my-ldap-pass’

root@:~$ perl –client ‘my-ldap-user’ ‘my-ldap-pass’

Step 3] How I should use/integrate in Application-

Say I want to use this ldapcached unix daemon for Apache/Basic Authentication –

NOTE- Make sure to copy module in Perl module directory or Check Apache error log for any error.

ScriptAlias /nagios/cgi-bin “/usr/lib64/nagios/cgi”

<Directory “/usr/lib64/nagios/cgi”>
Order allow,deny
Allow from all
AuthType Basic
AuthName “Nagios GUI”
PerlAuthenHandler Apache::MyHandler
Require valid-user

Thank you,

(0) Comments   
Posted on 23-01-2013
Filed Under (Debian & Ubuntu, Nagios Monitoring, Redhat & Fedora) by Arun Bagul


Nagios Check_mk Multisite (plugin) allow user to view/manage distributed nagios using single Web based Interface. However by default
it doesn’t support pnp4nagios graphs (hosts/services from remote nagios) access using (single) Multisite URL.

* To access PNP4nagios graphs of hosts/services from remote nagios using (single) Multisite URL, we need to Add Apache Proxy redirect setting.

1] Conf file-

This is my “check_mk/” conf file. (from Primary multisite Server (prod), SITE1 and SITE2 are two remote nagios)

OMD[prod]:~$ cat etc/check_mk/

sites = {
#Primary site
“local” : {
“alias” : “PROD”
# Remote site
“SITE1”: {
“alias”: “SITE1”,
“socket”: “tcp:”,
“url_prefix”: “/SITE1/”,
“nagios_url”: “/SITE1/nagios”,
“nagios_cgi_url”: “/SITE1/nagios/cgi-bin”,
“pnp_url”: “/SITE1/pnp4nagios”,
# Remote site
“SITE2”: {
“alias”: “SITE2”,
“socket”: “tcp:”,
“url_prefix”: “/SITE2/”,
“nagios_url”: “/SITE2/nagios”,
“nagios_cgi_url”: “/SITE2/nagios/cgi-bin”,
“pnp_url”: “/SITE2/pnp4nagios”,

2] Apache Proxy Redirect for PNP4nagios –

OMD[prod]:~# cat /etc/httpd/conf.d/multisite_proxy.conf
<Location /SITE1/>
RewriteEngine On
RewriteRule ^/.+/SITE1/(.*)$1 [P]

<Location /SITE2/>
RewriteEngine On
RewriteRule ^/.+/SITE2/(.*)$1 [P]


That’s it! Now you can access pnp4nagios graphs form remote nagios hosts/services using single Multisite URL.

Thank you,
Arun Bagul

(0) Comments   
Posted on 18-01-2013
Filed Under (NETAPP-Storage) by Arun Bagul


Storage systems that run Data ONTAP are sometimes referred to as filers, storage appliances, or systems.
Controller or Storage controller refers to the component of a storage system that runs the Data ONTAP.

* FC HBA for Disk or FC HBA refers to the Fibre Channel (HBA) Host Bus Adapter
that connects the node to the switch or to the disks
* Disk shelf is a unit of the disk subsystem component of the storage system. Disk shelves,
which hold disks and associated hardware.
* LRC (Loop Resiliency Circuit) disk shelf module that keeps the Fibre Channel-Arbitrated Loop (FC-AL) intact during the
addition and removal of disks within a disk shelf.
* ESH (Embedded Switching Hub) disk shelf module that provides a means of managing an FC-AL loop in an intelligent manner,
such that a single drive failure does not take down the loop.
* FilerView graphical user interface for NetApp

Arun Bagul

(0) Comments   
Posted on 08-01-2013
Filed Under (NETAPP-Storage) by Arun Bagul

Manage/Administer NetApp


– To manage/administer NetApp you can use CLI (telnet,ssh, serial port,SP,RLM or BMC), FilerView, the DataFabric Manager (DFM)
software, or the Manage ONTAP Developer SDK software.
– Mount /vol/vol0 (root volume) of netapp storage locally and change configuration
– If you are entering a command with an element that includes a space, you must quote that element. For example,
arun_netapp> environment status chassis “Power Supply”
– CLI History – Scroll back through commands press – Ctrl-P or Up arrow key.
Scroll Forward through commands press – Ctrl-N or Down arrow key.
-CLI help
arun_netapp> help
arun_netapp> ?
arun_netapp> environment help
Usage: environment status
-CLI man page
arun_netapp> man command_or_file_name

* Remotely access the system console  using SP(Service Processor), RLM or BMC –
Login to the SP, RLM or the BMC ( system responds with the SP,RLM or BMC prompt)
Enter the following command at the RLM or BMC prompt: system console
username – naroot
Return to RLM prompt, press Ctrl-D
Return to the BMC prompt, press Ctrl-G

# ssh  naroot@prod-netapp

* ONTAP commands at different privilege levels –

a)  Administrative level –  enables you to access commands that are suffi cient for managing your storage system.
b)  Advanced level –  provides commands for troubleshooting, in addition to all the commands available at the administrative level.

Thank you,
Arun Bagul

(0) Comments   
Posted on 21-12-2012
Filed Under (Virtualization) by Arun Bagul

What is Virtualization and Type of Virtualization?

In general there are different types of virtualization like Memory,CPU, Storage, Hardware and Network virtualization. Howver here we are going to talk about OS virtualization only.

1] What is Hypervisor –

Hardware virtualization or platform virtualization refers to the creation of a virtual machine that acts like a real computer with an operating system. Software executed on these virtual machines is separated from the underlying hardware resources.
The words host and guest are used to distinguish the software that runs on the physical machine from the software that runs on the virtual machine.
The software or firmware that creates a virtual machine on the host hardware is called a hypervisor or Virtual Machine Manager.

2] Type of Virtualization –

a) Para-virtualization –
-Guest OS has to be modified
-VM does not simulate hardware
-Use special API that a modified guest OS must use
-Hypercalls trapped by the Hypervisor and serviced
-Xen, VMWare ESX Server

b) Full-virtualization (Native) –
VM simulates “enough” hardware to allow an unmodified guest OS to be run in
isolation. Same Hardware and CPU/Memory, eg- Vmware,IBM VM family,Parallels,
* Full virtualization with Xen Hypervisor requires:
i) Intel processor with the Intel VT extensions, or
ii) AMD processor with the AMD-V extensions, or
iii) an Intel Itanium processor
* Full virtualization with KVM hypervisor requires:
i) Intel processor with the Intel VT and the Intel 64 extensions, or
ii) AMD processor with the AMD-V and the AMD64 extensions

c) Emulation –
-VM emulates/simulates complete hardware
-Unmodified guest OS for a different PC can be run
-VirtualPC for Mac, QEMU

d) OS-level virtualization –
-OS allows multiple secure virtual servers to be run
-Guest OS is the same as the host OS, but appears isolated apps see an
isolated OS. eg: Solaris Containers, BSD Jails, Linux Vserver,OpenVZ and LXC (LinuX Containers)

e) Application level virtualization –
-Application is gives its own copy of components that are not shared
(eg: own registry files, global objects) – VE prevents conflicts, JVM

Thank you,
Arun Bagul

(1) Comment   
Posted on 30-11-2012
Filed Under (General information) by Arun Bagul


First of all thanks to “” for hosting open source software. I’m follower “” of project of the Month.

“Rigs of Rods is project of month for November 2012. This is one of the best and rocking open source project.
Rigs of Rods is a 3D simulator game where you can drive, fly and sail various vehicles using an accurate and unique soft-body physics engine.







* I love this Software!

Thank you,
Arun Bagul

(0) Comments   
Posted on 10-11-2012
Filed Under (Perl & Python) by Arun Bagul


Showslow is web based interface to collect yslow data. We can use yslow+showslow to get website loadtime and various other details provided by yslow.

This howto explains how to automate website loadtime/yslow testing using Firefox and Perl (Mechanize::Firefox, Firefox::Application module)

* Please download perl scripts and Strawberry perl for Windows-


* Reguirement-

1) Firefox -MozRepl extension to connect to firefox using socket -firebug and yslow extension/addon

2) Perl -WWW::Mechanize::Firefox module -Firefox::Application module *

1] How to create Firefox profile-

root@arunb:/home/arunb/firefox-yslow# /var/firefox-4.0.1/firefox/firefox -CreateProfile yslow /home/arunb/firefox-yslow/yslow_firefox_profile Success: created profile ‘yslow’ at ‘/root/.mozilla/firefox/rjel2s26.yslow/prefs.js’ root@arunb:/home/arunb/firefox-yslow#

NOTE- On Window create profile with ‘firefox -p’ command

* 2] Showslow Setup-

Download showslow and put in Documentroot directory of apache/web server. Then Create DB,Add DB details in config file and type ‘make’ in source directory mysql> create database showslow; mysql> grant all privileges on showslow.* to ‘showslow’@localhost identified by ‘mypass’;

* 3] Now Configure Firefox to submit "yslow" results to "showslow"

Yslow 2.x extensions.yslow.beaconUrl = http://mywebserver/showslow/beacon/yslow/ extensions.yslow.beaconInfo = grade extensions.yslow.optinBeacon = true extensions.yslow.autorun = true

IMP- Please enable following setting in firefox. extensions.firebug.allPagesActivation", "on"

* 4] Perl and Firefox/Mechanize Module –

root@arunb:/home/arunb/firefox-yslow# ./

For more info –

Thank You,
Arun Bagul

(3) Comments    Read More
arunbagul's photos More of arunbagul's photos
Get Adobe Flash player