Ramblings From The Litter Tray of Life

Installing APC Shutdown Agent on ESX 3.5

Posted by graycat on 7 May 2010

If you’ve got a VMware host then you’ll be running it on some kind of UPS …… I hope! Personally we use the various APC offerings and need to make sure the host and virtual machines are all covered in case of a poweroutage.

Handily enough, APC have provided a single server licensed application that you can install on the host and have it deal with the UPS and shutting down / starting the virtual machines back up. Here’s how I did it:

Firstly download the application from APC and upload it onto your VMWare host. I’ve got a folder on the host for iso images so just dropped it in there using the VMWare Infrastructure Client to do so. Once I’d done this I did connected to the host via ssh and located the directory and copied the install tar file over to /downloads
find / -name ISOs
cp /vmfs/volumes/4798efa5-f7531804-98d6-001b789b7576/ISOs/pcns224esx.tar.gz /downloads/

Now that’s all done I had to reset the file permissions
cd /downloads/
chmod 777 pcns224esx.tar.gz

unzip and then untar the tarball as follows
gunzip pcns224esx.tar.gz
tar -xf pcns224esx.tar

You will then have a bunch of files looking like this:

[Admin@vmhost01 downloads]$ ls -la
total 65432
drwxr-xr-x 2 root root 4096 Apr 30 09:52 .
drwxr-xr-x 21 root root 4096 Mar 20 13:32 ..
-rw-r–r– 1 root root 60691 Oct 8 2009 install.htm
-rwxr-xr-x 1 root root 33214 Oct 8 2009 install.sh
-rw-r–r– 1 root root 31451007 Oct 8 2009 jre1.5.0_18_linux.tar.gz
-rwxrwxrwx 1 root root 33454080 Apr 30 09:46 pcns224esx.tar
-rw-r–r– 1 root root 1868101 Apr 30 09:52 pcns224.tar.gz
-rw-r–r– 1 root root 24647 Oct 8 2009 relnotes.htm
-rw-r–r– 1 root root 1132 Oct 8 2009 silentInstall.sample

Run the install script
./install.sh

You’ll then be faced with an EULA to agree to and a bunch of configuration questions which will probably look a bit like this:
Do you agree to the above license terms? [yes or no]
yes

Please enter the PCNS instance number [1|2|3] or press enter to use default value of 1:

1 PCNS instance(s) will be installed.

Please enter the installation directory or press enter to install to the default directory (/opt/APC/owerChute):

Are you sure you want to install PCNS to /opt/APC/PowerChute [Yes|No]?
yes
Creating /opt/APC directory …
PCNS will be installed to /opt/APC/PowerChute
Copying the installation files …
Extracting PCNS files …
PCNS is extracted to /opt/APC/PowerChute

Please enter java directory if you want to use your system java (example:/usr/local/bin/jre/jre1.5.0_8) or press enter to install the bundled Java:

Copying jre to /opt/APC/PowerChute/jre …
Extracting jre to /opt/APC/PowerChute/jre …

java version “1.5.0_18”
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
Java HotSpot(TM) Client VM (build 1.5.0_18-b02, mixed mode, sharing)

JAVA_DIR=/opt/APC/PowerChute/jre/jre1.5.0_18

Configuring startup files …
Startup script=/etc/rc.d/init.d/PowerChute
Updating Linux symbolic link …
Configuring uninstall script …

Completed.
Please run the PCNSConfig.sh script located within the PCNS installation directory to complete the intallation.

Once you’ve followed that all the way through (it doesn’t take that long, honest!) you’ll be on to installing the PCNS side of things. This is hiding under /opt/APC/PowerChute/group1/PCNSConfig.sh in case you can’t find it. Run that script and follow the wizard to finish the install like this:
[root@vmhost01 group1]# ./PCNSConfig.sh

————————————————–
PowerChute Network Shutdown Configuration Utility
————————————————–

Press Ctrl + C at anytime to abort.

Configuring PowerChute Network Shutdown …

[1]: Configure for a single UPS device
[2]: Configure for a parallel Silcon UPS / Smart-UPS VT / Gala
[3]: Configure for multiple Smart-UPS or Galaxy devices
[4]: Configure for multiple Symmetra devices

Please select the appropriate configuration type (1) [ 1 – 4 ]

Management Card IP: 192.168.48.137
Management Card Port # (80):
Administrator User Name: apc
Administrator Password:
Authentication Phrase (default):

Setting Summary:

Management Card IP: 192.168.48.137
Management Card Port #: 80
Administrator User Name: apc
Administrator Password: [ MASKED ]
Authentication Phrase (default): [ MASKED ]

Do you wish to register these settings [ Yes | No | Abort ]? y

Registering PowerChute Network Shutdown with the management ca
PowerChute Network Shutdown registration completed successfull

Do you wish to start the PowerChute Network Shutdown service [
PowerChute Network Shutdown service started.

Configuration completed.

At this point you’ve just got to configure the VMWare side of things so it can shutdown the hosts properly in case of a power outage. This is actually the easiest bit.

1. Go to the vCenter Server, and for each ESXi host, select “Virtual Machine Startup/Shutdown”.
2. Change the Virtual Machine Shutdown setting from “Turn off” to “Guest Shutdown”.
3. Specify the shutdown order, by arranging guest VMs in “Startup Order”. (Shutdown order is the reverse of startup order).
4. Click OK to accept the changes.
5. Change the “Any Order” option to “Manual Startup” for all the VMs.
6. Change the “Startup” settings to “Disabled” for all the VMs.

And whilst you’re at it you may was well sort the startups out as well:
1. Go to the vCenter Server, and for each ESXi host, select “Virtual Machine Startup/Shutdown”.
2. Move all guest VMs to “Manual Startup” from “Any Order”
3. Change the “Startup” settings to “Disabled” for all VMs.
4. Click OK to accept the changes.

Now just go and unplug the UPS from the mains to test …….. ONLY JOKING!!!!

Posted in IT | Leave a Comment »

Upgrading Nagios

Posted by graycat on 30 April 2010

For those of who have to look after multiple servers then you’ll understand the benefits of monitoring systems. In fact anything that will tell you of a problem before it becomes a major one has got to be a good thing!

Now whilst there’s many offerings out there in the market with solutions to fit every budget and requirements I’ve gone for Nagios. Nagios is an open source offering which really differs from others in the fact that it’s just the framework for the monitoring and you have to build or bolt on the checks on top. For me, this modular design is excellent as I know I’m starting with a blank slate and then adding only the bits I need.

Having have a Nagios box in place for well over a year now, I felt it was time to update the configuration into something a bit more manageable (covered in another post) but before I could do that I took the time to upgrade the application itself. It was an interesting process and one with a few tweaks from standard which may be applicable to others.

The upgrade of a vanilla install is pretty simple and covered here, however I’ll throw down a quick summary:

ssh onto the box and run as the local nagios account
su -l nagios

Remove the old HTML files that were being used by the gui frontend as they’re going to be upgraded.
rm /usr/local/nagios/share/{main,side,index}.html

Change into your downloads directory and download the latest source code of nagios
cd /downloads
wgetttp://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.x.tar.gz

Extract the tarball
tar xzf nagios-3.x.tar.gz
cd nagios-3.x

Run the confguration script with the name of the group used to control the external command file permissions
./configure –with-command-group=nagcmd

Compile the source code, install the updated binaries and web interface.
make all
make install

Verify the configuration files all work with this handy command:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Restart nagios service like thus:
/sbin/service nagios restart

Note: I found some of these stages more reliable to run as root rather than the nagios user.

At this point you’re pretty much done with the upgrade of a vanilla system. However, I use the Nuvola style to make Nagios that much easier on the eyes.

The Nuvola style sheet is pretty easy to install and tweak but does override some of the default web front end. Unfortunately when you upgrade Nagios it tramples all over these files so you have to rerun the install almost from scratch.

Posted in Applications, IT | Leave a Comment »

Install CentOS 5 via NetInstall

Posted by graycat on 9 July 2009

I’ve recently started playing with linux to the point that it’s in the live domain now doing various rolls. However, I’ve recently tried installing it on an old and dodgy laptop for a specific task and ran into a few issues.
Firstly the only install CD I had was in fact a DVD which whilst no big deal normally would not boot in this laptop. I told you it was old, right?
I looked at downloading the install CDs but there are five or so of them and it just didn’t light my fire. Then I discovered NetInstall – basically this is a tiny iso that allows you to boot from it, point the install at the online repositories and install from there over the network.

Neat, huh?

I found a really good guide here (http://www.chrisgountanis.com/technical/34-technical/45-centos-netinstall.html) but failed at the first hurdle of starting the install. The error message was something like “Could not find kernel image: linux”.
Touch annoying but it turns out it is a known bug. The really easy solution is to type the following command at the start screen and hit go: “/isolinux/vmlinuz initrd=/isolinux/initrd.img”
Once that’s going, follow the previous link to get the install going as per normal and you’re well away.

Now to just watch the blue line work its way across the screen …..

Posted in IT | Leave a Comment »

Deploying AutoCAD 2010 via GPO (Bringing it all together)

Posted by graycat on 16 June 2009

Now we’re a good four posts into my trial and tribulations of deploying this application via GPO, I thought it’d be a good time to round it all up together in what should hopefully be my last post on this subject for a while. Ok, I may do a complete “how to” once it gets out of the testing phase but one step at a time, ok?

The basic process of installing this application unfortunately requires more than just the deployment package from AutoDesk. To successfully install AutoCAD 2010 you will need to also install the following:

  • DirectX 9.0c and its latest updates.
  • 2008 C++ redistributable library / package
  • the missing files from the deployment

This also have to be installed in the above order with the AutoCAD package slotting in nicely before the missing files. To do this I’ve split the deployment into two GPO’s – the first installs DirectX and updates it to the latest version whilst the second installs both the C++ and AutoCAD msi packages before running a startup script to pull the missing files. To make sure these GPOs run in the right order (ie: AutoCAD doesn’t try installing before its got DirectX etc) I’ve use a WMI filter to control the second GPO.

For those of you familiar with GPOs you will no doubt be familiar with WMI filters. If you’re not familiar with them already, they can be summed up as a local check on the PC for a defined condition to be true before the GPO will activate. A lot of cases will look for an installed applicaiton (Office 2003 if you’re installing the 2007 compatability pack for example) or many other things.

In this case I’ve used the WMI filter to look for a directory under C:\Windows that only arrives after the DIrectX update. Here’s the filter:

Select * from Win32_Directory where name = ‘c:\\Windows\\Microsoft.Net\\DirectX for Managed Code’

It’s set in the root\CIMv2 namespace incase you were awake and wondering about that. ūüôā

Once you’ve set the DIrectX update / deployment GPO up successfully and controlled the AutoCAD GPO via this WMI filter it should all install fine. I’ve moved on to testing this on a large group of live production machines and these little changes have really helped. The only tweaks I do have are for neatness of scripts and installs (eg: the copy script needs to hide the copy section from view) but that’s minor and more to do with me being picky.

Hope that helps somewhat with your endeavours of deploying this application via GPO.

Posted in IT | Tagged: , , , , , , | 2 Comments »

Deploying AutoCAD 2010 via GPO (Part 4)

Posted by graycat on 10 June 2009

Or  Death by Application Rollout!

Now that I’m into the testing phase on live machines, all manner of lovely issues seem to crop up. Here’s some of the major ones and how to resolve them.

FATAL ERROR: Unhandled e0434f4dh Exception at 7c812a5bh

This is related to the .NET installs on the local machine. The latest version I have allowed here is 3.5 SP1 and there seems to have been issues with the initial release from MS. A quick an easy resolution to this is to uninstall the SP1, reboot the machine and let it pick up the updated SP1 from WSUS or wherever. In all the cases I’ve had here, this has resolved the issue nicely.

Various DLL, cui / cuix and chm files missing

This was a tough one to figure out but it seems for some reason that the msi package doens’t copy all the dll files down from the install point. To resolve this, I added a start up script to the policy like this:

REM     check if done previously
if exist “c:\Program Files\AutoCAD 2010\dllsynch.flg” exit else
goto copy

:copy
REM    synchronise dll files from install point
start /wait xcopy /d/e/h/c/y “\\domain\dfs\it\Deployment\ACAD2010_Fixed\AdminImage\x86\acad\en-us\Acad\Program Files\Root” “c:\Program Files\AutoCAD 2010\”

REM    create dllsynch.flg to prevent rerun.
echo done > “c:\Program Files\AutoCAD 2010\dllsynch.flg”

Exit

As you can tell I’ve added a bit more into it to synchronise the whole directory. At first it was just the dll files but there was a later issue involving chm and cuix files. No idea why these files don’t make it down to the computer but this seemed to resolve various issues.

New Features Workshop

This was due to missing chm files in the install directory. The script sorted that one out.

Missing acad.chm

This is the help menu which I’m told could be pretty useful and fortunately it’s a simple missing chm file. Thankfully, the script (I’m beginning to think it needs a proper name!) sorted this one out again.

Well, second round of installs is tomorrow so we’ll see how things go. Watch this space as they say. ūüėČ

Posted in IT | Tagged: , , , , , , , , , , | Leave a Comment »

Deploying AutoCAD 2010 via GPO (Part 3)

Posted by graycat on 9 June 2009

or  AutoCAD 2010 and my DLL HELL!

Following on from my previous posts on deploying AutoCAD 2010 via GPO you may will noticed that I’ve run into the dreaded dll issues that sometimes plague these installs. In most cases a rebuild of the initial admin install point of msi is required but that hasn’t worked in this case.

My slightly off the wall but works solution is to synchronise the dll directory in the installation package with the local install directory. Here’s my little script that has a few extra bits in:

REM     check if done previously
if exist “c:\Program Files\AutoCAD 2010\dllsynch.flg” exit else
goto copy

:copy
REM    synchronise dll files from install point
xcopy /d/e/h/c/y “\\domain\dfs_share\it\Deployment\ACAD2010Fixed\AdminImage\x86\acad\en-us\Acad\Program Files\Root\*.dll” “c:\Program Files\AutoCAD 2010\”

REM    create dllsynch.flg to prevent rerun.
echo done > “c:\Program Files\AutoCAD 2010\dllsynch.flg”

Exit

As you can see that does a quick flag file check then synchronises the dll files in there and creates the flag file so it only does it the once.

Fortunately that seemed to cover most if not all of the dll errors I ran into and at which point the application runs smoothly.

After retesting from scratch on a blank machine, I found the group policy was working and the application was deploying ok but it took two restarts – the intial one to get the gpo and start the install and the second to finish it off.

I’ve tracked this down to the scripted installs of DirectX running after the msi package of AutoCAD 2010 has tried to install. As DirectX isn’t installed by this point, AutoCAD aborts then the DirectX installs. A reboot finishes off the AutoCAD install fine.

Posted in IT | Leave a Comment »

Deploying AutoCAD 2010 via GPO (Part 2)

Posted by graycat on 9 June 2009

Carrying on from my previous post on deploying AutoCAD 2010 via GPO here’s an update with the latest problems and solutions I’ve run into.

AutoCAD LT¬† deploys fine now. I think after the scripted installs had finished doing their thing, it was happy. Since then all the deployments have gone through fine including those on live machines. Now it’s all down to the CAD guys to let me know how it works.

I’ve since rolled up my sleeves and am taking a swing at the bigger one with the full fixed licence install.

The installation package went up to the server / dfs share fine as you would expect but my god it’s huge! 1.4Gb to be slightly more accurate!! Ok, so that is with all the packages included but it’s still a touch large in my opinion. The price of progression and all that.

So post package upload I was looking through it and it claims to have the C++ package embedded so I decided to leave my own package off at this point and see how it rolls. I created the new GPO, security group, wiped the test rig and linked it all together.

Unfortunately it failed.

DirectX – error message¬† saying “must install DirectX first” was he only indicator which was a bit frustrating as DirectX was already installed! A quick test using “dxdiag” confirmed it was there but the install package was just not having it.

Looking into deploying DirectX showed some interesting approaches out there. A quick try of a few and the most reliable one was using the web setup. To do this you need to download the dwebsetup.exe from Microsoft and then setup a nice startup script to actually run the install. Here’s mine:

REM    Check if dxwebsetup.exe exists already
if exist %windir%\system32\DirectX\DXWebSetup.exe exit else

REM     make folder and copy down base installer
md %windir%\system32\DirectX

xcopy /c/y \\domain\dfs\it\deployment\directx\dxwebsetup.exe %windir%\system32\DirectX\

REM     install DirectX
%windir%\system32\DirectX\DXWebSetup.exe /c:”DXwSetup.exe /windowsupdate” /q /r:n

Exit

Let that one rip and ……. AutoCAD 2010 installs like a dream!!

Kinda. Well, until you try to run it and then you get an error message stating: “adui18res.dll no found”

Damn.

Watch out for part 3 when I tackle that particular issue!

Edit: After further testing it seems the script needs to hang on for a bit whilst DirectX finishes the download and install. To make it do this, simply add “start /wait” to the front of the line running dxwebsetup.exe and the PC will launch it as a seperate process and wait until it terminates before moving on.

Posted in IT | Tagged: , , , , | Leave a Comment »

Deploying AutoCAD 2010 via GPO

Posted by graycat on 2 June 2009

If you’re in the engineering or architectural business at all then I’m sure you’ll be familiar with AutoDesk’s AutoCAD offerings. I don’t think I’m wrong in saying it’s probably the most commonly used CAD program around the world. I’ve used a few others here and there but by far the most common is AutoCAD.

So when a new version comes out, you’d think it’s be pretty easy to roll out? You’d be wrong. In fact I don’t think I’ve had a smooth roll out of AutoCAD since the 2007 version. The 2008 had a materials libary with texture files that were longer than 256 characters in length not to mention the .NET problems that seem to have plagues AutoCAD for years.

It was with a slight feeling of anticipation of the challenge and a resigned air of “this is not going to be straight forward at all” that I downloaded the latest version and set about creating the deployment package. Thinking I was being clever, I went for the LT version as a starting point as they are usualy the easiest. Boy was I wrong!

The creating of the initial image is a plain and straightforward as ever – stuff disc in / run package, tell it what you’re doing, point it at the server share and you’re away. For most applications that’s the most difficult bit.

Initial problems were calling out with many “side-by-side” errors in the system log. I kid you not, one of my admins checked this machine looking at a Java rollout we’re doing and just about died of panic! Fortunately he wasn’t holding anything when he fainted so we just left him to get on with it.

These erros are pointing towards a C++ error rather than my expected .NET runtime issue (don’t worry though, they’re in there to!) and a quick google points towards having to install the libaries. Fortunately Microsoft provide a redistributable package for just that …… unfortunately it’s in the form of an exectuable though. There are a bunch of exmples on their websites for deploying this via scripts (ie: xcopy it to the local machine then run the exe with “/q” on the end) so had to suffer it.

The 2005 C++ redist package made no effect what-so-ever and really depressed me. My few living braincells then kicked in with the thought that it’s a brand new app so why not use the latest C++ package (ie: 2008). A quick Google found me not only the package but also a throw away line in a forum saying that it extracts to an msi! Now we’re talking my language! A quick download and double click gets the first install menu whilst a quick search for “*.msi” locates a new msi in a temp directory. Just to be safe, I copied all of this folder up to our deployment share ready to go.

A quick edit of the original GPO to add the 2008 C++ package, restart the test rig and ……. it works!!

well, it gets you to the front page at least. now it’s just a matter of working through the rest of the bugs….. but that’s a job for tomorrow I think.

Posted in IT | Tagged: , , , , | Leave a Comment »

Customising System Properties

Posted by graycat on 30 May 2009

If you build your own PCs for a living or look after corporate ones with standard builds, you may find it interesting or useful to customise the system properties of a machine if only to add a little “corporate identity” and colour.

Here’s how I do it:

The logo – create a new bmp image file 180×114 pixels in size with whatever you want to display. Yes you can use rude pictures, no I don’t think that’s a great idea for work even though it might be funny. Maybe an April Fool idea though ….
Once you’ve got your logo up and running as you like is, copy it to %SYSTEMROOT%\System32. This will be c:\WINNT\system32 in a 2000 machine and c:\windows\system32 in and XP machine.

The writing – open Notepad and create a new text file with the following info:

[General]
Manufacturer=Graycat.com
Model=ICMB 500

[Support Information]
Line1=” ”
Line2=” For general support, upgrades and questions please”
Line3=” log on to the IT Help Desk at:”
Line4=””
Line5=””
Line6=”¬†¬† ¬†¬†¬† ¬†http://Help.Desk.com ¬† ¬†¬†¬†¬† ”
Line7=””
Line8=””
Line9=” For urgent issues contact you local IT admin.”

Obviously customise that to your liking and environment then save as “oeminfo.ini” in the same directory as the logo.

Now when you hit the system properties you’ll have your company logo displayed with the first two lines under [general]. When you click the support information button, you’ll get the rest of the information too (warning: only the first ten lines though).

Neat huh?

Posted in IT | Tagged: , , , | Leave a Comment »

How To Build A Network Boot Disc

Posted by graycat on 16 May 2009

If you’re using a network based system for deploying your corporate images such as Symantec’s Ghost Solution or Suite then you will no doubt be familiar with network boot discs. As a concept they simply load a small operating system into RAM from CD or floppy disc during boot with the sole aim of getting the machine on the network. Usually once they’re actually chatting away on the network happily you then map a drive and run an executable like ghost.exe and have fun from there.
Unfortunately there are limitations with the ones built with ghost etc so here’s my guide on making a super-duper all singing and dancing one. Hopefully this will work with all the network cards on your network but every now and then you run into an awkward one. As a fail safe, I thoroughly recommend you have an Intel Pro network card spare and to hand and use that in a pinch.

Software needed:
1. The bootdisk – http://netbootdisk.com/index.htm
2. Menu editor – http://netbootdisk.com/menuedit.htm
3. Floppy disk to image – http://www.winimage.com/download.htm
4. CD Burner – Nero works but I prefer “CD Burner XP Pro v3” as it’s freeware. I recently tried the latest version and struggle. When I’ve worked it out, I’ll repost.¬†¬†

Overview
1. Make the floppy.
2. Edit the setup to suit.
3. Create bootable CD from that.

Method
1. Making the Floppy
– download the latest version from netbootdisk.com and unzip to somewhere on your machine
– format a floppy disc – make the floppy an XP bootable disk (an option on the format menu)
– run the batch file in the unzipped folder
– check it works by test booting a machine with it
2. Edit the default settings to suit
– download the Menu Editor GUI from netbootdisk.com
– launch the executable and make and changes you wish, ie: default username, password, domain etc
– enabling the CD drive at this point is very useful
– save file over existing to update disk
3. Create CD
– create image of floppy disk using WinImage
– insert floppy disk and run WinImage
– select Disc -> Read Disk (make sure a:\ drive is selected first)
– once read has been done, click save and save as a *.ima file.
– run CD Burner XP Pro v3 and select data disk (top option)
– select Disc -> Boot Options
– tick “Make Disc Bootable”
– select the floppy image you’ve just made and hit ok. It might query you to the file type but just ignore it and leave it alone
– hit “burn disc” and burn the CD
– test the CD in a machine and see what it does.

Optional extras– you can copy extra files of applications to the root of the CD before burning. As long as you enable CD in the original menu edit, you’ll be able to access the CD drive as R:\. If you do, you can add such things as ghost.exe or even a whole image to the CD and run the entire imaging session from there.

Posted in IT | Tagged: , , | Leave a Comment »