/galeranotify

Python E-Mail script for use with Galera wsrep_notify_cmd

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

galeranotify

Python E-Mail script for use with Galera wsrep_notify_cmd

Why do I need / want this?

Galera makes my life easier with near synchronous replication for MySQL. We have monitoring tools in place, but its nice to get updates in real time about how the cluster is operating. So I wrote galeranotify.

I've been using this on our Percona XtraDB Cluster for quite a while now with no issues.

I hope someone finds it useful.

Set up

  1. Edit galeranotify.py to change the configuration options. They should be pretty straightforward.

  2. Place galeranotify.py in a common location and make sure you and your MySql user have execute permissions.

  3. Manually execute galeranotify.py with several of the options set (check usage) and check to make sure the script executes with no errors and that you receive the notification e-mail.

  4. Set 'wsrep_notify_cmd = ' in your my.cnf file.

  5. Restart MySql.

SELinux

A SELinux policy (galeranotify.pp) is also included that allows the mysql user to connect to a standard remote smtp port (port 25). If you are using an alternate SMTP port (common with SSL), this rule will not work for you.

Usage:

semodule -i galeranotify.pp

This rule was generated on Centos 6.4 64-bit. It may or may not work for your particular setup.