Page 1 of 5

Notifications on Openfire?

Posted: Fri Apr 12, 2013 4:11 am
by Yaerox
Hey guys,

I'm actual running Nagios Core and Openfire on openSUSE and now I'd like to send notifications (if a problem appears) in the Openfire-Chat.
I did alot of research, found several Jabber Notifications, BUT they were all out of date, and no one of them got any Documentation.

So my question is: is it possible to connect Nagios and Openfire? If yes, do I only need the check_jabber plugin? I know jabber is another call for xmpp, but xmpp is not equal Openfire ... right ?!

I'd be pleased if someone could help me to find (and maybe to install) such a function.

Regards

Re: Notifications on Openfire?

Posted: Fri Apr 12, 2013 7:35 am
by gshergill
Hi Yaerox,

Just to confirm, are you trying to send Nagios notifications to an xmpp chat room/user? (i.e. Nagios XMPP notifications)

If so, you should check out Nagibot, it's what I use for this functionality and it's quite good, no real problems with it since I set it up.

Below are the two pages I used for this.
The first link is in German. I don't know German, but the steps seemed simple enough to follow.

Good luck!

Kind Regards,

Gary Shergill

Re: Notifications on Openfire?

Posted: Fri Apr 12, 2013 7:57 am
by Yaerox
Hi gshergill,

yeah, I want Nagios to send notifications to an Openfire chat room/user.

Ill try this out. The first link is pretty nice, I'm german so, I'll give it a try now ;)

Thanks alot.

Re: Notifications on Openfire?

Posted: Fri Apr 12, 2013 8:51 am
by Yaerox
Actual trying to install NagiBot - no problems until: start nagiBot.

I'm only getting:
nagibot 0.8 starting ...
using config file from commandline
Trying to connect ...
Opening fifo for reading ...
connected to example.com:5222

and the following is still missing:
Connected as [email protected]/nagibot.pl
Setting presence ...
Joining rooms (if any) ...
Register room message handler ...
Starting idle timer (300 seconds).

The Nagibot user doesnt even got online ...

Thanks in advice.

Re: Notifications on Openfire?

Posted: Fri Apr 12, 2013 3:57 pm
by abrist
Can you post your nagibot config file and the nagios service check definition you are using for it?

Re: Notifications on Openfire?

Posted: Fri Apr 12, 2013 5:40 pm
by Yaerox
Yeah but unfortunately on monday. Actual on my weekend i have no chance do get on the Computer right now :/ sry but i really appreciate your help and hope you will still help me on monday.

Thanks alot.
Regards.

Re: Notifications on Openfire?

Posted: Mon Apr 15, 2013 1:21 am
by Yaerox
I've used the posted .pdf of gshergill.

Starting Nagibot:

Code: Select all

nagibot.pl -vvv -c /usr/local/src/nagibot/nagibot.conf nagibot@IP_ADRESS
nagibot 0.8.3 starting ...
using config file from commandline
Trying to connect ...
Opening fifo for reading ...
connected to IP_ADRESS:5222
Disconnected from IP_ADRESS:5222: Error on connection to IP_ADRESS:5222: Protocol error
Trying to connect ...
Opening fifo for reading ...
connected to IP_ADRESS:5222
Here my configs...

nagibot.conf:

Code: Select all

---
# Rooms to join
[email protected]_ADRESS: nagibot
---
# JIDs to inform (none in my case)
---
# Configuration
nagios_status_log_file: /usr/local/nagios/var/status.dat
nagios_msg_fifo: /usr/local/nagios/var/rw/nagibot.fifo
bot_status: available
bot_status_text: I am a bot ...
bot_status_priority: 10
password: MY_PASSWORD_SET_FOR_THE_NAGIOS_USER_IN_OPENFIRE
---
commands.cfg

Code: Select all

define command{
command_name notify-host-by-pipe
command_line /usr/bin/printf "%b" \
"*$NOTIFICATIONTYPE$* $HOSTNAME$ is $HOSTSTATE$\n" \
>> /usr/local/nagios/var/rw/nagibot.fifo
}

define command{
command_name notify-service-by-pipe
command_line /usr/bin/printf "%b" \
"*$NOTIFICATIONTYPE$* $SERVICEDESC$ on $HOSTALIAS$ $SERVICESTATE$\n" \
>> /usr/local/nagios/var/rw/nagibot.fifo
}
localhost.cfg:

Code: Select all

define service{
        use                             local-service        
        host_name                       localhost
        service_description             FTP
        check_command                   notify-service-by-pipe
        }

         

Regards

Re: Notifications on Openfire?

Posted: Mon Apr 15, 2013 7:32 am
by gshergill
Hi Yaerox,

The problem seems to be with connecting to the server;

Code: Select all

Disconnected from IP_ADRESS:5222: Error on connection to IP_ADRESS:5222: Protocol error
Not sure why that's coming up, I never had that appear.

Personally I use the FQDN when connecting;

Code: Select all

nagibot.pl -vvv -c /usr/local/src/nagibot/nagibot.conf [email protected]
Using the IP there had some errors for me before (different to yours).

Kind Regards,

Gary Shergill

Re: Notifications on Openfire?

Posted: Mon Apr 15, 2013 7:38 am
by Yaerox
#edited post:

Hi gshergill,

I'm running Openfire and Nagios on an openSUSE VM in a domain ... on Openfire-User-Administration NagiBot got the JID: nagibot@IP_ADRESS.

If I try hostname -f I get "hostname: Name or service not known"
hostname is giving me a linux-wnrb ...

hosts: 127.0.0.1 localhost

Starting Nagibot @localhost instead of IP_ADRESS gives me the same result :/

resolv.conf:
search the.name.of.my.domain
nameserver an_adress_of_my_domain

Regards

Re: Notifications on Openfire?

Posted: Mon Apr 15, 2013 8:33 am
by gshergill
Hi Yaerox,

Sorry, didn't see the bit about openSUSE, never heard of it to be honest (I just use seperate VMs, one with Openfire and the rest with Nagios).

Sorry can't be much more help.

Kind Regards,

Gary Shergill