July 22, 2008

If only your database would just tell you that replication had failed or that the disk was full…
Ok some database servers do
but MySQL doesn’t (yet). Another excuse to write a script
In my pursuit for total database visibility I have been searching for a tool that would tell me when something went wrong, that would simulate regular usage, and let me know if anything failed. After all SNMP can only probe so far and if your database is secure the last thing you want to do is open up another port on your server.
Don’t get me wrong there are tools out there that do a decent job of monitoring MySQL. MySQL Entperprise Monitor is one such tool. But if you want to look under the hood or add some functionality specific to your environment things start to get tricky.
So what’s this dbAlerter?
dbAlerter is the name of a project (Script) that I started developing to provide notification of key server events. It’s written in Python; Why?, I wanted something lightweight. Java would have been my first choice but the JVM eats too much ram and felt too heavy for such simple functionality.
Python on the other hand feels lighter and when running a script as a daemon it seems to take up less resources allowing the DB to use more memory and continue doing it’s job. Plus it’s been a while since I wrote anything with Python, variety is the spice of life!
Speaking of Java, if you have ever used tools like JConsole and jmap (and if not why not!) you may not have realised that since JDK 6 Update 7 there’s now one tool to rule them all – VisualVM.
VisualVM pulls together several commandline tools like JConsole, jstat, jinfo, jstack, and jmap to make monitoring and profiling a more visual experience.
Now that the changes from BSD Java have been merged into the OpenJDK and the FreeBSD Foundation have updated the JDK to 1.6.0-7 I’m pretty sure the original concept of write once run anywhere is closer than ever.
December 23, 2007
2007 is almost over and what a year this has been for Wave2!
My programming preferences have gone full circle, from beginning the year playing snakes and ladders (Python), I spent the summer drinking coffee (Java) and finally settled down surrounded by Camel’s, Lama’s and Parrots (Perl). Bizarre but never dull!
Steady progress has been made all round and as always the Open Source community has proven a valuable resource. Not a day went by where I did not discover something new or think of a new idea that could be built using Open Source Software. I only wish I had more time in the day!.
My Christmas present came early this year in the form of a MySQL 5.1 Cluster DBA Certification Study Guide. I have been putting off the final MySQL certification while waiting for the book to arrive, and now it is in my hands the only thing preventing me from taking the exam is the lack of free space over the Christmas period. Hehe
I also ordered a Nokia N810 (My Techie Present). My laptop is not small enough to carry around with me and I am hoping to capture more development time on this device. Either that or feed my mind.
Anyway I’m off to hit the WarHawk servers before getting ready to see the New Year in Amsterdam – home of the Blender Institute. With projects like AuthStor making great progress and ideas such as Unix Architect and BinaryStor slowly maturing, I cannot wait to see what 2008 holds for Wave2!
Before I head off I have to mention the Catalyst Advent Calendar. Every year they pack 24 days of tutorials and tips into the month of December. If you are looking to get the most of the Catalyst Framework you really must take a look at this resource. I was able to prototype AuthStor in under 2 weeks and enjoyed every minute!
Wave2 Wishes You a Very Merry Christmas and an Open Source New Year!!!
September 17, 2007
It’s been quite a while since I last looked at Google Co-op, but after moving my site recently I realised my Subscribed Links were no longer up to date, let alone working!. I then discovered the Python script I wrote a while back was no longer functioning either, then again it’s no wonder seeing as I had not looked at it for over a year!. Time for an upgrade…
I have been on a Java kick recently, and when not suffering from Vertigo I found myself getting back up to speed with JDK 1.6 and the now final GlassFish V2 release. The difference in speed between JDK 1.5 and 1.6 is certainly noticeable, and as my Google Analytics stats displayed 99% of recent clients having Java support (not necessarily 1.6) I decided a re-write of DeliciousSubscribed was in order.
I started out on the del.icio.us site where there was not much in the way of Java utilities, there was however a well built library – del.icio.us Java API. I would have used that library if it were not for the dependencies on Apache Commons, not that there is anything wrong with Apache Commons I might add!, I just wanted to keep the dependencies to a minimum for size and simplicities sake. So back to drawing board it was, my goal was to simply reproduce the Python script in Java and create an executable jar that can be run from the command line or embedded in another Java app if needed.
The JRE/JDK contains enough libraries to make connecting to the del.icio.us HTTP API and parsing the resultant XML a breeze. I did select one dependency however and that is args4j. Args4j provides simplified command line parsing, comes in under 36k and happens to be licensed under the MIT License so no viral licensing there. It did not take long to get a valid Subscribed Links XML file.
There is still a lot more to do before the code is stable of course and I am sure there are many more features I can add, in fact while re-writing the app I noticed a few cool additions to the Subscribed Links service that I may make use of in a future release:
You never know I might even whip up a JNLP deployed GUI when I finally get around to reading Filthy Rich Clients.
Speaking of features MySQL 5.1 must be getting close to Release Candidate and includes some cool new features such as Partitioning, Row based replication, Table logs and my personal fave Events.
If you are looking for a easy read intro i’d suggest you wander over to the MySQL site where you can find a brief intro into the major new features and bug fixes found in 5.1.
Right I must get back to Warhawk on the PS3. It’s been a while since I got hooked on an online game but this one seems to be stealing every hour I have free!
July 08, 2007
After having a week to recover from the first exam I finally got around to taking the second one….and passed!!
Part II of the MySQL DBA Certification focused a lot more on the day to day running of the server, compared to Part I which was very much installation / configuration based.
Studying for the exam was a little difficult as I also had to work this week (as opposed to being on holiday!), but the skills you gain can be directly applied to everyday management of MySQL, and can be very rewarding especially if you focus on optimisation.
So what next you ask? Well after getting this far I thought it only fair that I give something back to the MySQL Community in the form of a MoinMoin Macro – mmMySQL.
mmMySQL provides a quick way to view MySQL Status and Config directly from your Wiki pages. If like me you manage several MySQL servers and want a quick way to view your server Status or Config, just drop this macro into your MoinMoin Macro folder and add it to a page….easy huh!.

As for where we go from here with mmMySQL……who knows?
June 23, 2007
While working on the mmEvents macro I decided to take a detour (another one) to write a companion tool that would make managing the few domains that I own easier – mmWhois.
The mmEvents package works great for notifying me about Domain expiry, but that got me thinking, wouldn’t it be cool to be able to view registrar information just by clicking the event? If I am adding an event to a page so that I can be notified of domain renewal dates, it makes sense that the event links to more useful information right?
The first release of mmWhois functions as a standalone action and can be used to perform Domain / IP lookups directly from your MoinMoin Wiki – just drop the WhoisLookup.py file into your actions folder and select Whois Lookup from your Actions Menu – simple.
The next release will include mmEvents integration and possibly results caching – seems like a good idea.
If you have any suggestions on how to improve the action just click the Issue Tracker button on this page and enter a new bug report (Don’t be put off by the term “bug report” – you can still suggest enhancements
).
Well it seems Adobe Apollo has now become Adobe Integrated Runtime (AIR).
My money is definitely on this platform winning the RIA (Rich Internet Application) race! It is such a simple platform to use and you can easily see it filling the gap that Applets never achieved – I just need an idea for a project to use it.
Now what else can I add to the Wiki?…..
June 11, 2007
I finally got my head round Python Eggs the other day and decided to put them to use while designing the Daemon for mmEvents.
For those of you who have never heard of Python Eggs, just think Java Jars or CPAN modules. I personally like to compare them to OSX apps – self contained apps that reside in a folder disguised as an EXE – just double click to run. In fact it was the double click to run that got me interested.
It turns out there are many more reasons for packaging your Python application as an Egg, here are five I intend to use:
- Simplicity – just create your folder structure and drop in a setup.py file to describe your project.
- Dependency Management – list your dependency modules and watch them download and install before your eyes.
- Resource Management – want to package some images with your script? Just drop them in a folder and add them to setup.py. There is even an API to handle the location of those files in a platform indipendant manner – Sweet!.
- Compression – when building an egg you can choose to compress your project into a single .egg file.
- Eggsecutable – by adding an entry point to your project (e.g. Main()) you can make your .egg run from the command line – I know I already told you that, but it’s so cool!!.
I started work on mmEvents a few months ago while looking for a way to recieve notification for Domain Names stored on my personal Wiki. The concept is simple, you just add the expiry date into a macro and save your page. All going well you’ll get notified as soon as the date arrives.
Anyway the project is picking up speed now and the Daemon should be checked in within the next few days….