armchair dot tech
Nagios and XMPP | HOME | ABOUT | TAGS

February 28, 2011 | TAGS:

I found that someone has written a perl script geared towards sending alerts from Nagios to XMPP usernames.

I have downloaded this, but have not yet got it working as of yet, but it does look promising.  It took me a while to update all the dependencies for it, but if those were in place, the installation itself is rather simple.  That is, the notification script works, but I haven’t actually configured nagios as of yet.

This script has a shortcoming in that it only accepts the username portion of the JID and not the domain name – and this means that notifications can only be sent between users of the same domain.

To illustrate, [email protected] can not send a message to [email protected], but user1 and user2 on can send to each other.

And in the perl script, you have to specify the login credentials and server you’re connecting to:

my $len = scalar @ARGV; if ($len ne 2) {    die “Usage…n $0 [jabberid] [message]n”; } my @field=split(/,/,$ARGV[0]); #————————————

Google Talk & Jabber parameters :

my $hostname = ‘’; my $port = 5222;

componentname is the second half of your JID:

my $componentname = ‘’; my $connectiontype = ‘tcpip’; my $tls = 1;