Archive for the Uncategorized Category

1.  First get the latest version of MegaCLI from LSI website (choose MegaCLI – Linux from the list). Unzip the downloaded file. The package inside the .zip file is an .rpm so it needs to be converted into something more useful.

2. install alien, convert the .rpm into a .tgz and ‘untargzip’ it :

$ sudo apt-get install alien

$ sudo alien –to-tgz  MegaCli-1.01.39-0.i386.rpm

$ tar xvfz MegaCli-1.01.39.tgz

3. now in ./opt/MegaRAID/MegaCli you should have MegaCli and MegaCli64, depending on your ubuntu installation type (i368 or amd64) copy one of them as MegaCli to /usr/sbin (so for 64bit: cp MegaCli64 /usr/sbin/MegaCli)

4. Download nagios check script from Nagios Exchange and place it in /usr/lib/nagios/plugins

5. The MegaCli script has to be run as root, usually nagios nrpe runs as user nagios, and it’s better to keep it this way. The nagios check script is fully aware of that and uses sudo to call the raid check script. So nagios needs to be allowed to call this script as root. Use visudo and add this line:

nagios ALL=(ALL) NOPASSWD: /usr/sbin/MegaCli

6. Add a new command definition to nrpe config (/etc/nagios/nrpe_local.cfg):

command[check_raid]=/usr/lib/nagios/plugins/check_megaraid_sas

live backup under vmware ESXi

| January 16th, 2009

backup a virtual machine running on an ESXi host.

Let’s assume we’re backing up a virtual machine called ubuntu:

1. first let’s find its VM id:

vmid=`vim-cmd vmsvc/getallvms | grep ubuntu | awk ‘{print $2}’`

2. now we have to snapshot this machine so VMware can release the lock on the virtual HDD file:

vim-cmd vmsvc/snapshot.create $vmid snapshot1 backupsnaphot

3. now we can copy the contents of the virtual machine’s directory. it will live somewhere under /vmfs/volumes/. In my case I created it in datastore1, so the full path is: /vmfs/volumes/datastore1/ubuntu. The whole directory can be copied as it is, of course, the locked files won’t be copied, but those are only snapshot related files, so no worries those are not needed anyway.

4. now we can delete the snapshot

vim-cmd vmsvc/snapshot.removeall

depending on how long it took to copy the data and how busy the virtual machine was during that time it can take some time for the data from the snapshot to be merged with the main disk and memory files.

1. on your ESXi host console press ALT+F1.

2. type unsupported (this won’t be displayed on the screen) and press Enter

3. enter your root password

4. edit /etc/inetd.conf (vi /etc/inetd.conf) find the line with ssh and uncomment it. save the file

5. do ps auxw | grep inetd to find inetd’s PID and send it a HUP signal