Monday, January 6, 2014

Handy Tip: How to split large Outlook PST files to make Outlook run faster (for free)


I get a lot of email. My work one is split into a working PST file and an couple of archive PST files. I’ve started to find that the archive files are just far to big. It means that my machine struggles to defragment the archive file, and today I came across a nice Microsoft support tip, that means you can split PST files up into smaller, moremanageable file sizes. If you want to read how to do it, see this Microsoft support article (KB932086). Now I can have Archives by year (e.g. WorkArchive2005, WorkArchive2006, etc). Nice! Once you have migrated all of your email out of the existing PST file, create a new one and set that to be your new default mail file. Outlook does not reduce the size of the existing PST when you move or delete items.

Thursday, December 19, 2013

Fedora 19 upgrade to Fedora 20 with FedUp

Common problem that I have encouter in my usage of Linux in last 15 year was upgrade from one to another version of release. For quite time best solution was been provided by Debian, but for other non-deb distributions was quite interesting to do upgrade. It was paint-full and time consuming process.

But after release of Fedora fedup util, situation is quite better. On the begging I have little sceptic when my friend Primoz have told me that there is easy was to do upgrade on Fedora with only one command. Till then, for me only safe was was to make backup of /home folder and to do complete install from scratch. If worked on any distro that I have worked till now (Fedora, CentOS, Ubuntu, LinuxMint ...).

What is FedUp?

FedUp (FEDora UPgrader) is the name of a new system for upgrading Fedora installs in Fedora 18 and later. It replaces all of the previously recommended upgrade methods (PreUpgrade and DVD) that were been used in previous Fedora releases. Anaconda, the Fedora installer, has no built-in upgrade functionality in Fedora 18 or later. It has been completely delegated to FedUp.
Currently, FedUp is capable of handling upgrades between all still-supported Fedora releases using a network repository or a DVD image as the package source. Upgrades from EOL Fedora releases may work, but are not supported.

Today I have tested this new upgrade tool.

Here are some considerations to be acknowledged, and here are steps to perform upgrade:

0. make backup of /home directory (just to be on the safe side)
1. do full upgrade of Fedora 19 with "yum update" command
2. check if FedUp is version 0.8, as 0.7 makes problems, check this link for more info: https://fedoraproject.org/wiki/Common_F20_bugs
3. check FedUp page for complete procedure (here is only short version): https://fedoraproject.org/wiki/FedUp
4. execute command "fedup --network 20" (keep in mind that this is network based upgrade, for ISO based upgrade, check fedup page).

What it download cca 1500 packages (this includes also some aditional repos like RPMFusion, Virtualbox ... etc). It needs about 20 min on HP Folio 9740m i5 1.8 with 4GB ram and 320GB HDD.


5. Reboot PC, and whait for that process to be finished, cca 30 min.
6. You have new Fedora 20 on system :) Enjoy :)


Tuesday, November 26, 2013

[Linux, OpenSSL, expect] Doing SFTP file transfers from a shell script

[Linux, OpenSSL, expect] Doing SFTP file transfers from a shell script


PRODUCT:   OpenSSH_5.4p1, OpenSSL 1.0.0a-fips 1 Jun 2010 
           expect version 5.43.0


OP/SYS:    Linux Fedora 13


COMPONENT:  SFTP, SCP 


SOURCE:     Philippe Vouters
            Fontainebleau/France


LOW-COST HIGH-TECH:  http://techno-star.fr


SYMPTOM(S) or PROBLEM(S):

The SFTP -b or the SCP -B options enables batch mode. However, under OpenSSH
version 5.4p1, these options require an empty passphrase and do not allow for
password prompting. What to do when the remote system only has port 22 opened
and only accepts OpenSSH logging using a login/password pair ? This is where
expect enables to workaround this OpenSSH restriction where you do not have the
target account RSA key with an empty passphrase. If you own the target account
RSA key with an empty passphrase then you may use the simpler

        sftp -b script user@host

or scp equivalent shell command.


SOLUTION or RESPONSE:

Use expect to synchronize with each SFTP/SCP output and to simulate their
inputs. Expect acts on terminal screens much the same way as the non-interactive
telnet tool found elsewhere in this knowledge database.


WORKAROUND or ALTERNATIVE:

In your shell script, use SFTP/SCP in interactive mode and synchronize their
output and input using expect commands.


EXPECT INFORMATION:

expect is an optional software. Under Fedora 13 and a root account, use yum to
install expect.

        # yum install expect


KSH SHELL SCRIPT NOTES:

This ksh script expects that the SFTP software is BSD based and accepts the
[-P port] option. Such an SFTP client is available under Linux Fedora 13. 
Carefully check your "man 1 sftp" before blindly using this ksh script. For 
example this sftp man at http://linux.die.net/man/1/sftp which claims BSD
compatibility is not suited for the below ksh script. The following man at
http://linuxreviews.org/man/sftp/ is fully suited and corresponds to the
author's Linux Fedora 13 computer sftp man which he based this ksh script upon.

If running a Linux SFTP client software whose man is identical to what is
described at http://linux.die.net/man/1/sftp, you would modify all occurences
of -P ${port} in the ksh script below to -oPort=${port} such as given as an
example in the http://linux.die.net/man/1/sftp Web browser displayable man.


KSH SHELL FULL SCRIPT:

#!/bin/ksh
#
#        Copyright (C) 2010 by Philippe.Vouters@laposte.net
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by the
#    Free Software Foundation, either version 3 of the License, or
#    any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>;.
#
# Software Description:
# This software transfers the latest 3PAR (a SAN equipment) weekly*.tbz2 and
# optionally the InSplore*.tbz2 files to /tmp local directory. The InSplore
# file is transfered provided it has been produced the same day than the run of 
# this script.
#
# This script makes uses of optional expect freeware and an smtp client whose
# source code is downloadable from http://vouters.dyndns.org/zip/.
# Under Fedora 12 and a root account:
#     # yum install expect
# For smtp:
#     # unzip -aa smtp.zip
#     # export bin=/usr/local/bin
#     # cd smtp
#     # make -f Makefile_smtp
#
# Enter the IP address or the DNS name with the IP port separated with a colon
# of each Service Processor while incrementing the index.
#
SP_hostname[0]="127.0.0.1:10001" # corresponds to 10.10.31.41:22
SP_hostname[1]="127.0.0.1:10002" # corresponds to 10.10.52.25:22
#
# Indicate your email account characteristics as well as a list of remote 
# recipients with a space as the delimiter in the smtp_destinees variable.
#
smtp_server="smtp.sfr.fr"
smtp_login="Philippe.Vouters@laposte.net"
smtp_password="password"
smtp_destinees="Philippe.Vouters@laposte.fr"

# These are the 3PAR Service Processor (SP) Username and Password. They ought
# to be constant whichever the 3PAR SP.
SP_username="spvar"
SP_password="3parvar"

#
# This function prepares a notification of file transfers from the SP.
#
function send_mail_notification
{
       if [[ $1 != "" && $2 != "" ]]; then
           echo "$1 and $2 available in directory /tmp" >> /tmp/smtp_body.txt
       fi
       if [[ $1 != "" && $2 == "" ]]; then
           echo "$1 available in directory /tmp" >> /tmp/smtp_body.txt
       fi
       if [[ $1 == "" && $2 != "" ]]; then
           echo "$2 available in directory /tmp" >> /tmp/smtp_body.txt
       fi
}

#
# Function get_last_weekly
#
# This function is in charge of copying the last dated weekly report to /tmp
# The last dated weekly report has been produced on the preceeding Sunday.
# Input :
#      - Index toward the DNS or IP address stored into SP_hostname
# Output:
#      - /tmp/
#
function get_last_weekly
{
# Step 1:
# get SP's all files in weekly/ directory using sftp and 
# maintenance SSH account.
#
port=`echo ${SP_hostname[$1]} | sed 's/\([\/A-Za-z0-9\.]*\):\([0-9]*\)/\2/g'`
hostname=`echo ${SP_hostname[$1]} | sed 's/\([\/A-Za-z0-9\.]*\):\([0-9]*\)/\1/g'`
echo "spawn sftp -P ${port} ${SP_username}@${hostname}" > /tmp/except
echo "expect -nobrace \" password: \"" >> /tmp/except
echo "send \"${SP_password}\n\"" >> /tmp/except
echo "expect -nobrace \"\nsftp> \"" >> /tmp/except
echo "send \"ls weekly/\n\"" >> /tmp/except
echo "expect -nobrace \"\nsftp> \"" >> /tmp/except
echo "send \"bye\n\"" >> /tmp/except
echo "wait" >> /tmp/except
echo "exit" >> /tmp/except
Weekly_files=`expect /tmp/except | gawk '{if (/weekly\//) {print $0;}}' | sed 's/\r//g' | sed 's/weekly\///g'`
for Weekly in ${Weekly_files}; do
     lastSunday=`date --date="last Sunday" +%y%m%d`
     echo ${Weekly} | sed 's/${lastSunday}//' > /dev/null
     if [[ $? == 0 ]]; then
         Weekly_file=${Weekly}
     fi
done
# Step 2:
# get SP's last dated weekly*.tbz2 in weekly/ directory using sftp and 
# maintenance SSH account.
echo "spawn sftp -P ${port} ${SP_username}@${hostname}" > /tmp/except
echo "expect -nobrace \" password: \"" >> /tmp/except
echo "send \"${SP_password}\n\"" >> /tmp/except
echo "expect -nobrace \"\nsftp> \"" >> /tmp/except
echo "send \"cd weekly\n\"" >> /tmp/except
echo "expect \"\nsftp> \"" >> /tmp/except
echo "send \"lcd /tmp\n\"" >> /tmp/except
echo "expect -nobrace \"sftp> \"" >> /tmp/except
echo "send \"get ${Weekly}\n\"" >> /tmp/except
echo "expect -nobrace \"\nsftp> \"" >> /tmp/except
echo "send \"bye\n\"" >> /tmp/except
echo "wait" >> /tmp/except
echo "exit" >> /tmp/except
expect /tmp/except
Weekly_file=/tmp/${Weekly_file}
rm -f /tmp/except
}
#
# Function get_last_InSplore
# This function downloads to /tmp the today's Insplore file.
#
# Input :
#    - full path of SP's Insplore file
#    - Index toward the SP's IP address or DNS name.
# Output :
#    - the Insplore filename prefixed with /tmp/
#
function get_last_InSplore
{
# Step 1:
# check SP for today's InSplore file using sftp and 
# maintenance SSH account.
#
port=`echo ${SP_hostname[$2]} | sed 's/\([\/A-Za-z0-9\.]*\):\([0-9]*\)/\2/g'`
hostname=`echo ${SP_hostname[$2]} | sed 's/\([\/A-Za-z0-9\.]*\):\([0-9]*\)/\1/g'`
echo "spawn sftp -P ${port} ${SP_username}@${hostname}" > /tmp/except
echo "expect -nobrace \" password: \"" >> /tmp/except
echo "send \"${SP_password}\n\"" >> /tmp/except
echo "expect -nobrace \"\nsftp> \"" >> /tmp/except
echo "send \"ls $1\n\"" >> /tmp/except
echo "expect -nobrace \"\nsftp> \"" >> /tmp/except
echo "send \"bye\n\"" >> /tmp/except
echo "wait" >> /tmp/except
echo "exit" >> /tmp/except
InSplore_file=`expect /tmp/except | gawk '{if (/$$1/) {print $0;}}'`
#
# Step 2:
# get SP's today's InSplore file if it exists and using the 
# maintenance SSH account.
#
echo ${InSplore_file} | sed 's/not found//'
if [[ $? != 0 ]]; then
   echo "spawn sftp -P ${port} ${SP_username}@${hostname}" > /tmp/except
   echo "expect -nobrace \" password: \"" >> /tmp/except
   echo "send \"${SP_password}\n\"" >> /tmp/except
   echo "expect -nobrace \"sftp> \"" >> /tmp/except
   echo "send \"lcd /tmp\n\"" >> /tmp/except
   echo "expect -nobrace \"sftp> \"" >> /tmp/except
   echo "send \"get $1\n\"" >> /tmp/except
   echo "expect -nobrace \"sftp> \"" >> /tmp/except
   echo "send \"bye\n\"" >> /tmp/except
   echo "wait" >> /tmp/except
   echo "exit" >> /tmp/except
   expect /tmp/except
   InSploreFile=/tmp/$(basename ${InSploreFile})
else
   InSploreFile=""
fi
rm -f /tmp/except
}
#
# Start of main script body.
#
touch /tmp/smtp_body.txt
i=0
until [ $i == ${#SP_hostname[@]} ]; do
  if [[ $SP_hostname[$i] != "" ]]; then
      #
      # First step : get last weekly
      #
      get_last_weekly $i
      #
      # Second step: Isolate the SP identification number from the weekly file.
      #
      LastSunday=`date --date="last Sunday" +%y%m%d`
      Today=`date +%Y%m%d`
      SP_num=`echo ${Weekly_file} | sed 's/\([\/A-Za-z0-9]*\)_weekly_\([0-9]*\)_'"${LastSunday}"'\.tbz2/\2/g'`
      InSploreFile=${SP_num}/insplore/InSplore.*-${SP_num}.${Today}.*.tbz2
      #
      # Third step: download if any today's InSplore file
      #
      get_last_InSplore ${InSploreFile} $i
      #
      # Fourth step: prepare notification email
      #
      if [[ ${InSploreFile} != "" ]]; then
            InSploreFile=$(basename ${InSploreFile})
      fi
      #
      # Prepare mail notification
      #
      send_mail_notification ${InSploreFile} $(basename ${Weekly_file})
  fi
  let i+=1
done
#
# send mail to recipients
#
smtp -o ${smtp_login} -server ${smtp_server} -s "Weekly and Insplore transfers over" -f /tmp/smtp_body.txt ${smtp_destinees}
# do cleanup
rm -f /tmp/smtp_body.txt
exit 0


MORE ABOUT EXPECT:

expect has been written in some compiled code (very likely C language according 
to ldd command below) to produce an executable which is linked with the Tcl
binary library. Here is the proof on Linux Fedora 13 (i686 version):

[philippe@victor ~]$ file /usr/bin/expect
/usr/bin/expect: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

So from above a 32 bits executable

[philippe@victor ~]$ ldd /usr/bin/expect
        linux-gate.so.1 =>  (0x00737000)
        libexpect5.43.so => /usr/lib/libexpect5.43.so (0x00a03000)
        libtcl8.5.so => /usr/lib/libtcl8.5.so (0x00110000)
        libdl.so.2 => /lib/libdl.so.2 (0x009fc000)
        libm.so.6 => /lib/libm.so.6 (0x009d0000)
        libutil.so.1 => /lib/libutil.so.1 (0x06547000)
        libc.so.6 => /lib/libc.so.6 (0x00858000)
        /lib/ld-linux.so.2 (0x00836000)

So from above linked with libtcl library.


HP-UX and EXPECT:

For HP-UX, you may download expect from :
http://hpux.connect.org.uk/hppd/hpux/Tcl/expect-5.45/


REFERENCE(S):

As SFTP -b option does not prompt for any passphrase/password, this solution
is unuseable. The ksh script excerp above is based on one guest input at:
http://www.linux-bsd-central.com/index.php/content/view/26/

Thursday, October 24, 2013

3PAR System Reporter, Part 2

We left off with a Linux host that had been built and configured to begin the installation of 3PAR System Reporter. Let’s continue on and get System Reporter installed and configured.
As a recap from Part 1, we are building a System Reporter system in Linux. I have chosen to use RedHat Enterprise Linux 5.8, along with MySQL for the database backend. Both System Reporter and MySQL will be hosted on the same server.
So let’s recap some file locations first, as we will need them later on.
The 3PAR CLI was installed into /opt/3PAR/inform_cli_3.1.1. You should have 2 files copied from the System Reporter CD, onto your system. They are sampleloop-.i386.rpm and sysrptwebsrv-.i386.rpm. At the time of writing, the current versions were 2.9-2 for sampleloop and 2.9-2 for sysrptwebsrv, but make sure to check with your 3PAR representative for the most recent versions.
We begin by making some modifications to the MySQL installation.
  1. Open /etc/my.cnf with your editor of choice (mine is vi )
    1. Comment out the socket= line, and add the line below underneath:
      1. socket=/var/run/mysqld/mysqld.sock
    1. Above [mysqld_safe], add the following line:
      1. max_allowed_packet=32M
    2. Save the file, and then restart mysql
      1. /etc/init.d/mysqld stop
      2. /etc/init.d/mysqld start
  2. Check to make sure the new socket file exists
    1. ls –al /var/run/mysqld/mysqld.sock
Now we are going to create the System Reporter database and users, and then grant those users access to the database.
  1. Connect to your MySQL database
    1. mysql –u root –p
      • when prompted, enter the password you defined for the root user
    1. Create the inservstats database:
      • create database inservstats;
    2. Create the cliuser and webuser users
      • create user cliuser identified by ‘3psrcli’;
      • create user webuser identified by ‘3parweb’;
    3. Grant privileges to the System Reporter users, by issuing the below commands:
      • use inservstats
      • grant all on * to cliuser;
      • grant select on * to webuser;
    4. Quit out of the database:
      • exit

Installing the SampleLoop applications

With the database and users created, we are able to start installing the software. Before we start, make sure to check to ensure the 32 bit package of GD is installed, by issuing
yum –y install gd.i386
. You should get a prompt back saying it’s installed and the latest version, otherwise it will install the missing package(s).

  1. Install the sampleloop package, which you copied from the System Reporter CD earlier
    • rpm –ivh sampleloop-.i386.rpm
      (substiture ver with your version)
  2. Edit the /etc/sampleloop.confconfiguration file, by opening it with your favorite editor. You will need to perform the following edits:
    • Change the line “set Sysdb::cli” to match your installed CLI location, mine was /opt/3PAR/inform_cli_3.1.1/bin/cli
    • Change the line “set Sysdb::smtpserver” to your local mail server address
    • Change the line “set Sysdb:smtporig” to the FROM email address System Reporter should use when sending you emails.
    • Change the “set Sysdb::smtpuser” and “set Sysdb:smtppasswd” to their respective user and password values, if your mail server requires you to login to send mail. If these are not needed, simply comment them out by putting a # in front of the lines.
    • Change the line “set Sysdb::dbhost” to the IP address of your MySQL server
    • Change the line “set Sysdb::dbname” to the database name you created above. In my example, we used “inservstats”
  3. Now we will need to create the password file used by the sampleloop mechanism to access the CLI. Open/Create the file “/etc/sampleloop_dbpwfile”
    • On the first line, enter the username and password for the cli user, separated by a single space.
      • ie. “cliuser 3psrcli”
    • Save the file, and exit out of the editor.
  4. You are now ready to startup the SampleLoop processes.
    • run the below script:
      1. /etc/init.d/sampleloop startup
    • If this fails to start, check the log located in /var/log/sampleloop/sampleloop.log for hints on what went wrong. It’s usually a password mistyped.
  5. If everything starts successfully, add sampleloop to the default startup runlevels
    • chkconfig --add sampleloop

Installing the System Reporter Webserver Files

Now we have the database and users created, sampleloop applications installed, and SampleLoop up and running. The next step is to install the sysrptwebsrv RPM package. This package is found on the System Reporter CD, and should be copied on to your Linux system.
  1. To install the packages, run the below:
    • rpm -ivh sysrptwebsrv-2.9-2.i386.rpm
    • Ensure it was installed successfully.
  2. We now need to setup two config.tcl files for the webserver.
    1. The first is at /var/www/cgi-bin/3par-rpts/config.tcl. Open this file in your favorite editor, and make the below changes:
      • Change the line “set Sysdb::cli” to match your installed CLI location, mine was /opt/3PAR/inform_cli_3.1.1/bin/cli
      • Change the line “set Sysdb::dbhost” to the IP address of your MySQL server
      • Change the line “set Sysdb::dbname” to the database name you created above. In my example, we used “inservstats”
      • Change the line “set Sysdb::dbuser” to webuser
      • Change the line “set Sysdb::dbpasswd” to the password you set for webuser, in my example it was 3parweb.
      • Change the line “set Sysdb::smtpserver” to your local mail server address
      • Change the line “set Sysdb:smtporig” to the FROM email address System Reporter should use when sending you emails.
      • Change the “set Sysdb::smtpuser” and “set Sysdb:smtppasswd” to their respective user and password values, if your mail server requires you to login to send mail. If these are not needed, simply comment them out by putting a # in front of the lines.
    2. The second file is located at /var/www/cgi-bin/3par-policy/config.tcl. Open this file in your favorite editor, and make the below changes:
      • Change the line “set Sysdb::cli” to match your installed CLI location, mine was /opt/3PAR/inform_cli_3.1.1/bin/cli
      • Change the line “set Sysdb::dbhost” to the IP address of your MySQL server
      • Change the line “set Sysdb::dbname” to the database name you created above. In my example, we used “inservstats”
      • Change the line “set Sysdb::dbuser” to cliuser
      • Change the line “set Sysdb::dbpasswd” to the password you set for cliuser, in my example it was 3psrcli.

Test your System Reporter setup

You should now have a working System Reporter configuration. You can access System Reporter by going to:
http:///3par/
Part 3 of my System Reporter series will involve adding the Inserv system to System Reporter, as well as setting some basic options up, and going over the various tabs available to you.

3PAR System Reporter, Part 1

System Reporter is a 3PAR tool that provides informative reporting about your 3PAR arrays, as well as being able to build custom reports, and schedule daily execution and email of any report.
System Reporter is also required to be installed, in order to use Adaptive Optimization, as System Reporter is used to determine which chunklets are to be migrated between which CPG’s. All the Adaptive Optimization configuration is done from within System Reporter’s web interface.
System Reporter can be installed on Windows 2003, Windows 2008, or RedHat Enterprise Linux 5. It may use either Microsoft SQL, MySQL, Oracle, or SQLite as it’s backend database, although there are restrictions on each database. MySQL seems to be the recommended database to use, as it has the fastest query times due to it’s MyISAM structure, and it has minimal restrictions across the server Operating Systems.
I will be installing and configuring System Reporter 2.8 on a RedHat Enterprise Linux 5.8 virtual machine. I will be using MySQL as the database backend, which will be installed on the same host virtual machine. In part 2 of this series, I will be then be installing and configuring System Reporter. Part 3 will be configuring and adding a 3PAR InServ system, in my case a T400. Part 4 will be setting up Adaptive Optimization. Part 5 will be all about reports, and how to create custom and scheduled reports.

System Requirements

System Reporter has the below requirements for it’s host system:
  • CPU: Pentium 4, 3Ghz or faster
  • Memory: 1GB
  • Disk: 20GB free space
Please make sure your host system meets or exceeds these requirements, prior to installation.

Install Linux

The first step, is to make sure you have a freshly installed and updated RedHat EL 5 installation. I chose to use the normal installation, and deselected anything I didn’t want. I left the apache webserver installed, as well as X11, but removed all Window Managers. After fully updating the installation with ‘yum –y update && yum –y upgrade’ I began the rest of my installation.

Install Apache Webserver

From the command line, issue the below command:
yum –y install httpd
This will install the Apache Webserver, if it has not already been installed.

Install 3PAR CLI

The System Reporter installation CD has both a Windows and a Linux directory, which contain all files necessary for installation. In my example, we are using Linux, so to install the CLI, you will need to copy the Linux/CLI/setup.bin file from the CD, on to your Linux host.
Once the file has been copied, change it’s permissions to be executable, and run the file:
 chmod +x setup.bin
./setup.bin
You will be prompted several questions, including where to install the CLI. I would recommend using the /opt/ location it defaults to. Make sure you write down this location, as it will be needed later in the installation. Once the installation is completed, it’s time to move on.

Install MySQL

Next, you need to install mysql. Connect to your linux server with ssh, and issue the command:
yum –y install mysql-server
Once the installation is completed, you will need to set the root database password.
To do this, issue the below commands:
mysqladmin -u root password "NEWPASSWORD"
mysqladmin -u root -h localhost -p password "NEWPASSWORD"

Installing System Reporter

Now that your system is ready, you can move on to Part 2, Installing System Reporter. Part 2 will be posted within a few days.
If you have built your base system as a Virtual Machine, now would be a great time to take a snapshot, or build a template for future installations.

Monday, September 16, 2013

Get quick, free stats from your vSphere environment with RVTools

RVTools is a FREE Windows .NET 2.0 application which uses the VI SDK to display information about your virtual machines and ESX/ESXi hosts. RVTools works with:
  • VirtualCenter/vCenter 2.5 and higher (including vCenter 5.1)
  • ESX/ESXi/vSphere 3.5 and higher (including vSphere 5.1)
RVTools is able to list information about:
  • Virtual machines
  • CPU
  • Memory
  • Disks
  • Partitions
  • Network
  • Floppy drives
  • CD/DVD drives
  • Snapshots
  • VMware tools
  • Resource pools
  • ESX hosts
  • HBAs
  • NICs
  • Switches
  • Ports
  • Distributed Switches
  • Distributed Ports
  • Service consoles
  • VM Kernels
  • Datastores
With RVTools you can disconnect the CD-ROM or floppy drives from the virtual machines and RVTools is able to update the VMware Tools installed inside each virtual machine to the latest version.

Sunday, September 15, 2013

3 Command line tool to test bandwidth between 2 servers

One element that is often not know, or that should be measured after a problem statement or after a change in the infrastructure is the network . But how do you accurately measure the speed between two servers?
Someone use ftp, scp or other file transfer protocols, these can give some indication, but probably you’ll measure the limit of your disks or CPU.
In this article I will show you 3 way to measure the bandwidth from the command line, without using the disks.



Iperf

Iperf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.
The quality of a link can be tested as follows:
- Latency (response time or RTT): can be measured with the Ping command.
- Jitter (latency variation): can be measured with an Iperf UDP test.
- Datagram loss: can be measured with an Iperf UDP test.
The bandwidth is measured through TCP tests.
To be clear, the difference between TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) is that TCP use processes to check that the packets are correctly sent to the receiver whereas with UDP the packets are sent without any checks but with the advantage of being quicker than TCP.
Iperf uses the different capacities of TCP and UDP to provide statistics about network links.
With Iperf you have a server machine where iperf put itself in listening and the other that is the client that send the informations.
Example:
iperf
Basic usage:
Server side:

#iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[852] local 10.1.1.1 port 5001 connected with 10.6.2.5 port 54355
[ ID]   Interval          Transfer        Bandwidth
[852]   0.0-10.1 sec   1.15 MBytes   956 Kbits/sec
------------------------------------------------------------
Client connecting to 10.6.2.5, TCP port 5001
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[824] local 10.1.1.1 port 1646 connected with 10.6.2.5 port 5001
[ ID]   Interval          Transfer        Bandwidth
[824]   0.0-10.0 sec   73.3 MBytes   61.4 Mbits/sec
Client side

#iperf -c 10.1.1.1 -d
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to 10.1.1.1, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 5] local 10.6.2.5 port 60270 connected with 10.1.1.1 port 5001
[ 4] local 10.6.2.5 port 5001 connected with 10.1.1.1 port 2643
[ 4] 0.0-10.0 sec 76.3 MBytes 63.9 Mbits/sec
[ 5] 0.0-10.1 sec 1.55 MBytes 1.29 Mbits/sec
So using Iperf (with appropriate flags) on both our machines we can simply measure the bandwidth between them.
Iperf is available also for Windows.
Complete guide: http://openmaniak.com/iperf.php

Netcat

To eliminate the disks from having any part of the transfer, we will use netcat transferring the output of command yes. Netcat is described as being a “feature-rich network debugging and exploration tool”. It can be obtained from Source Forge, or it may already be available in your distribution.
Again we will use one of the machines as a server that receives the data and the other as a client that sends the information.
Basic usage
On th server machine
nc -v -v -l -n  2222 &gt;/dev/null
listening on [any] 2222 ...
On the client machine
time yes|nc -v -v -n 10.1.1.1 2222 &gt;/dev/null
On client stop the process  after 10 seconds (more or less) with ctrl-c, you’ll get something like:
sent 87478272, rcvd 0
 
real 0m9.993s
user 0m2.075s
sys 0m0.939s
On the server machine, note the data received (in bytes)
 sent 0, rcvd 87478392
Now multiply the bytes rcvd by 8 to get total bits, then divide by the time: Result in this example is 70Mb/s
Reference: http://deice.daug.net/netcat_speed.html

Bandwidth Test Controller (BWCTL)

BWCTL is a command line client application and a scheduling and policy daemon. These tests can measure maximum TCP bandwidth, with various tuning options available, or, by doing a UDP test, the delay, jitter, and datagram loss of a network.
The bwctl client application works by contacting a bwctld process on the two test endpoint systems. BWCTL will work as a 3-party application. The client can arrange a test between two servers on two different systems. If the local system is intended to be one of the endpoints of the test, bwctl will detect whether a local bwctld is running and will handle the required server functionality if needed.
The bwctl client is used to request the type of throughput test wanted. Furthermore, it requests when the test should be executed. bwctld either responds with a tentative reservation or a test denied message. Once bwctl is able to get a matching reservation from both bwctld processes (one for each host involved in the test), it confirms the reservation. Then, the bwctld processes run the test and return the results. The results are returned to the client from both sides of the test. Additionally, the bwctld processes share the results from their respective sides of the test with each other.
bwctl_arch
For more information check the man page: http://www.internet2.edu/performance/bwctl/manpages.html

How to use DiskSpd to simulate Veeam Backup & Replication disk actions

This HOW-TO contains information on how to use Microsoft© DiskSpd to simulate Veeam Backup & Replication disk actions to measure disk pe...