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:
Note that the Zabbix user is [email protected] and connects correctly.
I then set up the following script to use sendxmpp:
If I run it manually with the following command, it works fine:
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.
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
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
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"
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.
Comment