Archive for the ‘Work’ Category

What a timesaver: reptyr!

Tuesday, January 3rd, 2012

Ever smacked yourself on the head because you didn’t launch that long-running command inside a screen?
Well, reptyr saves the day. It’s a nifty little tool that reallocates the PTY to any of your running processes.

Have a look at the github page: https://github.com/nelhage/reptyr

Got a long-running process? Simply run

reptyr

and reptyr will change the PTY of the process, suddenly taking input for it from the screen terminal and writing output to the screen terminal.

Awesome!
Thanks Bram

Puppet and Nagios

Monday, May 11th, 2009

Although not very well documented, the integration between Puppet and Nagios can be very useful, especially in a highly modularized environment with components shared between multiple instances, such as a webfarm.

I intend on writing a little tutorial page on this site with my recent insights on Puppet and Nagios integration, but one thing I won’t keep unmentioned is how to deal with lots and lots of Puppet defined servicechecks.

By default, collected nagios_servicecheck objects are all stored in one config file. As soon as you reach several hundred defined servicechecks, however, the puppetclient on your nagios server will tend to be slower and slower. A puppetrun that takes up as much as an hour is no exception anymore. This is perfectly explainable. Puppet has to verify whether or not a servicecheck definition has changed since the previous puppetrun. It does so by scanning the nagios_servicechecks.cfg file for each and every defined service.

The best way to overcome this issue is to use a config directory instead of a config file. To do this, specify a “target” argument to the nagios_servicecheck:


@@nagios_service {"PING-$fqdn":
    ensure => present,
    host_name => $fqdn,
    ...
 target => "/etc/nagios/nagios_services.d/ping-$fqdn.cfg"
}

This way, for each and every defined servicecheck, puppet no longer has to scan a textfile containing thousands of lines, but only verify the existence of a configfile and make sure the content (just a couple of lines) is still up to date.

This will give you a speedup in the 50-fold range.

Of course, you can do the same thing with nagios_host, nagios_command, etc.. objects, but the largest gain, you’ll find will be with the servicecheck optimisation.

Big news!

Monday, January 19th, 2009

I’m finally going to FOSDEM again. A couple of reasons:

  • The programme looks really interesting, especially the RoR track, MySQL track and XMPP track.
  • It’ll be a nice opportunity to meet up with some geeky friends.
  • Some Puppet users want to meet up.
  • An is getting more and more interested in IT, so this is a very good way to lure her in all this! :-)

So I hope to see you all at FOSDEM!

Monitoring MS SQLServer 2005 with Nagios

Monday, May 5th, 2008

Need to monitor a SQLserver with Nagios? There’s check_mssql.sh in the latest nagios plugins’ contrib folder. This check command only works with SQLServer 7 and 2000, though.

To make it work with SQLServer 2005, you only need to change 1 line in the script. Find this line:

echo -e "select loginame from sysprocesses where spid > $spid ...

and change it to

echo -e "select loginame from sys.sysprocesses where spid > $spid ...

Now, if your freetds installation (the actual SQLServer client that does all the magic) supports SQLServer 2005, you can run the script as though you’re checking a SQLServer 2000 installation.

Adding custom facts to your Puppet environment

Wednesday, March 26th, 2008

Puppet, my favourite system administration tool, gathers facts about its managed hosts which can be used in administering these hosts.
These default facts are collected by Facter, one of Puppet’s dependencies. One can use these facts by querying using ‘facter’ on a managed host and in Puppet recipes, i.e. a description of how you want your hosts to be configured. A rather big set of facts are supported out of the box. Adding facts, however, can help you in making your recipes more clever.

That’s what I’ve been doing over the last couple of days. This page, “Plugins in Modules“, explains rather well how to add your custom facts. What it fails to tell you is that facts added through this mechanism are only available to Puppet and not to Facter.

So reading this blog post can save you hours trying to figure out why you custom facts don’t show up in the output of facter, because they never will. Executing a mail statement in which you mail the output of a fact, will show you the contents of your facts, however… ;-)

Xen bridging troubles

Saturday, March 22nd, 2008

Well, not really Xen related, but I noticed that our blades became unreachable once the bridging scripts had run.

After reading a lot of bug reports about bugs in the default Xen networking scripts, a posting on the Xen mailinglist pointed me in the direction of the network driver.

Apparently, some versions of the Broadcom NetXtreme II network driver are somewhat buggy which reflects in broken bridges. In particular, the version included with the binary distribution tarball of Xen 3.1 is affected.

Luckily for us, the bnx2 driver included in the 2.6.18-6-xen-686 kernel available in Debian etch is OK and after a reboot, I had my fully working bridge.

I hope this post reaches other people with the same problems, because it cost me a lot of time to fix.

Update: This problem also occured randomly on some of our other servers, all running the same Xen 3.1 bnx2 driver. After an update of the kernel, these problems disappeared.

MythTV workshop

Friday, May 19th, 2006

Yesterday I gave a small workshop on how to use a Linux machine as a digital multimedia center. As the intended audience was not the Linux-savvy geeks, I chose to use KnoppMyth and built myself a machine with MythTV 0.19-fixes on some very nice hardware, thanks to Kris: a total of 300 GB harddisk space and a Hauppauge PVR-500.
Anyway, if you want to read more about it, I’ve put my presentation online. You can download it here.

UKUUG LISA’06 Conference

Thursday, March 23rd, 2006

I wish I could say this conference was perfect. It’s nearly perfect: good talks, good food, good accomodation, very nice surroundings (stay tuned to see the pictures ;-) ), but the worst IP access I’ve ever seen on a Unix conference. :-(

Having said that and having hooked up to a working uplink port this time, I found a very small amount of time to update you on our stay here in Durham.

But let’s start with day 0. Which started way too early and with a swollen throat… :-(
Kris and I took off at Brussels Airport at around 9:30 am on Tuesday to land 90 minutes later at Newcastle International Airport. We spent some time cruising through Newcastle. Which is a nice city, provided you like shopping. I honestly think this city counts more cash registers than inhabitants and more malls than bus stops.

Next, we took the train for a 10 minutes ride to Durham. Durham is a very nice medieval town in northern England. As for now, you’ll have to take my word for that, at least until I’ve found the time to upload some pictures. Chances are that won’t be the case until I’m back in Belgium, though.

For the conference itself then. As Kris and I only arrived in Durham late tuesday afternoon, we didn’t enroll for the samba tutorial. Given the fact that the audience is very diverse, most of what is mentioned would probably have been repetition for us anyway.

The first day of the conference itself then. We started off with an LDAP workshop given by Andrew Findlay. It was obvious this wasn’t his first talk about the subject. Even though most of the technical stuff he touched wasn’t new for me, it was nice to get some insight on historical reasons for LDAP features and decisions.

After the lunch I had to give my talk, which was a first for me: never before had I presented a paper at an international conference… ;-)

I wish I could say it didn’t show, and as the speaker I can of course claim I’m not in the right position to judge. I was however ready with my talk way before time. Which was actually a good thing, because with my sore throat, I’m not sure how much longer my voice would have lasted. Luckily there were quite a few questions regarding my paper and most of them were out of interest and not just because I’d not been clear enough on things.

In the evening, there was the Google sponsored conference dinner. Based on the reputation of the English ‘cuisine’ in the civilised world – I’m pretty sure I will end up being lynched for statements like this one – I didn’t expect much. But I was pleasantly surprised. First we had some nice quiche, followed by roast pork, steamed vegetables and Yorkshire pudding to be finished off by dessert which was fruit rolled in some kind of pancake with a custard sauce.
I really did enjoy it :)

Day two of the conference was the most interesting one, to me personally. Talks I remember are the talk on device mapper multipathing by Alasdair Kergon, the talk on Kerberos by Simon Wilkinson and the talk on Apache, mod_include and mod_rewrite by Aaron Crane from The Register. Kris’ talk, I’d seen one or two times before so there wasn’t really anything that surprised me there, except for Kris being a bit more nervous than I’d known him before. No thanks to Ray Miller who added some more to the pressure … :-)

Overall, I liked the conference and liked the people who attended it. Met some interesting fellow Unix administrators.
It’s certainly worth a repeat… :)

Next up, Kris and I will try and find something to eat, which won’t be too difficult with Durham being a university city.

Tomorrow, we’ll have to catch a taxi rather early because we have to get to Newcastle’s airport by twenty to ten (AM) to check in for our flight back to Belgium.

I’m looking forward to it. I’m not quickly homesick, but whenever the return date of a trip nears, I’m glad to return home. I’m starting the to miss Belgium… ;-)

New website

Monday, January 23rd, 2006

As you undoubtedly notice, I found the time to revamp my website. I still have a lot of work to do, such as add extra picture sets, add the content from my previous website, etc…

Nevertheless, I’m already rather proud to have this nice and shiny WordPress powered website.

As WordPress is actually a blog or weblog site, I will be trying to use this site as a blog. Don’t expect daily blog posts or anything because I’m not that much of a talker ;-)

Anyway, we’ll see how this thing turns out…