I, Chuẩn bị
Small – CentOS – Virtual Appliance – MySQL InnoDB – monitor 100 host
Medium – CentOS – 2 CPU cores/2GB RAM – MySQL InnoDB – monitor 500 host
Large – RedHat Enterprise Linux – 4 CPU cores/8GB RAM – RAID10 MySQL InnoDB or PostgreSQL – monitor >1000 host
Very large – RedHat Enterprise Linux – 8 CPU cores/16GB RAM – Fast RAID10 MySQL InnoDB or PostgreSQL – monitor >10000 host
+ Set địa chỉ IP tĩnh, kiểm tra kết nối ra Internet, update các package

II, Cài đặt Zabbix-server
– Download repo zabbix và unpackage
root@ubuntu:/# wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
root@ubuntu:/# dpkg -i zabbix-release_3.4-1+xenial_all.deb

– Update lại package mới + Cài đặt zabbix server và các gói cài đặt cần thiết: zabbix server, zabbix client, mysql, php…
root@ubuntu:/# apt-get update
root@ubuntu:/# apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring

root@ubuntu:/# apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent zabbix-get zabbix-sender snmp snmpd snmp-mibs-downloader php7.0-bcmath php7.0-xml php7.0-mbstring

– Edit time zone của zabbix server
- Mở file /etc/zabbix/apache.conf chỉnh time zone Việt Nam : Asia/HoChiMinh
root@ubuntu:/# vi /etc/zabbix/apache.conf

- Reload lại service apache
root@ubuntu:/# systemctl reload apache2
– Tạo database và user truy cập databaser
- Truy cập vào database
root@ubuntu:/# mysql -u root -p

- Tao dabase với tên là zabbixdb
MariaDB [(none)]> create database zabbixdb character set utf8 collate utf8_bin;

- Gán quyền và đặt password cho database vừa tạo ở trên
MariaDB [(none)]> grant all privileges on zabbixdb.* to zabbixuser@localhost identified by '123456a@'; - Xác nhận query và thoát
MariaDB [(none)]> flush privileges; MariaDB [(none)]> quit

- Import database ban đầu của zabbix
root@ubuntu:/# cd /usr/share/doc/zabbix-server-mysql/ root@ubuntu:/usr/share/doc/zabbix-server-mysql# zcat create.sql.gz | mysql -u root -p zabbixdb Enter password: - Config database
root@ubuntu:/# vi /etc/zabbix/zabbix_server.conf
Tìm và sửa các thông số
DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=123456a@

- Restart service zabbix-server, zabbix-agent
root@ubuntu:/# systemctl enable zabbix-server root@ubuntu:/# systemctl start zabbix-server root@ubuntu:/# systemctl enable zabbix-agent root@ubuntu:/# systemctl start zabbix-agent
– Truy cập bằng trình duyệt hoàn tất kết nối qua giao diện
Truy cập đường dẫn: http://172.16.3.199/zabbix

Check các thành phần bắt buộc có để cài đặt zabbix server thành công

Nhập các thông tin kết nối đền database đã tạo ở trên

Nhập name hiển thị đại diện cho zabbix server

Check lại thông tin đã nhập

Cấu hình thành công

Login với tài khoản mặc định Admin/zabbix

- Cài đặt thành công zabbix

III, Cài đặt zabbix agent trên client
– Cài đặt trên server OS Ubuntu
wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
dpkg -i zabbix-release_3.4-1+xenial_all.deb
sudo apt-get update
sudo apt-get install zabbix-agent
- Chỉnh sửa file config để kết nối tới zabbix server
vi /etc/zabbix/zabbix_agentd.conf
Tìm và chỉnh sửa các thông tin sau để kết nối tới zabbix server
Server=172.16.3.193
ListenPort=10050

- Khởi động lại service zabbix-agent
service zabbix-agent restart
– Cài đặt trên OS Centos
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++
- Get Collectd, untar it, make it and install
wget http://collectd.org/files/collectd-5.4.0.tar.gz tar zxvf collectd-5.4.0.tar.gz cd collectd-5.4.0 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --mandir=/usr/share/man --enable-all-plugins make make install - Copy the default init.d script
cp /root/collectd-5.4.0/contrib/redhat/init.d-collectd /etc/init.d/collectd - Set the correct permissions
chmod +x /etc/init.d/collectd - Start the deamon
service collectd start

