Ad Widget

Collapse

Prosody Jabber Server and 2.2 on same server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yuusou
    Junior Member
    • Feb 2014
    • 24

    #1

    Prosody Jabber Server and 2.2 on same server

    I have Zabbix 2.2.2 and prosody Jabber server 0.9.3 (CentALT repos) on the same server (CentOS 6.5). At first I set up an account for Zabbix and set it up in Zabbix directly using the internal configuration. When an alert went off, I got the following error in prosody:
    Code:
    prosody[17433]: Client connected
    prosody[17433]: Authenticated as [email protected]
    prosody[17433]: Out of connection options, can't connect to monitor.local.net
    prosody[17433]: sending error replies for 1 queued stanzas because of failed outgoing connection to monitor.local.net
    prosody[17433]: Client disconnected: closed
    Note that the Zabbix user is [email protected] and connects correctly.

    I then set up the following script to use sendxmpp:
    Code:
    #!/bin/bash
    
    # TODO: Comments, debugging and log rotation.
    
    logFile='/var/log/zabbix/email-alert.log'
    dateTime=`date +%Y/%m/%d\ %H:%M:%S`
    
    from="/etc/zabbix/.sendxmpprc"
    to=$1
    subject=$2
    message=$3
    
    (
    cat << EOF
    ${subject}
    
    ${message}
    EOF
    ) | sendxmpp "$to" -f "$from"
    
    echo "[$dateTime] Jabber sent to: $to" | tee -a ${logFile} >> /dev/null
    echo "Subject: $subject" | tee -a ${logFile} >> /dev/null
    If I run it manually with the following command, it works fine:
    Code:
    sudo -u zabbix -g zabbix /etc/zabbix/alertscripts/zabXMPP [email protected] "srv-kvm04 [18:11:40] PROBLEM: TCP Service SSH is down" "Fix it"
    But running it from Zabbix, even with AllowRoot=1 in zabbix_server.conf, I get the same error as above.

    I found the following link (https://groups.google.com/forum/#!to...rs/OK5j4TJ8QYg) that described someone with a similar issue, but it doesn't make much sense for this situation because I'm running locally. It make even less sense when using the script and the script runs properly when run by hand.

    Has anyone ever encountered this issue? How did you solve it?
    All suggestions are welcome, of course.
  • yuusou
    Junior Member
    • Feb 2014
    • 24

    #2
    After two bloody days around this, I realized I had a typo in my username in Zabbix.

    Still, zabbix native jabber couldn't authenticate so I still have to use the script.

    Comment

    Working...