Sunday, May 1, 2016

easy create service monitoring and alert system

kanla is a small-scale alerting system that peridiocally checks your website, mail server, etc, if they are not still up and running.kanla will send a notify you via jabber (XMPP).

so it is very easy to install and setup up. so if you still not have any monitoring system to install in mind, use kanla temporary to alert in case the health check of service (http, mail) fails.

*** you can follow the link of how-to below  to setup your own xmpp, if you wish too
http://www.atechnote.com/2014/10/how-to-configure-xmpp-server-ejabberd.html

1- install kanla to the system
$ sudo apt-get install kanla

2- configure kanla by modify file  /etc/kanla/default.cfg as bellow (we use alert@host.chat as the user to send alert out and admin@host.chat as the user to receive alert )

<jabber>
    jid      = "alert@host.chat"
    password = "alert"
</jabber>
send_alerts_to = <<EOT
admin@host.chat
EOT
include "default.d/*.cfg"


3- create configuration file for monitoring in directory /etc/kanla/default.d/
-- fail.cfg
# The fail-plugin will periodically send you an error.
# This can be used to verify your xmpp-setup.
# If everything works you can just remove this file.
<monitor fail>
    plugin = fail
</monitor>


- http-example.cfg
 <monitor kanla website>
    plugin = http
    url = "http://localhost/"
</monitor>


-kanla-restarted.cfg
# This plugin notifies you when kanla is restarted by systemd,
# which typically happens when it crashed.
<monitor kanla-restarted>
    plugin = kanla-restarted
</monitor>


4- restart kanla service then you will receive message in case 1- the local web server fail, 2- periodically fail message 3- when restart kanla service
$  sudo /etc/init.d/kanla restart


screeenshot of receive messages

No comments:

Post a Comment