Nagios jabber notification

Nagios can be configured to send notifications by various ways email “the default notification for Nagios”, sms and jabber …
It’s very flexible enough to let you develop reel solutions.
In this tutorial we will focus on how to configure nagios to send notification to your jabber account using twisted.

First install python-twisted interface.
On Debian and derive like Ubuntu use apt like this:$ sudo apt-get install python-twisted

And let’s define the command that will be interpreted when nagios call notify-host-by-jabber and notify-service-by-jabber
So change /home/mezgani/script/fdbot.py by the path of your python bot, the output of the command will be redirected
to the log file /var/log/nagios3/jabber.log
Add the following to your /etc/nagios3/commands.cfg.

Well, here i define the jabber bot named fdbot, it is a python script based on twisted framework that transforms your message to a valid jabber message.
You can choose your script language it can be done with perl using ‘Net::XMPP’, with ruby using ‘xmpp4r’, and others.
my choise of python was just for my need to learn twisted framework.

You can Get fdbot by git like:$ git clone git://github.com/mezgani/fdbot.git
set up the undefined variables in the fdbot.py script.

and restart nagios:$ sudo /etc/init.d/nagios3 restart

The source code at Github. Go visit the Github project page for fdbot.

Do you know if it’s possible to have usernames with the ‘at’ sign in them as well (in addition to having the server name)? I keep getting “twisted.words.protocols.jabber.jid.InvalidFormat: Invalid character in hostname”