Squeezing more data from Linux

This year I was able to dedicate some time to the Linux::Info distribution of mine.

After a long time without any maintenance, I was able to tackle some bugs there were hanging around for a long time.

One of those bugs were related to retrieve information regarding the running Linux kernel which the box was booted with.

The internal files under /proc changed a bit, and boxes with newer kernels were not behaving properly and additional information just being ignored.

In order to properly fix that, I decided to refactor not only how the information was being retrieved, but also how to manipulate it. My chose was to go with OOP to handle the various corner cases and reuse code.

Now it is possible to fetch a instance of those classes automatically and even compare two kernels to see which is older/newer.

After that I decided to add support to retrieve the Linux distribution details, a feature that I always thought was missing in the distribution. Also, the Linux::Distribution distribution (no pun intended) was already doing a good job at that.

Unfortunately, this distribution is a bit outdated, because nowadays Linux distributions are more standardized than before (not as much as we would like, but better).

So, now Linux::Info can also detected automatically which is the distribution your Perl code is running into. I tried to reuse code from Linux::Distribution as much as possible, but there will always be distributions coming and going, so keeping the distribution up to date is not a simple task.

That being said, if you run into a Linux kernel and/or distribution that cannot be identified and parsed, I would be more than happy to receive notification (or even better, a pull requests) to fix that!

So, if you're into Linux as a administrator (maybe for monitoring, observability or just to find out what do you need to update) or just curious about it, give a try and let me know!

Leave a comment

About Alceu Rodrigues de Freitas Junior

user-pic I blog about Perl.