Utility to send emails through mailgun for Shinken alerts. Blog post: http://rohit.io/shinken-mailgun-plugin.html
- A working shinken setup installed in a server.
- Python >= 2.6 is installed on that server
It is a modern open source Nagios® like tool, redesigned and rewritten from scratch in Python. Hosted in Github: https://github.com/naparuba/shinken. Website: http://www.shinken-monitoring.org/
Mailgun is a hosted service which provides easy to use HTTP APIs for emails. It can be used used for sending, receiving and tracking email effortlessly. Website: http://www.mailgun.com/
- Sign up: https://mailgun.com/signup
In 'settings' section, update the following variables:
- servername: Enter sandbox name (See image below)
- sender: Desired monitoring email ID
- recipients: Destination email ids separated by comma
- authorization: Mailgun API key (See image below)
- serverurl: Update this with your shinken http url. It helps in generating the exact host/service link in alert mails.
-
commands.cfg - /usr/local/shinken/etc/commands.cfg
- Update this file with contents from shinken_mailgun_plugin/commands.cfg
- Add python virtualenv location in resource.cfg. For example:
-
$PYTHON_VENV$ =/usr/src/python_env
-
- Add location details of nrpe plugin files. For example:
-
$PLUGINSDIR$ =/usr/local/nagios/libexec
-
- Update the <event_command_name> as instructed in comments.
-
templates.cfg - /usr/local/shinken/etc/templates.cfg
- Update notification command details in this file. Set the following as:
- host_notification_commands host_email_alerts
- service_notification_commands service_email_alerts
- Update notification command details in this file. Set the following as:
Once configurations files are updated, restart shinken-arbiter to apply settings:
# /etc/init.d/shinken-arbiter restart
Restarting arbiter
Doing config check
. ok
. ok
#