Archive for December, 2011

Failure to start new MySQL server

We use replication for our MySQL server and perform a snapshot rsync to re-initialize the slave servers. One difference today was that I had to create a whole new server from scratch and perform the same re-initialization. Everything worked fine until I tried to start the server:

Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

The server was new and had not been initialized yet. I had copied all the data files including the my.cnf files and had expected the MySQLd to work! Well, doesn’t always happen that way eh?

Anyways, all that I had to do was to tell MySQLd where the data is located:

mysql_install_db –user=mysql –ldata=/datadir in my.cnf

MySQL came up and is replicating again!

Nagios CHECK_HTTP Error HTTP WARNING: HTTP/1.1 403 Forbidden

So, I was deploying a new server and added the default CHECK_HTTP Nagios plug-in as follows:

define service{
use <Preset Service Type>
host_name <Server Name>
service_description HTTP
check_command check_http
}

However, the check would come back as an 403 Forbidden error. I know we have some restrictions set on our http.conf to allow only internal IP addresses to the Apache server, but the Nagios server is in the internal network. Poked around the settings and configurations for awhile and could not see any issues as I was able to browse the default Apache page.

Looked a bit more and found that the CHECK_HTTP is actually looking for an index page in the root html location. So I ended up creating a dummy page for Nagios and the checks came back fine! I’m sure you could make something nicer but this is all I did in the /var/www/html directory:

echo "This is a dummy page for <Server Name>." >> index.html

Works like a charm!