Some snippets: cron-apt and Openguides

by Juliet Kemp

Thanks to everyone who commented on my last post, about Jabber servers. Quite a few of them seem to play nicely with LDAP; the trouble with the setup here is that we have LDAP + Kerberos, and it's the Kerberos part that seems problematic. There is of course the "roll your own" option but I am currently preferring to steer clear of that in favour of accepting that users will have to create themselves a separate Jabber account rather than having everything tie together neatly. It's not terribly difficult to do, after all!

A couple of things to bring to your attention: firstly, the usefulness of cron-apt (for apt-using systems) is probably well known already, but since I only encountered it about a year ago, I commend it to anyone else who hasn't done so yet. It runs a daily cron-job to check for package updates for you. I recommend setting it to download only, not to automatic install, and also to only email if there's an update waiting. To actually run the upgrades once you've checked the email to ensure it's not done anything foolish, you can then use either ClusterSSH to run apt-get upgrade, or some form of roll-your-own solution, such as this:

#!/bin/sh
# Script to automate apt-get run across machines
# Usage: deb_aptget.sh "machine1 machine2 machine3"

case $@ in
"") echo "Usage: `basename $0` \"machine1 machine2 machine3 ...\""
        exit 1
        ;;
esac

# Authenticate root passphrase
ssh-add .ssh/root_key

# Run command on each of listed machines
for arg
        do
                echo $arg
                ssh root@$arg -i .ssh/root_key apt-get -y dist-upgrade
        done

# Deauthenticate root
ssh-add -d .ssh/root_key
Customary warnings apply, in particular the fact that I am not responsible if you use this & do something dramatically awful to your system(s).

Secondly, you may be interested in this article about OpenGuides, a Perl-based wiki that allows people to build open-source guides to cities. I confess to being biased, since I've been a contributor (on the content, rather than the code, side) to a couple of OpenGuides wikis (& know the author of the article!), but it is a very interesting project and well worth a look.


1 Comments

bob
2007-07-13 05:58:35
dean wrote nagios plugin for checking package state.
http://www.unixdaemon.net/nagios_plugins.html#check_debian_packages