Table of Contents

Zabbix

Zabbix Server

Installation

$ wget https://repo.zabbix.com/zabbix/4.4/debian/pool/main/z/zabbix-release/zabbix-release_4.4-1+stretch_all.deb
$ dpkg -i zabbix-release_4.4-1+stretch_all.deb
$ apt update
$ apt -y install zabbix-server-pgsql zabbix-frontend-php zabbix-nginx-conf php-pgsql zabbix-agent

Setup

Postgresql

$ sudo -u postgres createuser --pwprompt zabbix
$ sudo -u postgres createdb -O zabbix zabbix
$ zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix
$ sudo nano /etc/zabbix/zabbix_server.conf
  < /etc/zabbix/zabbix_server.conf >
  DBPassword=

Php

$ sudo nano /etc/zabbix/nginx.conf
  < /etc/zabbix/nginx.conf >
  listen 80;
  server_name localhost;
$ sudo nano /etc/zabbix/php-fpm.conf
  php_value[date.timezone] =  America/Chicago

Start

$ systemctl restart zabbix-server zabbix-agent nginx php7.0-fpm
$ systemctl enable zabbix-server zabbix-agent nginx php7.0-fpm

Test

$ sudo apt-get install zabbix_get
$ zabbix_get -s 192.168.35.28 -p 10050 -k system.cpu.load[all,avg1]

Configuration

Discovery

Create discovery rule
IP range: 192.168.35.1-254
Checks: Zabbix agent "system.uname"
Device uniqueness criteria: IP address
Host name: DNS name
Visible name: Host name
[x] Enabled

Actions

Create action
Host IP equals 192.168.0.1-127, 192.168.2.1
Default Subject:
  Discovery: {DISCOVERY.DEVICE.STATUS} {DISCOVERY.DEVICE.IPADDRESS}
Default Message:
  Discovery rule: {DISCOVERY.RULE.NAME}
  
  Device IP: {DISCOVERY.DEVICE.IPADDRESS}
  Device DNS: {DISCOVERY.DEVICE.DNS}
  Device status: {DISCOVERY.DEVICE.STATUS}
  Device uptime: {DISCOVERY.DEVICE.UPTIME}
  
  Device service name: {DISCOVERY.SERVICE.NAME}
  Device service port: {DISCOVERY.SERVICE.PORT}
  Device service status: {DISCOVERY.SERVICE.STATUS}
  Device service uptime: {DISCOVERY.SERVICE.UPTIME}
Operations: (New)
  Operation type:
    Add to host group
    Host groups: Discovered hosts

Zabbix Client

Installation

$ sudo apt-get install zabbix-agent

Setup

$ sudo nano /etc/zabbix/zabbix_agentd.conf
  </etc/zabbix/zabbix_agentd.conf>
  Server=192.168.35.32
  ServerActive=192.168.35.32:10051
$ sudo pkill zabbix_agentd
$ sudo /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf