17 Aug

How to Add Remote MySQL Server to Nagios Monitoring

We already have seen two articles for setting up MySQL Monitoring with Nagios and Percona Monitoring Tools for Nagios. Those posts covers configuration of nagios on single instance.

Though following questions came to me: Do you need to setup Nagios again on all servers that we want to monitor? How do you add another MySQL server to this monitoring?

This post is an answer to those questions.

To add remote server to nagios monitoring, We need NRPE (Nagios Remote Plugin Executor) along with Xinetd (Extended Internet Daemon) and Nagios Plugins to be setup.

(This assumes you have already setup the nagios server and adding new host. Refer links in first line of the article)

Steps to add Remote MySQL server to Nagios Monitoring:

Read More

20 Jul

MySQL 1018 (HY000): Can’t read dir errno: 13 – Permission denied

In this post we will see the resolution of MySQL “permission denied” error due to movement of database to a different partition on CentOS.

ERROR 1018 (HY000): Can’t read dir of ‘./sakila/’ (errno: 13 – Permission denied)

Recently, a friend was stuck on following issue and he was not able to access the tables under ‘sakila’ database. Though he was able to read all other databases!

ERROR 1018 (HY000): Can't read dir of './sakila/' (errno: 13 - Permission denied)

This is what happens when he try accessing the tables from sakila database:

mysql>use sakila;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
ERROR 1018 (HY000): Can't read dir of './sakila/' (errno: 13 - Permission denied)

Read More

01 Jul

Monitoring MySQL Database Backups

It’s important to monitor the (database) backups after you set-it-up. In this post we will answer a few how to monitor MySQL Database backups solutions – monitoring methods.

We should see suggestions for:

  • Monitoring Holland MySQL Backup
  • Monitoring mysqldump backups
  • Monitoring Xtrabackup using log
  • Monitoring Backups using Nagios

Usually we can have our backup script capable of detecting the status of the backup and send an success / failure email accordingly. Alternatively the backup script can write the status to backup logs and the monitoring system should be capable of reading logs, determine the backup failure and alert.

Read More

30 Jun

Install Percona Monitoring Tools for Nagios – MySQL Plugins

Recently a friend asked about Installing Percona Monitoring Tools for Nagios as he was facing a few issues. I managed to set-it-up on my ubuntu VM. Sharing the the work-log of Nagios and Percona Monitoring Plugins setup steps here for some-one who’s looking for the same!

Install Nagios on Ubuntu – steps:

(skip to Percona Monitoring Tools – Nagios Plugin Setup)

Install dependencies:

sudo apt-get install build-essential libgd2-xpm-dev apache2-utils libssl-dev

Configure Nagios users & group:

Read More

24 Jun

UMASK & UMASK_DIR – changing default MySQL file dir permissions

UMASK and UMASK_DIR are amongst few MySQL Environment variables which defines directory and file creation modes (file permissions). In this post we will understand using UMASK & UMASK_DIR for changing the database directory and file permissions from it’s default to what we need.


Changing default MySQL permissions using UMASK & UMASK_DIR


Let’s build some background first. Earlier we learnt about setting-up MySQL database backup using holland and xtrabackup. As a routine I have seen database backups being run under users other than “mysql” or “root” for such physical backups (looking at security aspect). For that, we need to add this backup-user to mysql group and grant the group read and exec permissions on MySQL datadir.

Adding backup user to mysql group:
usermod -a -G mysql backup

Granting group-read,execute permissions to backup user (on MySQL datadir):
chmod g+rx /mysql/data -R

Read More

-- Kedar Vaijanapurkar --