Nils Cronstedt's Server montor page

Backups with GhettoVCB

ghettoVCB ia a great free backup solution for VMWare,
the program is developed by an VMWare consultant and is available
from VMWare

The only problem is the lack of report and monitor possibilities.
To correct that I have made some small add-ons to the script,
now it produces log files and have a more naming flexibilities.
The logs are used by the Nagios plug in check_ghettoVCB so you
can get alerts in Nagios if there are any problems in the backup.
ghettoVCB uses vSphere Management Assistant (vMA) to run the backup
jobs and you can start multiple jobs if you have more than one ESX host.

Installation steps

1.Install vMA
Download the vSphere Management Assistant (vMA) appliance from VMWare
In your vSphare client chose File Deploy OVF Template
and browse to the file you downloaded from VMWare.

2.Configure vMA
Open a SSH session to the vMA server
Login with vi-admin
Add your ESX servers to the vMA servers auto autentication

vifp addserver Esx server namn / IP --username "user" --password "password"

Change directory and Create a lib

cd /tmp/
mkdir nrpe
cd /nrpe

Connect to your vMA server with WinSCP with username vi-admin
and download the nrpe_bundle files to /tmp/nrpe
For this part I get great help from
Paul Drangeid guides on

Extract to /tmp/nrpe
you need too use sudo to execute commands in SuperUser context
Install the packages in this order:

sudo rpm -i fping-2.4-1.b2.2.el3.rf.x86_64.rpm
sudo rpm -i perl-Socket6-0.20-1.el3.rf.x86_64.rpm
sudo rpm -i perl-Digest-SHA1-2.11-1.el3.rf.x86_64.rpm
sudo rpm -i perl-Digest-HMAC-1.01-1.rhel2.1.dag.noarch.rpm
sudo rpm -i perl-Crypt-DES-2.05-3.1.el3.rf.x86_64.rpm
sudo rpm -i perl-Net-SNMP-5.2.0-1.1.el3.rf.noarch.rpm
sudo rpm -i nagios-plugins-1.4.11-1.el3.rf.x86_64.rpm
sudo rpm -i nagios-nrpe-2.5.2-1.el3.rf.x86_64.rpm

Allow NRPE traffic through the firewall
Edit the iptables file in /etc/sysconfig and add the line:

-A INPUT -p tcp -m tcp --dport 5666 -j ACCEPT

And restart the Fierwall

sudo service iptables restart

Configure NRPE to auto start at reboot

/sbin/chkconfig --level 345 nrpe on

Move check commands to NRPE plugin directory

mv check_ghettoVCB /usr/lib64/nagios/plugins/

Allows nagios user access to nagios plugins and vdf (for vmfs checks) nagios

sudo nano /etc/sudoers

add the following lines:

ALL=NOPASSWD: /usr/lib64/nagios/plugins/nagios
ALL=NOPASSWD: /usr/sbin/vdf

comment out this line:

#Defaults requiretty

Add the folowing lines to Nrpe.cfg in /etc/nagios
In section:


And in section:

command[check_ghetto]=/usr/lib64/nagios/plugins/check_ghetto $ARG1$

On the Nagios server
Edit commands.cfg add this command definition

# ' Check ghettoVCB backup status
define command{
    command_name check_ghettoVCB
    command_line $USER1$/check_nrpe -H vMA serverns IP adress -c check_ghetto -a $HOSTNAME$

In the cfg file that you use for your esx server definitions
Add this Service definition

# Check Backup with ghettoVCB

define service{
    use                 generic-service,help
    host_name           esx1,esx2
    service_descriptio  ESX_Backup
    check_command       check_ghettoVCB

3. Configure ghettoVCB (on the vMA server)

Create directory to hold the log files.

mkdir /tmp/ghettoVCB
mkdir /tmp/ghettoVCB/log

Create a folder for ghettoVCB files

mkdir /opt/ghettoVCBg2

Copy and to that folder
Modify to suite your environment.

You need to specify what virtual servers that are going to be backed up
To improve performance I have split the list to one file per esx host that way you could start backups on several esx servers at the same time.

If you look in the example files esx-01 you see an example os server list.

You run ghettoVCB with this command: --vmlist path/file --datastore=datastore name --output=path/file --dryrun=0/1 --name=name of the esx server in Nagios.

To automate the backups add the job to crontab

Crontab syntax :
A crontab file has five fields for specifying day , date and time followed by the command to be run at that interval.

*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of        month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)

add this line in /etc/crontab

00 19 * * * vi-admin /opt/ghettoVCBg2/

You also have to enter some values in the file

Email configuration if you want e-mal

And specify your backup directory if you use the same for all data stores else use the --directory

That should be all.


ReadMe.txt                   ReadMe.txt
GhettoVCB perl script
Script thar runns the backup
Nagios plugin                check_ghetto
Examlel file                 esx-01
Percompiled NRPE files
HTML Comment Box is loading comments...