Ian P. Christian's Personal Blog Random witterings from pookey

23Jan/100

Blog now running WordPress!

I have moved my blog engine from s9y to wordpress. After a lot of time trying to ensure all my old links will work, I've finally put workpress live. Please do let me know if there's any issues you find.

Hopefully I'll manage to get the site re-styled into a more typical pookey.co.uk theme soon too!

Filed under: Uncategorized No Comments
28Dec/096

Spaghetti Bolognese Recipe

Everytime I go to make a ragu for bolognese I spend ages looking for recipes, and there's so many different ones out there. When I do find one I like, I fail to bookmark it - so this time, I've made my own recipe based off many others, and decided to write it down. I'm doing this mostly for myself, but I thought I'd do it on my blog so that others might find ways to improve it for me. A little disclaimer - I don't know if this is a 'correct' ragu recipe, or if I'm doing things a chef would cry at, I just know I like this recipe - and I hope someone else might too!

Continue reading
15May/090

Filtering Postini tagged mail with Sieve

The headers Postini's anti-spam system adds to emails are quite hard to filter on, as you need to compare part of one header to part of another. Here's a little snipped that works with dovecot 1.2's sieve implementation. I don't actually use this myself anymore, but I'm posting it here for anyone else struggling with the problem.

Continue reading
23Mar/090

Pirate Duck Update

As you should be aware from my previous blog post - Bring Back Pirate Duck - one of my ducks is missing. This morning upon returning I found a small padded envelope addressed to 'Mr Ian P Christian - Duck Master".

Continue reading
12Mar/093

Bring Back Pirate Duck

I took 2 days away from work last week, and upon my return I noticed that one of my ducks from my desktop duck collection was missing. Shortly after my discovery, I received an email with a subject line of 'we have your duck'.

Continue reading
4Jul/080

Doctrine Presentation

I did a presentation on Doctrine at the PHPLondon user meeting last night, here are the slides:

My Doctrine Presentation

Filed under: Uncategorized No Comments
6May/087

Outputting from Postgres to CSV

I can never remember how to output to a CSV file from postgres, and end up having to google it time and time again - so I'm making a note of it here mostly for my own use :)

\f ','
\a
\t
\o /tmp/moocow.csv
SELECT foo,bar FROM whatever;
\o
\q

If a field has newlines, this will break. You can do something like this instead.....

 SELECT foo, bar, '"' || REPLACE(REPLACE(field_with_newilne, '\n', '\\n'), '"', '""') || '"' FROM whatever;
Filed under: Uncategorized 7 Comments
16Apr/083

Monitoring Dell SAS 5/iR RAID with nagios

The Dell PERC/5 shows like this under 'lspci'

07:08.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068 PCI-X Fusion-MPT SAS (rev 01)
        Subsystem: Dell SAS 5/iR Adapter RAID Controller

The status of this RAID card can be read using mpt-status, in Gentoo this package is available as sys-block/mpt-status. Here's an example of the output:

# mpt-status
ioc0 vol_id 0 type IM, 2 phy, 148 GB, state OPTIMAL, flags ENABLED
ioc0 phy 1 scsi_id 32 ATA      WDC WD1600JS-75N 2E04, 149 GB, state ONLINE, flags NONE
ioc0 phy 0 scsi_id 1 ATA      WDC WD1600JS-75N 2E04, 149 GB, state ONLINE, flags NONE

The latest 'check_mpt' script can be found on Nagios Exchange. Download it and put it in your libexec folder, for me on gentoo its '/usr/nagios/libexec/'. Open the file, and make sure the 'use lib' line points to the correct place.

The script uses sudo to run mpt-status, so you'll need to modify your /etc/sudoers - adding a line like this:

%nagios ALL=(ALL) NOPASSWD:/usr/sbin/mpt-status

Next, you need to configure nagios, your filenames might be different from the names I use below.

/etc/nagios/commands.cfg : Note, the -c param refers to the number of disks you expect to be active.


define command{
  command_name  check_mpt
  command_line  $USER1$/check_mpt -c 2
}

/etc/nagios/localhost.cfg

define service{
  use                  local-service
  host_name            localhost
  service_description  mpt - Dell Raid
  check_command        check_mpt
}

Reload nagios, on gentoo, it's /etc/init.d/nagios reload

See also: Monitoring PERC 4e over SNMP with nagios

Filed under: Uncategorized 3 Comments
15Apr/081

skinning nagios – nagios doesn’t have to be ugly!

Nagios can be pretty, and several people I've told this too seemed surprised, so I thought I'd put a quick note here. Here is a nice theme for nagios....

http://new.nagiosexchange.org/cgi-bin/page.cgi?g=Detailed%2F1723.html;d=1

Unfortunately, the underlying UI is still the same horrible interface, but.... this does make a big difference to the aesthetics :)

Filed under: Uncategorized 1 Comment
16Mar/081

Dell PERC 6/i and RAID monitoring

A few pointers for people trying to get Dell's PERC 6/i RAID monitoring working under Ubuntu, and any other linux for that matter. It also applies to PERC 5/i too, and... other stuff :)

First, visit Dells Linux site. Have a poke about, see what's there.

Next, we need to download a tool to get information from your array. Download LSI's MegaRAID CLI tool for linux. It comes as a .RPM, so if you're an ubuntu user, you can convert it to a .deb using alien, or convert it to a .tar.gz.


# alien --to-tgz MegaCli-1.01.39-0.i386.rpm

You then have a CLI tool you can use to get all your data now! For example:


# ./opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL | grep State
State: Optimal

One thing I spent a while figuring out was how to get the rebuild progress, so here's how:


# ./opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ShowProg -PhysDrv \[32:1\] -aALL

There's also a really useful cheat sheet for common tasks

Don't forget to actually monitor this output with nagios, or your favorite monitoring tool!

Filed under: Uncategorized 1 Comment