Archive for 2012

Linux Tip: Add datetime stamp to bash history

I like to know what’s happening on my Linux servers. The output of the history command doesn’t include a datetime stamp by default.  To rectify this open the global profile…. ?View Code BASHvi /etc/profile Add the following line to the bottom. ?View Code BASHexport HISTTIMEFORMAT="%h %d %H:%M:%S " The output of the history command will […]

Monitoring Windows with NSClient++

I’ve been playing with Nagios recently and have been using NSClient++ to monitor Windows machines. In some places the documentation wasn’t too great so I thought I’d outline some service checks I’ve got working here. The service definitions here would normally be defined on the Nagios host not on the Windows box itself. Check Windows […]

Nagios timeperiod for Bank Holidays

The Nagios configuration files come with a timeperiod example for US Public holidays but not for good old Blighty! Obviously that won’t do so here’s one for England & Wales (sorry Scotland!). define timeperiod { name england-wales-holidays timeperiod_name england-wales-holidays alias England & Wales Holidays january 1 00:00-00:00 ; New Years Day march 29 00:00-00:00 ; […]

MySQL Group By

Many people are caught out by MySQL’s implementation of GROUP BY. By default MySQL does not require that you GROUP BY all non-aggregated columns. For example the following is an illegal query in SQL Server (as well as rather nonsensical); ?View Code MYSQLSELECT * FROM INFORMATION_SCHEMA.TABLES GROUP BY TABLE_SCHEMA; This will generate the following error; […]

pmp-check-mysql-deleted-files plugin issue

I’ve been busy setting up the Percona Nagios MySQL Plugins  but ran into an issue with the pmp-check-mysql-deleted-files plugin; UNK could not list MySQL’s open files After a little debugging we tracked this down to a problem caused by running multiple instances of mysqld. This is something the script author (Baron Schwartz) mentions in his […]