Friday, May 27, 2011

RT4 on Ubuntu 10.04, part 1

I want to try RT4, but the pre-packaged version on Ubuntu 10.04 is RT3.8. What's a fella to do? Why, install from source, of course!

Download the tarball, extract (tar zxf, in case you were wondering :-) and do the configure dance (./configure --with-db-type=Pg)

Then there are some perl modules it needs. Some are available as packages, which are:

apt-get install build-essential
apt-get install libdatetime-perl
apt-get install libclass-returnvalue-perl
apt-get install libemail-address-perl
apt-get install libtext-quoted-perl libtext-wrapper-perl
apt-get install liblog-dispatch-perl libtree-simple-perl
apt-get install libtest-template-perl
apt-get install libtext-template-perl
apt-get install libuniversal-require-perl
apt-get install libnet-cidr-perl
apt-get install libdevel-globaldestruction-perl
apt-get install liblocale-maketext-lexicon-perl liblocale-maketext-fuzzy-perl
apt-get install libcss-squish-perl
apt-get install libregexp-common-perl
apt-get install libcache-simple-timedexpiry-perl
apt-get install libgraph-writer-graphviz-perl
apt-get install libhtml-scrubber-perl
apt-get install libmodule-versions-report-perl
apt-get install libgd-graph-perl libgd-graph3d-perl libgd-gd2-perl
apt-get install libnet-cidr-lite-perl
apt-get install libipc-run3-perl
apt-get install libtext-password-pronounceable-perl
apt-get install libfile-sharedir-perl
apt-get install libregexp-common-time-perl libregexp-copy-perl libregexp-optimizer-perl libregexp-shellish-perl libtie-regexphash-perl libppix-regexp-perl libregexp-assemble-perl
apt-get install libhtml-mason-perl
apt-get install libemail-mime-perl
apt-get install libmime-tools-perl libmime-perl libmime-lite-perl libmime-explode-perl libmime-encwords-perl libmime-charset-perllibemail-mime-creator-perl libemail-mime-createhtml-perl
apt-get install libmime-tools-perl libmime-perl libmime-lite-perl libmime-explode-perl libmime-encwords-perl libmime-charset-perl libemail-mime-creator-perl libemail-mime-createhtml-perl
apt-get install libdatetime-format-builder-perl
apt-get install libfcgi libfcgi-perl libfcgi-procmanager-perl
apt-get install libdbix-searchbuilder-perl
apt-get install libyaml-syck-perl
apt-get install libdbd-pg-perl

Then after all that, you'll need to configure CPAN:

/usr/bin/perl -MCPAN -e shell

Then run fixdeps to grab the remaining modules:

make fixdeps

That's as far as I've got so far, more fun to follow, I'm sure.

Wednesday, May 25, 2011

Perl installation WTF?

Sometimes, you just want to sit back and let CPAN do its magic. Don't care, just go fetch the pre-requisite packages so I can try RequestTracker. Then something whizzes past that makes you sit up and think "What was that??"

It was this:

Install module Devel::GlobalDestruction
Running install for module 'Devel::GlobalDestruction'

Global Destruction? Yeah, okay, that sounds fine too :-)

Wednesday, May 11, 2011

Nagios monitoring HP Proliant running Ubuntu 10.04 Linux

A while back I wrote about how to get the HP bits and pieces installed on Ubuntu 10.04. Now the next step: getting Nagios to poll it via SNMP and report if things are okay.

OK, assuming you already have net-snmp installed (check it: snmpwalk -v1 -cpublic system - should return basic SNMP info such as sysLocation, contact name etc).

Now run /sbin/hpsnmpconfig (installed by package hp-snmp-agents) and answer the prompts. Note that the initial question "Do you wish to use an existing snmpd.conf" fooled me the first few times through - answer "n" to have it make changes to your existing snmpd.conf file - is it just me, or is this question confusing?

Anyhow... after that it was all smooth sailing, I answered with the config I wanted, and hey presto, it made its changes to snmpd.conf

Then from another box, try a few snmpwalks to make sure the HP sub-agent is answering:

snmpwalk -v 1 -c public <-- this is where HP's SNMP subtree (arc, if you prefer the technical term) starts

You will get an abundance of SNMP output, all of it pertaining to HP components.

Then add the check_hp plugin to your Nagios box - download the file, extract the tarball, cp check_hp /path/to/nagios/executables (for us, on nanoBSD, /usr/local/libexec/nagios/) . Note I had to edit the check_hp script to make the first "use lib" to point to /usr/local/libexec/nagios/ - if this is wrong, check_hp will complain that it can't find

Then test:
nagios# /usr/local/libexec/nagios/check_hp -H
Compaq/HP Agent Check: overall system state OK

Woohoo! Now add the command definition to commands.cfg (for us, /usr/local/etc/nagios/commands.cfg):

# 'check_hp' command definition
define command{
        command_name    check_hp
        command_line    $USER1$/check_hp -H $HOSTADDRESS$

Then add the check to the host in question:

define service{
        use                             local-service         ; Name of service template to use
        service_description             HP System State
        check_command                   check_hp

Restart Nagios, and watch the newly-added check get run, and (hopefully) green bits appear on screen.

If you're interested  in what exactly the check_hp plugin is monitoring, you can run it manually with the -d flag to see debug output about the SNMP values checked. The script is also pretty easy to read, so have a look through at what is being checked. I also found a neat-o guide to the HP/Compaq MIBS which is worth a read (and considerably easier than reading the MIB files, which are enormous!)

And now that SNMP is working properly, the previously-blank System Management page (accessed at will be full of useful info about your hardware. Yep, it uses SNMP to find out about the system state too. Busted SNMP == no info. No wonder I never found it very useful before!

Also a useful manual from HP here - I wish I'd had this in the first place!