Making Zabbix progress

Warning! Bias rant follows.

I’ve been struggling to find a perfect solution for server monitoring for a while now. At the moment it’s a combination of nagios and cacti plus ipmitool. And recently I have also looked at / tried opennms, zenoss, ganglia, argus and munin.

Nagios + cacti has been serving me well, but I would be happier to only have to maintain one system and to have some auto discover of both systems and their services would make life much easier. Most of the apps I looked though have failed my expectations by either being hogs (some even java based), complicated mashups, or too simple for my needs (not able to replace both nagios and cacti). And that left me with zabbix. But even zabbix has left me with a bad taste by requiring the zabbix-agent be installed on client machines. Are my requirements really to much to ask? Surely there is enough to be gleamed from snmp, ipmi and nmap to monitor both server and desktops.

So. How does you see the required agent? A negative? I can easily install it on all my linux server with puppet, but what about windows, the desktop machines and routers etc? And I have yet to see anything come close to the asset management I’d like either.

But on the plus side for zabbix I have found it fairly well thought out, albeit a little confusing at first.

I cant remember the name of that windows thing I tried a little while ago that sent me on this mission to find a decent linux all-in-one system manager, but it was reasonably forgettable because of the auto-discovery problems it kept presenting with the doubling up of systems on each discovery scan, and it’s inability to be uninstalled.

Anyway I’ll be off for a week to shift house but I’ll give zabbix a good go and report back.

Posted in Server | Tagged , , | Comments closed

Alfresco setup in Ubuntu 8.10 with git

Alfresco

My goal was to install Alfresco in Ubuntu-8.10 and store the Alfresco install and config in git excluding the application data in such a way that I am able to checkout my Alfresco git repo on a new Ubuntu install and have Alfresco running immediately.

This turned out to be fairly easy and makes testing new configuration changes very simple.

There is plenty of information on configuring Alfresco on the Alfresco wiki, and most of my setup is based on the install tutorial for Ubuntu-8.04. So I will only cover the differences in the way I setup Alfresco.

Alfresco dependencies in Ubuntu

I chose to use puppet for taking care of dependencies as it is already in deployment for all the servers I use. The other common way of taking way of taking care of dependencies is to create a script that installs the dependencies and store it in the root Alfresco dir managed by git. If you do not want to setup puppet then see the initialize.sh file below. My puppet rule as follows also installs lighttpd and phpmyadmin.

class alfresco_base {
        package { [
                imagemagick,
                lighttpd,
                mysql-server,
                'openoffice.org-headless',
                php5-cgi,
                swftools]:
                        ensure => installed;

                phpmyadmin:
                        ensure => installed,
                        require => [Package['php5-cgi'], Package['lighttpd']],
                        notify => File['50-phpmyadmin.conf'];

                sun-java6-jre:
                        ensure => installed,
                        require => Exec[preseed-licence-dlj];
        }

        file {
                '50-phpmyadmin.conf':
                        name => "/etc/lighttpd/conf-available/50-phpmyadmin.conf",
                        ensure => "/etc/phpmyadmin/lighttpd.conf",
                        notify => Exec[lighttpd-enable-phpmyadmin]
        }

        exec {
                "lighttpd-enable-phpmyadmin":
                        command => "lighty-enable-mod fastcgi phpmyadmin",
                        refreshonly => true,
                        notify => Exec[lighttpd-restart];

                "lighttpd-restart":
                        command => "/etc/init.d/lighttpd restart",
                        refreshonly => true;

                "preseed-licence-dlj":
                        command => "echo sun-java5-jdk shared/accepted-sun-dlj-v1-1 boolean true | debconf-set-selections";
        }
}

Initially installing Alfresco

To have something to put into the git repo we first must install Alfresco the usual way for your platform. If you are installing on a 64bit install you will need to install ia32libs first too.

  • ./Alfresco-Labs-3Stable-Linux-x86-Install --mode console

Once installed turn your install into a git repo.

  • cd Alfresco
  • git init
  • git add .
  • git commit -m "Initial install of Alfresco Labs 3 Stable"

Now we need to define some exclusions for files that are changed or defined after install such as log folders and user data.

  • echo "alf-backstop-*
    alf_data/
    alfresco.log
    tomcat/logs/
    tomcat/temp/
    tomcat/conf/tomcat-users.xml
    tomcat/webapps/alfresco/
    tomcat/webapps/share/
    tomcat/webapps/studio/
    tomcat/work/
    virtual-tomcat/logs/
    virtual-tomcat/work/
    alfresco.log.*
    tomcat/webapps/alfresco.war-*" >> .git/info/exclude

Your git repo is now ready to be uploaded to you preferred place of storing git repos such as a file server or gitosis. I’m using a file server via ssh.

  • ssh git@fileserver "mkdir Alfresco; cd Alfresco; git init"
  • git remote add origin git@fileserver:Alfresco
  • git push origin master
  • scp .git/info/exclude git@fileserver:Alfresco/.git/info/exclude

Congratulations! You now have a fresh install of Alfresco stored in git on your fileserver.

Initial configuration

Before checking out on a new server there are a few changes we needed to commit.

File: initialize.sh:

#!/bin/sh
ALF_HOME=/opt/Alfresco
# Uncomment the following line if not using puppet
#apt-get install imagemagick mysql-server openoffice.org-headless php5-cgi swftools sun-java6-jre
echo "Creating init.d links"
ln -s $ALF_HOME/alfresco.sh /etc/init.d/alfresco
ln -s $ALF_HOME/virtual_alf.sh /etc/init.d/virtual_alf
update-rc.d alfresco defaults
ln -s $ALF_HOME/alfresco.sh /etc/init.d/alfresco
ln -s $ALF_HOME/virtual_alf.sh /etc/init.d/virtual_alf
update-rc.d alfresco defaults
update-rc.d virtual_alf defaults
echo "Creating MySQL database tables - Password for MySQL root user:"
mysql -u root -p < $ALF_HOME/extras/databases/mysql/db_setup.sql
[ ! -d $ALF_HOME/tomcat/logs ] || mkdir $ALF_HOME/tomcat/logs
[ ! -d $ALF_HOME/virtual-tomcat/logs ] || mkdir $ALF_HOME/virtual-tomcat/logs

initialize.sh links alfresco into /etc/init.d, sets it to start at boot time and creates the alfresco mysql user. If you are using the puppet recipe above then the default mysql root password is blank and should be changed either at the command line or from phpmyadmin (http://localhost/phpmyadmin/). If you are not using puppet then uncomment the apt-get line at the top of the file and customise the dependencies for your needs.

File: alfresco.sh and virtual_alf.sh

Change @@ALFRESCO_DIR@@ to your install dir, eg: /opt/Alfresco
Change @@JAVA_HOME@@ to your jvm dir, eg: /usr/lib/jvm/java-6-sun/

File: tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties

There is a conflict with the port used by the virtual server that needs to be changed else the virtual server will not start a second time and complain that the port is already in use (and it is).

Change avm.rmi.service.port=50501 to avm.rmi.service.port=50509

Commit

First get a list of files you have changed:

  • git status

If you want to commit all those changed files then commit like:

  • git commit -a -m "You commit message"

Or if you only want to commit a couple of the changes, eg:

  • git add initialize.sh alfresco.sh virtual_alf.sh
  • git commit -m "Your commit message"

Now push the changes:

  • git push origin master

And you will find you use that process fairly often to start with. I also found myself using branching to test larger changes or changes I wanted to keep separate for now. But documenting all of those commands is beyond this post. Other changes I made were changing the database backend to mysql and authentication to active directory.

Checkout Initialize Run

Now lets test it. Lets assume your using a clean install of Ubuntu again (with a puppet client setup already).

  • sudo git clone git@fileserver:Alfresco /opt/Alfresco
  • sudo scp git@fileserver:Alfresco/.git/info/exclude /opt/Alfresco/.git/info/exclude
  • sudo /opt/Alfresco/initialize.sh
  • sudo /etc/init.d/alfresco start

Your Alfresco server should start after a few minutes and be ready for testing. You can commit and push changes from any checkout too.

There may be other files or directories you need to add to the exclude file too. You will see most of these after starting Alfresco the running git status.

Stay tuned for: Active Directory integration

Posted in Alfresco | Tagged , , , , | Comments closed

Creating JeOS virtual machines in Ubuntu

The two tools I use for creating new vm’s with libvirt are virt-install and vmbuilder. I use virt-install when I will be installing an OS from installable media or using an existing disk image, and vmbuilder when I need to create JeOS based vm’s.

After following the guides at wiki.ubuntu.com I ended up with two fairly long template commands:

sudo virt-install --hvm -n <hostname> -r <memory> -f <hdd_image> -s <image_size_in_gb> 
-c <iso> --accelerate --connect=qemu:///system --vnc --noautoconsole
sudo vmbuilder kvm ubuntu --suite intrepid --flavour virtual --arch amd64 -o --libvirt qemu:///system 
--part vmbuilder.partition --user myname --name 'My Name' --pass default --addpkg puppet 
--addpkg unattended-upgrades --addpkg acpid --mirror http://apt/ubuntu --tmpfs - 
--firstboot vmbuilder.firstboot.sh --hostname <hostname> --mem <memory> --dest <hdd_image_basedir>

The command for virt-install is pretty lean compared to the command for vmbuilder. But vmbuilder allows for most of the configuration to be stored in ~/.vmbuilder.cfg. It did take a bit of digging as not a lot about it was on the ubuntu wiki though. Read More »

Posted in KVM, libvirt, vmbuilder | Tagged , , , , , , | Comments closed

Retheaming Ubuntu – Part 3

Last in the series of retheaming Ubuntu is application customisation. While the desktop themes you use change the way you see your desktop and can make or break the your desktop experience, the applications you choose to use also play just as large a part. The applications determine the way you interact with your PC. The number of times you have to click to open a favorite folders, where you place your application shortcuts, the way your windows get stacked or tiled, and also to what extent accessories work automatically. Read More »

Posted in Desktop, gnome-do, themes, Ubuntu | Tagged , , , , , , , , | Comments closed

Retheaming Ubuntu – Part 2

Last time we I covered the themes that were common to all users on a PC – machine specific themes. Themes applied this time will only affect you, but will compose your main experience with Linux. There are three components that define a desktop theme. The window borders, window contents, and icons. Read More »

Posted in Desktop, themes, Ubuntu | Tagged , , , , , , , , , | Comments closed