Notifications on Openfire?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Yaerox
Posts: 23
Joined: Fri Apr 12, 2013 4:02 am

Notifications on Openfire?

Post 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
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Notifications on Openfire?

Post 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
Yaerox
Posts: 23
Joined: Fri Apr 12, 2013 4:02 am

Re: Notifications on Openfire?

Post 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.
Yaerox
Posts: 23
Joined: Fri Apr 12, 2013 4:02 am

Re: Notifications on Openfire?

Post 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 nagibot@example.com/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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Notifications on Openfire?

Post by abrist »

Can you post your nagibot config file and the nagios service check definition you are using for it?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Yaerox
Posts: 23
Joined: Fri Apr 12, 2013 4:02 am

Re: Notifications on Openfire?

Post 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.
Yaerox
Posts: 23
Joined: Fri Apr 12, 2013 4:02 am

Re: Notifications on Openfire?

Post 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
nagibot-room@conference.SERVER_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
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Notifications on Openfire?

Post 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 nagibot@openfire.example.com
Using the IP there had some errors for me before (different to yours).

Kind Regards,

Gary Shergill
Yaerox
Posts: 23
Joined: Fri Apr 12, 2013 4:02 am

Re: Notifications on Openfire?

Post 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
Last edited by Yaerox on Mon Apr 15, 2013 7:55 am, edited 1 time in total.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Notifications on Openfire?

Post 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
Locked