Zabbix and XMPP alerts · uwot.eu
another meaningless subtitle

Zabbix and XMPP alerts

· by fabio · Read in about 1 min · (179 Words)
CentOS 7 XMPP Zabbix

Zabbix should theoretically be able out of the box to send alerts via XMPP.
For some reason this functionality does not work as intended, luckily it is possible to specify a custom script to send alerts; combining the aforementioned script with the Perl library sendxmpp is the easiest solution to solve the issue.

$ yum install sendxmpp
echo “$3” | /usr/bin/sendxmpp -u <sender_user> -j <sender_domain> -p <sender_user_password> -s “$2” -i "$1" -t

Change file ownership and permissions accordingly

$ chown zabbix:zabbix /usr/lib/zabbix/alertscripts/sendxmpp.sh
$ chmod 755 /usr/lib/zabbix/alertscripts/sendxmpp.sh

Three more steps are needed, those can be performed directly inside Zabbix’s web GUI:
1. navigate “Adminstration” -> “Media Types”, create a new one with “Type” set to “script”, “Script” set to “sendxmpp.sh” and three parameters: {ALERT.SENDTO}, {ALERT.SUBJECT}, {ALERT.MESSAGE};

https://uwot.eu/blog//2017/10/media_type.png

2. navigate “Configuration” -> “Actions”, click on “Report problems to Zabbix administrators” and add a “New condition” like for example: “Trigger severity”, “>=”, “Information”;

https://uwot.eu/blog//2017/10/action.png

3. navigate “Configuration” -> “Users”, click on a username, navigate to the “Media” tab, add a new one and specify the receiver XMPP address.

https://uwot.eu/blog//2017/10/user.png

You should now receive XMPP notifications.