Installation

RHEL / CentOS / Fedora

To install ZBXsend on RPM based systems follow these steps. Installation ist tested on CentOS 7 and Fedora but should work on others too.

Install ZBXalert Repository:

# rpm -ivh https://repo.zbxalert.com/rpm/zbxalert-repo-1.0.0-8.noarch.rpm
# yum clean all

Install ZBXsend:

# yum install -y zbxsend

SuSE Linux

To install ZBXsend on SuSE Linux systems follow these steps.

Install ZBXalert Repository:

# zypper ar -f http://repo.zbxalert.com/SuSE/SuSE.repo

Install ZBXsend:

# zypper in zbxsend

Ubuntu

To install ZBXsend on deb based systems, like Ubuntu, follow these steps. We currently have packages for Disco, Cosmic, Bionic and Xenial in our repository.

Install ZBXalert Repository:

# apt install apt-transport-https
# wget wget https://repo.zbxalert.com/apt/ubuntu/pool/non-free/z/zbxalert-ubuntu-disco/zbxalert-ubuntu-disco_1.0.0-5_all.deb
# dpkg -i zbxalert-ubuntu-disco_1.0.0-5_all.deb
# apt update

Install ZBXsend:

# apt install zbxsend

Debian

To install ZBXsend on deb based systems, like Debian, follow these steps. We currently have packages for Jessie and Stretch in our repository.

Install ZBXalert Repository:

# apt install apt-transport-https
# wget https://repo.zbxalert.com/apt/debian/pool/non-free/z/zbxalert-debian-stretch/zbxalert-debian-stretch_1.0.0-5_all.deb
# dpkg -i zbxalert-debian-stretch_1.0.0-5_all.deb
# apt update

Install ZBXsend:

# apt install zbxsend

Windows

To install ZBXsend on Windows based systems follow these steps.

We currently have no installers for ZBXsend so you need to download and place it manually to the right directory.

  1. Download the binary from our Download page
  2. Move the binary into the right directory, e.g. C:\Program files\ZBXalert\
  3. Create a config file and put it into a subdirectory under the directory with the binary, e.g. C:\Program files\ZBXalert\conf\
  4. Make sure all ZBXalert users who use zbxsend have write permission to the "conf" directory 

 

Examples

You can pass notification informations in two different ways. The first way is best for direct use in a command line or for scripts. Each element has its own command line parameter. If the IDENTIFIER, APIKEY or APITOKEN are found in the configuration file there is no need to put them on command line.

zbxsend \
	-i '<IDENTIFIER/INSTANCENAME>' \
	-a '<APITOKEN>' \
	-u '<APIKEY>' \
	-r '<RECIPIENTID>' \
	-e <EVENTID> \
	-s <STATUS> \
	-l <SEVERITY> \
	-t '<TITLE>' \
	-x '<TEXT>' \
	-n '<HOSTNAME>' \
	-g '<HOSTGROUP>' \
	-y '<HOSTTYPE>'

Real world example:

zbxsend \
	-i 'monit1' \
	-a 'k7jR8HiKBsy9ciagqNz8rDg1ZAtRtHy5Sbg3dIHLBjtDa0allNQO9ehK5bjURblvdwTZrvqXq6vXMxvikbpHaX0NzknCe7pZxh8kQyzwozRtPnshvhbQfdPuixRxeLbA' \
	-u 'Wlq4dTM1T32rfQq1Demoj6RazmKEYhi7FWcBTlK' \
	-r '52ababa5-9ca9-4a0a-8db7-b0de5ea960be' \
	-e 13438 \
	-s 1 \
	-l 3 \
	-t 'Free disk space is less than 15% on volume /srv' \
	-x 'Item values:\n\n1. Free disk space on /srv (percentage) (grey031 (Customer 12):vfs.fs.size[/export,pfree]): 2.75 %\n\n2. Free disk space on /export (percentage) (grey031 (Customer 12):vfs.fs.size[/export,pfree]): 2.75 %\n\n3. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*\n\nTrigger Description:\nThe free disk space for this volume is lower than 3% for at least 10 minutes.' \
	-n 'grey031' \
	-g 'webserver' \
	-y 'linux'

The second way is to put most of these parameters into one line. This is useful especially if not all parameters can be passed by command line.

zbxsend \
	-i '<IDENTFIER/INSTANCENAME>' \
	-a '<APITOKEN>' \
	-u '<APIKEY>' \
	-r '<RECIPIENTID>' \
	-p \
	-t 'Problem: <TITLE>|eventid:<EVENTID>|status:<STATUS>|severity:<SEVERITY>|hostname:<HOSTNAME>|hostgroup:<HOSTGROUP>|hosttype:<HOSTTYPE>' \
	-x '<TEXT>'

Notice
Up to version 1.0.5 the binary and configuration files were installed to /usr/local directory. Beginning with 1.0.6 the binary is located in /usr/bin/ and all configuration files in /etc/zbxalert/.
If you're upgrading please remove old packages/files first before installing the new package and don't forget to edit the new configuration file.