code

9th March
2010
written by Nick Anderson

I know I’ve mentioned how much I love the sysstat package before. I use sar regularly to help with performance diagnostics (Analyzing Linux System Performance And Finding Bottle NecksCPU Performance Analysis In LinuxBaseline Analysis Is Important, CPU Performance Analysis In Linux Revisited). I wrote this little Nagios plugin to collect the performance metrics that sar collects.

I use this plugin with Zenoss and I set any performance thresholds there, more important to me was collecting the information for historical graphing. I searched around and didn’t really find any existing solutions thats why anyone wanting to do similar perhaps with cacti is stuck with my craptastic code (or please point me to a better implementation).  Anyway if you want to grab the plugin and check it out its on github.

check_sar_perf

8th March
2010
written by Nick Anderson

If you hadn’t already guessed I am a big fan of the Xen hypervisor. Lately I have been using the Citrix XenServer release because it makes it quite palatable for my co-workers. One annoyance that I do have about XenServer is the requirement that you license it (with a free license) every year. If you fail to license it the GUI stops working. Now I hate relying on GUIs but the fact of the matter is others in my team expect to have a working GUI when they need to do something. And I dont know about you but I don’t really log onto the management console very often. Really I only log on to it if I need to provision a new server so its entirely plausible that a license would expire and I wouldn’t know about it until I really needed to do something.

I ended up writing a little Nagios plugin that checks the license expiration date using XenAPI. I don’t know that it’s 100% compliant with the plugin specification but it does work for me. I actually don’t prefer to use the warn and critical states with the Nagios (I use the performance data with Zenoss and apply thresholds there. I find that to be a bit more flexible.) but I did implement them. The plugin can be executed on the XenServer (you may want to reference how to install nrpe on XenServer) or on from your monitoring host as long as the host performing the check has the python XenAPI installed.

The plugin check_citrix_xenserver_license can be found on github.

I hope someone can find it useful.

4th March
2010
written by Nick Anderson

Python has become my language of choice for automation and general scripting. Its nice to have an editor that makes things easier when your doing things. Its also nice to use an editor that you can find just about anywhere. I have customized my vim to make doing things in python much quicker and this is an old post where I talk about some of the modifications.

Vim customization for python

Tags: , ,
20th February
2009
written by Nick Anderson

Over the last couple days I’ve briefly talked about revisioning configs and making your home directory portable. It seems to have stirred up a bit of discussion over at Matt Simmons Standalone Sysadmin, and Hugh Browns mentioned he uses mercurial for this task.. As I noted in the post about managing /etc with version control I do revision my home directory, or at least pieces of it. (more…)

Tags: ,
21st December
2008
written by Nick Anderson

I posted about Tom Limoncelli and his Time Management for System Administrators. I have written a simple wrapper to do pre and post processing of a todo file as it is opened and closed to somewhat mirror “the cycle”. If your interested you can find a bit more information on todo-cycle here.

18th December
2008
written by Nick Anderson

Im sure everyone is familiar with smb messages especially as everyone was assulted with them about 10 years ago (stupid soho routers and spammers unite!). Anyway, there are clients for linux like Linpopup. Well recently I didn’t want to use one of those to be able to send messages to my linux workstations so I cobbled together a simple network popup app with python. (more…)

Tags: