[Nagiosplug-help] jabber notification
Giles Coochey
gcoochey at sapphire.gi
Mon Nov 26 17:14:35 CET 2007
Below
________________________________________
From: nagiosplug-help-bounces at lists.sourceforge.net
[mailto:nagiosplug-help-bounces at lists.sourceforge.net] On Behalf Of
Giles Coochey
Sent: 19 November 2007 13:02
To: nagiosplug
Subject: [Nagiosplug-help] jabber notification
Hi All,
I have seen the notify_by_jabber perl script.
Because of the number of notifications that I get through some passive
volatile service checks I was wondering whether anyone has seen one that
was compiled in C rather than perl, as Nagios seems to take quite a
while running the notification script when I get a flood of events - I'm
thinking that a C program might be faster.
Are there any jabber alternatives to the perl script?
If there isn't one then I'll look at using sec.pl to handle these
passive checks (they're SNMP traps, after all) and only produce a single
alert (so far they've been routing topology change notifications from
multiple routers & switches in our infrastructure).
Best Regards,
Giles
########################################################################
##
I've tried replacing the notify_via_jabber.pl perl script with centerim.
It essentially allows to run centerim in the background (as the Nagios)
user, and allows me to, as the Nagios user, send jabber alerts via the
command line.
A small issue is that as soon as I modify my commands.cfg to have a
notification I find it does not work, and cannot seem to talk to the
centerim process (centerim is running as the Nagios user).
This is what works from the command line:
echo "Host '$HOSTALIAS$' is $HOSTSTATE$ - Info: $HOSTOUTPUT$ - Time:
$LONGDATETIME$" | /usr/local/bin/centerim -s msg -p jab -t
username at jabber.server.org
This is what doesn't work from the commands.cfg file:
# 'notify-by-jabber' command definition
define command{
command_name notify-by-jabber
command_line /bin/echo "Service: $SERVICEDESC$ - Host:
$HOSTNAME$ - Address: $HOSTADDRESS$ - State: $SERVICESTATE$ - Info:
$SERVICEOUTPUT$ - Date: $LONGDATETIME$" | /usr/local/bin/centerim -s msg
-p jab -t username at jabber.server.org
}
>From the Nagios log, I see it calling notify-by-jabber but I get no such
alert (I was using $CONTACTPAGER$ as the -t parameter, but tried
hardcoding it in the command and it still doesn't work).
Any ideas as to what might cause this?
On an aside, I have implemented sec.pl, but still have Nagios spending
too much time processing notifications, so really need to replace the
slow notify_by_jabber perl script. Centerim looks ideal, but for some
reason isn't working.
More information about the Help
mailing list