The Life of a Sysadmin

Carousel is a lie!

Entries from May 2010.

Time well spent
Wed May 05 21:14:43 PDT 2010

Just spent two hours staring at this Python regex:

method_re = re.compile('(?P<urlcmd>\s*url\s.*)|(?P<nfscmd>\s*nfs\s.*)')

and trying to figure out why it wouldn't match this line:

install url --url http://cobbler.example.org/cobbler/ks_mirror/CentOS-5.4/os/x86_64

After much research, I can report two things:

And now to read more of Dr. Zhivago.

Update: by way of explanation, I was trying to use koan and Cobbler to install a new qemu instance like so:

/usr/bin/koan --nogfx --server=cobbler.example.com --virt --system=virtserver-01.example.com

and was getting two errors:

warning: kickstart found but no install_tree found
Cannot find install source in kickstart file, aborting.

The problem turned out to be that my kickstart file had this line:

install url --url http://cobbler.example.org/cobbler/ks_mirror/CentOS-5.4/os/x86_64

which should have been two lines:

install
url --url http://cobbler.example.org/cobbler/ks_mirror/CentOS-5.4/os/x86_64
Tags: debugging, python.
Sale on O'Reilly ebooks today
Fri May 21 10:44:16 PDT 2010

O'Reilly is having a one-day sale on ebooks: $10 each. I've just picked up "Python for Unix and Linux System Administration", "Python Cookbook, Second Edition" and "Python in a Nutshell, Second Edition". (Detect a pattern?) They're DRM-free, the way Cory Doctorow intended. Downloading is a little slow right now, but I imagine that's just because of increased sales.

I'm not a shill for O'Reilly, just a satisfied customer. (Mostly. I wish OnLAMP.com was getting a bit more love.) (But then, I'm not paying for OnLAMP, am I?)

No tags
Config file parsing
Wed May 26 06:14:40 PDT 2010

I've been setting up some new VMs for a separate project at work. I've realized that this is painful for two reasons: Bacula and Nagios.

Both are important...can't have a service without monitoring, and can't have a machine without backups. But each of these are configured by vast files; Bacula's is monolithic (the director's, anyhow, which is where you add new jobs) and Nagios' is legion. And they're hard to configure automagically with sed/awk/perl or cfengine; their stanzas span lines, and whitespace is important.

I've recently added a short script to my Nagios config; it regenerates a file that monitors all the Bacula jobs and makes sure they happen often enough. This is good...and I want more.

I found pynag, a Python module to parse and configure Nagios files. This is a start. I've had problems getting its head around my config files, because it didn't understand recursion in hostgroups (which I think is a recent feature of Nagios) or a hostname equal to "*". I've got the first working, and I'm banging my head against the second. The three books I got recently on Python should help (wow, IronPython looks nice).

There are a lot of example scripts with pynag. None do exactly what I want, but it looks like it should be possible to generate Nagios config files from some kind of list of hosts and services. This would be a big improvement.

But then there's Augeas, which does bi-directional parsing of config files. Have a look at the walk-through...it's pretty astounding. I realized that I've been looking for something like this for a long time: an easier way of managing all sorts of config files. Cfengine (v2 to be sure) just isn't cutting it anymore for me.

Now, the problem with Augeas for my present task is that there isn't anything in the current tree that does what I want, either. There is a commit for parsing nagios.cfg -- not sure if it's been released, or if it will parse everything in a Nagios config_dir. There's nothing for Bacula, either. This will mean a lot more work to get my ideal configuration management tool.

(On a side note, my wife said something to me the other day that was quite striking: I need tasks that can be divvied up into 45-minute chunks. That's how much free time I've got in the morning, bus rides to and from work, and the evening. Commute + kids != long blocks of free time.)

And I've got a congenital weakness for grand overarching syntheses of all existing knowledge...or at least big tasks like managing config files. So I'm trying to be aware of my brain.

...and there's son #2 waking up. Time to post.

1 comments. Tags: backups, monitoring, python.
Perl multitasking, CPAN at home
Fri May 28 10:19:01 PDT 2010

For my own reference, here are a couple things I had to find out about Perl today:

Tags: perl, programming.
Linux sysadmin job opening in Vancouver
Fri May 28 10:25:06 PDT 2010

This posting (PDF) came up on the VanLUG mailing list today; if you're looking for a Linux sysadmin job in Vancouver, it looks interesting.

1 comments. No tags
Some thoughts on GOsa
Mon May 31 10:21:32 PDT 2010

At $WORK I've been setting up a server for a new project. It's going to be the foundation for a bunch of work that they're doing: bag o' passwords, code repository, website + wiki, email. I've been trying to set it up in such a way that a) it'll be a good foundation and b) it'll be easy for them to manage -- at least when it comes to adding/deleting/modifying users, email addresses and so on -- rather than having to come to me every time something needs changing.

I set up CentOS Directory server and populated it with the root and a few entries. Thus: cn=Me,ou=People,dc=example,dc=org. I've got authentication working, restricted to certain groups where necessary, and now it's time for me to think about how the non-propellerheads are going to manage accounts. That means a web front end, and I've been evaluating GOsa for the last week or so.

The good:

The bad:

Overall, I'm not sure how happy I am with GOsa. It's not doing what I want now, and it looks like the only way to make that happen is to wipe the tree and start from scratch. -- Well, no, not scratch: create a GOsa-visible department (ou=Something) and stick everything in there. Given the sparse documentation, it's probably silly for me to focus on that, but that's what sticks out at me right now.

1 comments. Tags: ldap.

RSS Feed