Opinion

Monitoring, a journey

Or “How I Stopped Worrying and Learned to Love SaaS”

I touched on monitoring in an earlier post but I thought that I would expand on my thoughts.

Let me just get this out there: LogicMonitor (company site) is awesome. It’s not perfect (what is?), but it’s amazing, simple, straightforward, and it works. It combines effective monitoring with graphing (metrics); it’s easy to understand and customize and it works.

Repeat: It works.
More >

Found Script: Backing up data with BASH and XZ

Quick post this week as I’m a little distracted by the impending weekend.

Here’s a script that I use to backup my Maildir. Normally I write my own, but I was feeling lazy. So in the interest of not re-inventing the wheel, I decided to copy one. Unfortunately, I forgot where I got it. Normally I’m good about attributing things that I copy/utilize. So, if this is your script, thank you! If you want attribution, please let me know.

This is just a bash script. It creates a xz’d tar file in my /home/nick/Archives directory/

First, check for input.’

#----script to backup files

if [ $# -lt 1 ]
then
   echo Usage: backup.sh Directory
   exit
fi

Next, create the date stamp.

JJJ=`date '+%d%m%y'`

This is the main loop. It processes for each in the attribute list ($#)

while [ $# -gt 0 ]
do

Print the directory we’re currently working on, then set the DIR variable to that directory’s path.

   echo $1
   DIR=$1

Truncate the directory path of the DIR variable

   MODDIR=`basename $DIR`

Verify the directory exists before doing anything

   #----check file exists
   if [ ! -d $DIR ]
   then
      echo Error: File \'$MODDIR\' not found!!

Check to see if the destination folder exists. This is where I hard coded it to be /home/user/Archives. If it doesn’t, create the backup locally.

   else
      if [ -d ~/Archives ]
      then
        DESTTAR=~/Archives/$MODDIR.$JJJ.tar.xz
      else
        DESTTAR=$MODDIR.$JJJ.tar.xz
      fi

Check to see of the destination file exists. If it does, complain and exit.

    if [ -d $DESTTAR ]
        then
                echo Error: File \'$DESTTAR\' already exists!!
                exit 0

Tar the archive using the xz compression method (the “J” attribute in the tar command)

    fi
      tar -cJf $DESTTAR $DIR
   fi
   shift
done

And we’re done! At some point I’ll add an auto-pruning portion to the script.

I just stick the script in my personal bin folder, make it executable, edit my crontab and put an entry in it pointing to my Maildir, and I get nightlly backups of all my mail.

Building things: cubicle analogy time

This week, I’ve been building (actually, rebuilding) cubicle desks in our new office space and comparisons were naturally drawn to building virtual machines a few weeks ago.

More >

Kickstart your Linux install

I’ll admit it, I’m not a huge fan of Red Hat Enterprise Linux. I’ll administer it, I’ve worked with it. It’s a good distribution. I just have a bad taste for RPM based distributions based on my first forays into Linux back in my Mandrake days. I also first started to professionally work with Linux during the last couple of years of RHEL 5, when things were getting long in the tooth. Red Hat’s release schedule also conflicts with what most of my users want and expect; it’s far more suited to an corporate environment where having the latest features is not nearly as important as having consistent software versions. That being said, Red Hat has some fantastic tools; Anaconda and Kickstart being my favorite. So I was overjoyed when I discovered Ubuntu had support for Kickstart files! The Ubuntu installer can take Debian style preseed directives but in my opinion is overly complicated.

A Kickstart file basically answers the questions that pop up in the installer as the installer goes removing the need for human interaction. If an question isn’t answered, the installer pops up with the proper dialog, takes user input, and continues. I can pick and choose what information I want to populate automatically and which information dialogs I want the customer to answer. In my auto install ISOs I prompt the customer for a username and password as I want the users to enter that information.

When I was tasked with making an auto installing ISO for our customers I was able to create one quickly by using a kickstart file.
More >

SysAdmin Golf: Use dd and netcat to clone a Linux machine

So, we’ve been working real hard here at ipHouse figure out ways to help customers move machines into our vmForge VDC product. VMware Converter works for Windows machines, (allegedly, I’m going test it soon) but isn’t so helpful with Linux machines. After wracking my brain, I thought about the various tools used to clone Linux boxes. I’m familiar with dd, a block level disk copying tool, and tried to find a way to use dd to create a VMDK, that I could then convert into a OVF and upload. More >