Monitoring Tomcat PermGen, OldGen and Threads with Nagios nrpe

Today I am sharing with you a Nagios Perl script for monitoring Tomcat through JMX.
This script can be used for monitoring Tomcat server parameters through Nagios NRPE server.

Script can be found here. It is not all parametrised with the command line, but can be easily adapted to monitor other parameters and/or display other PerfData.

As you can see in the source, the script is checking for 3 different params for PermGen:
- Perm Gen
- PS Perm Gen
- CMS Perm Gen

This is because Tomcat can use different Garbage Collectors (see this answer).

Railscast: backup database before migration

The code for the db:backup task can be found in this post.

Rake task for backing up MySQL database

It is often a good idea to do backups, right?
ActiveRecord doesn’t provide a straight task to do them, so I have written a small rake task to achieve that.
This task automatically cleans up old backups.
Additionally, it offers two additional variables to define max number of backups left and the directory name to place the backups.
To use it, place the code inside lib/tasks/backup.rake.

Running Redmine under unicorn in Debian

This post explains how to set up Redmine – the packaged version in Debian, to be hosted by Unicorn server and to use apache load balancing module.
This is a faster alternative to running Redmine with mod_passenger.