Archive for July, 2009

Migrating a DHCP server from one server to another

Wednesday, July 29th, 2009

Heres a neat trick, seems to work ok. Remember however, when you export it switches off the old dhcp server. So be quick!

http://support.microsoft.com/kb/325473/

Nagios – Example using check_icmp

Friday, July 24th, 2009

This is what would be needed in your hosts configuration to monitor using check_icmp rather than check_ping.

define service{
use                     generic-service ; Inherit values from a template
host_name               SWITCH    ; The name of the host the service is associated with
service_description     PING            ; The service description
check_command           check_icmp!40.0,10%!100.0,40%  ; The command used to monitor the service
normal_check_interval   5               ; Check the service every 5 minutes under normal conditions
retry_check_interval    1               ; Re-check the service every minute until its final/hard state is determined
}

This is what would be needed in the commands.cfg

# ‘check-host-alive’ command definition
define command{
command_name    check_icmp
command_line    $USER1$/check_icmp -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 2
}

This makes the assumption its going to do two pings, otherwise turn “-p 2″ into $ARG3$ instead!

Vi Find and Replace Example

Friday, July 24th, 2009

Here is an example of find and replace with VI, this will replace every instance of the “findthistext” string in the file with “replacewithtext”. Neat saves lots of typing!

:%s/findthistext/replacewithtext/g

Nagios – check_icmp

Friday, July 24th, 2009

With Nagios using check_icmp is the way to go, it better and faster, below is an example configuration directive for setting the check-host-alive command which will be used by each host check.

# ‘check-host-alive’ command definition
define command{
command_name    check-host-alive
command_line    $USER1$/check_icmp -H $HOSTADDRESS$ -w 30,5% -c 100,20% -p 1
}

Nagios NSClient++ Access Denied Error on Installation

Tuesday, July 21st, 2009

I have the following problem when trying to install nsclient++ onto a Windows 2003 Server SP2 (note this is a member server).

Using a local administrator account on the server trying to install the install completes but the service does not get registered trying to manually register gives this error:

C:\Program Files\NSClient++>nsclient++ -install e NSClient++.cpp(212) Service installation failed: Unable to install service.5: Access is denied.
RESOLUTION

I ran “FileMon” tool from SysInternals which installing the service, and found access denied errors. But permissions where not the problem. It turned out that Sophos Anti-Virus thought the “Nsclient++.exe” was a virus. Once I authorised the nsclient++.exe file in Sophos the service could install and run fine.

VSphere 4 Cheat Sheet

Sunday, July 19th, 2009

I’m still trying to get VMWare 3.5 installed completely and servers virtualised. But utlimately it would be nice to use vSphere4 in the end.

Heres a good PDF showing the new features and how the licencing works (which has been made a bit more complicated! :) )

http://www.boche.net/blog/wp-content/uploads/2009/VsphereData.pdf

Backup and Data Protection – DeltaCopy – rSync for Windows

Tuesday, July 7th, 2009

To ensure I have a good off-site synch of my data i now use DeltaCopy http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp its basically a version of rsync for windows. Its quite simple to setup and works well. The package includes the client and the server.

In my case i have two servers, one local, one remote, the two sync with each other to make copies of each others data on the other server. Then I take a local backup of one of the servers to USB hard disk. So i have an on-line backup locally on RAID 1, that is synched onto another server with RAID 1, this is also then periodically saved onto a USB hard disk. So I would need 5 disks to die simultanously to lose any data.

I’ve also been investigating an offsite backup using Carbonite http://www.carbonite.com/ for another off-site backup on t’other side of the world for a bit extra piece of mind.

How to setup the NSClient++ on Windows

Thursday, July 2nd, 2009

http://www.thegeekstuff.com/2008/07/how-to-monitor-remote-windows-machine-using-nagios-on-linux/

VI – Search and Replace with a pathname

Thursday, July 2nd, 2009

Find and replace with VI on a pathname is a bit tricky you ned to use escape characters.

In this case /bin/mail should be replaced with /usr/bin/mail

The command below would do it:

:%s/\/bin\/mail/\/usr\/bin\/mail/g