Friday 15 January 2016

Nagios process check simple fix

I'm setting up Nagios for the second time and I'm having to refresh my memory while setting up the service checks. I found a quick fix for one of the template services that always seems to fail - the process check for Explorer.exe. On all of the servers I setup Nagios reported that Explorer.exe wasn't running and was in a critical state. I couldn't see what was wrong with the check initially and that's because at first glance there isn't anything wrong with it. Until you look closer at the process information in task manager and notice that the process for Windows Explorer is called explorer.exe (lower case). It turns out that Nagios process checks are now case sensitive. I tested this with a couple of other processes, testing with upper case, lower case and normal case spellings and this confirmed it for me.

Slow down a network file copy

I've recently been virtualising our servers at work and I completed a P2V of our main server. This has been the most difficult to do because it previously hosted all of the network services, so it's been difficult to take offline and separate out the roles onto virtual machines without causing too much disruption. Anyway I was down to the last step, which was to virtualise the remaining database server but it generated a massive 400GB VM to copy onto the Hyper-V host.

I kicked off the copy from the physical server to it's new home and thought nothing of it, until one of my colleagues sitting next to me started to complain that database access had really slowed down. I checked task manager and discovered that the copy process had consumed 100% of the network bandwidth on the server. I quickly cancelled the copy and everyone in the building thanked me for working my magic and getting things working again!

I decided that if I wanted to complete this transfer and get started setting up the new VM I needed to find a way to copy the VHD file without using up all of the bandwidth on the server. Fortunately it only took a short amount of Google searching to find what I was looking for. The really handy Robocopy program built into Windows has an option called inter-packet gap that allows you to specify a copy speed when copying across the network. In my case I reduced the copy speed to only 25% of the network card bandwidth and although it took longer it copied successfully without interfering with the network based services on the server.

You can find out all about the options for Robocopy (including the wonderful inter-packet gap) here.