ZABBIX Server v3.0 installation on CentOS7 Step-By-Step manual



1. OS
a. Linux CentOS 7
b. Update it
c. Prerequisites
d. Database
e. Secure it

2. Zabbix 3.0 using MySQL database, MariaDB
a. install Zabbix
b. connect to database
c. configure front-end
d. secure server
e. finish configuration

# Install basic server and configure it
CentOS Download – https://www.centos.org/download/
http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso

# Set IP and activate adapters if required
nmtui

#connect using SSH/Telnet

# Change time zone if not done jet
mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/Europe/Riga /etc/localtime

#Check swap file
free -m

#Create swap file
dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
chown root:root /swapfile1
chmod 0600 /swapfile1
mkswap /swapfile1
swapon /swapfile1
free -m

# To activate /swapfile1 after Linux system reboot
vi /etc/fstab
#Append the following line:
/swapfile1 none swap sw 0 0

# Update CentOS – take some ~5-10 minutes..
yum update -y

# Install some useful packages
yum install vim -y

#Install MySQL fork Mariadb
yum install mariadb-server -y

# Edit MySQL config file and add innodb_file_per_table under [mysqld] section
vim /etc/my.cnf
innodb_file_per_table

#Start MySQL and secure it (by default database root has no password)
systemctl start mariadb
mysql_secure_installation

#create zabbix database and user
mysql -p
CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO [email protected] IDENTIFIED BY ‘PasswordHere’;
flush privileges;
exit

#Installation of Firewall
yum install firewalld -y
systemctl unmask firewalld
systemctl enable firewalld
systemctl start firewalld

# allow connections to ports 10051 (Zabbix server), 10050 (Zabix agent), 80 (HTTP) 443 (HTTPS) in firewalld
firewall-cmd –permanent –zone=public –add-port=10051/tcp
firewall-cmd –permanent –zone=public –add-port=10050/tcp
firewall-cmd –permanent –zone=public –add-port=80/tcp
firewall-cmd –permanent –zone=public –add-port=443/tcp
firewall-cmd –reload

==========================================
# Install Zabbix packages on CentOS/RHEL 7

# Download Zabbix 3.0 configuration package
rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

# Install Zabbix packages
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway -y

# Import initial DB schema and data (Zabbix version can be different, so check folder name)
cd /usr/share/doc/zabbix-server-mysql-3.0.3
zcat create.sql.gz | mysql -uroot -p zabbix

# Edit database configuration in zabbix_server.conf
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost (better change to IP)
DBName=zabbix
DBUser=zabbix
DBPassword=your password for DB user “zabbix”

# Edit PHP timezone
vim /etc/httpd/conf.d/zabbix.conf

php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone Europe/Riga

# It’s necessary to uncomment the “date.timezone” setting and set the right timezone for you.

# After changing the configuration file restart the apache web server.
systemctl start httpd

# Start Zabbix server process
systemctl start zabbix-server

#check the status
systemctl status zabbix-server -l

# Start Zabbix agent process.
systemctl start zabbix-agent

# Set SELinux settings – recommended, but can make trouble if not configured))
getenforce
setsebool -P httpd_can_network_connect=1
setsebool -P httpd_can_connect_zabbix=1
setsebool -P zabbix_can_network=1

getsebool -a | grep zabbix
getsebool -a | grep httpd_can_network_connect

# Add all Zabbix services to server startup
systemctl list-unit-files

systemctl enable zabbix-server.service
systemctl enable zabbix-agent.service
systemctl enable zabbix-java-gateway.service
systemctl enable httpd.service
systemctl enable mariadb

#Ready to go to http://ipaddress/zabbix to finish setup
Server name: name of Zabbix server instance (will see it in the right up corner, under logout) Example: zbx_prod01, zbx_test01, zbx3.0.centos7 etc.

Default user: Admin
password: zabbix

/etc/zabbix/web/zabbix.conf.php

Thank’s for watching!
Please, subscribe!
Br, Alexander

26 thoughts on “ZABBIX Server v3.0 installation on CentOS7 Step-By-Step manual

  1. MY server not start 🙁 please help

    [[email protected] ~]# systemctl start zabbix-server
    Job for zabbix-server.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-server.service" and "journalctl -xe" for details.
    [[email protected] ~]# systemctl status zabbix-server -l
    ● zabbix-server.service – Zabbix Server
       Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled)
       Active: activating (auto-restart) (Result: exit-code) since czw 2018-01-25 10:35:07 CET; 8s ago
      Process: 1173 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
      Process: 1170 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
     Main PID: 1172 (code=exited, status=1/FAILURE)

    sty 25 10:35:07 zabix systemd[1]: zabbix-server.service: control process exited, code=exited status=1
    sty 25 10:35:07 zabix systemd[1]: Unit zabbix-server.service entered failed state.
    sty 25 10:35:07 zabix systemd[1]: zabbix-server.service failed.
    [[email protected] ~]#

    end 
    PID file /run/zabbix/zabbix_server.pid not readable (yet?) after start.
    No PID …

  2. please help me this error.when i run : systemctl start zabbix-server

    Job for zabbix-server.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-server.service" and "journalctl -xe" for details.

  3. Hi Mortulevs, in the video I did not see you install the Apache server(httpd), you just started the "httpd service" directly.Does it mean that there is no need to install the Apache server during the installation of the Zabbix? I am looking forward to hearing your answer,thanks!

  4. I was install Zabbix 3.o on CentOS 7, but can't start Zabbix server 🙁 Can you help me fix this issue ?
    Apr 25 15:55:47 zabbix systemd[1]: PID file /run/zabbix/zabbix_server.pid not readable (yet?) after start.
    Apr 25 15:55:47 zabbix systemd[1]: Failed to start Zabbix Server.
    Apr 25 15:55:47 zabbix systemd[1]: Unit zabbix-server.service entered failed state.
    Apr 25 15:55:47 zabbix systemd[1]: zabbix-server.service failed.
    [[email protected] ~]# vi /var/log/zabbix/zabbix_server.log^C

  5. systemctl start zabbix-server
    when i execute this command

    "Job for zabbix-server.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-server.service" and "journalctl -xe" for details."

    getting this error please help me

  6. ● zabbix-server.service – Zabbix Server
    Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
    Active: activating (auto-restart) (Result: exit-code) since Tue 2017-03-07 18:57:42 BDT; 4s ago
    Process: 2926 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
    Process: 2920 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
    Main PID: 2924 (code=exited, status=1/FAILURE)

    Mar 07 18:57:42 localhost.localdomain kill[2926]: -V, –version output version information and exit
    Mar 07 18:57:42 localhost.localdomain kill[2926]: For more details see kill(1).
    Mar 07 18:57:42 localhost.localdomain systemd[1]: zabbix-server.service: control process exited, code=exited status=1
    Mar 07 18:57:42 localhost.localdomain systemd[1]: Unit zabbix-server.service entered failed state.
    Mar 07 18:57:42 localhost.localdomain systemd[1]: zabbix-server.service failed.

    please help me getting out of this problem.. In web interface i am getting server is not running ..please help me

  7. hi, please do you help me ?This is my error:Run the command systemctl start zabbix-serverRun the command systemctl status zabbix-server[[email protected] zabbix-server-mysql-3.0.4]# systemctl status zabbix-server
    ● zabbix-server.service – Zabbix Server
       Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled)
       Active: activating (auto-restart) (Result: exit-code) since sáb 2016-08-20 01:20:48 VET; 8s ago
      Process: 48985 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
      Process: 48979 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
     Main PID: 48981 (code=exited, status=1/FAILURE)ago 20 01:20:48 centoslocalhost systemd[1]: zabbix-server.service: control process exited, code=exited status=1
    ago 20 01:20:48 centoslocalhost systemd[1]: Unit zabbix-server.service entered failed state.
    ago 20 01:20:48 centoslocalhost systemd[1]: zabbix-server.service failed.
    ago 20 01:20:48 centoslocalhost kill[48985]: -q, –queue <sig>      use sigqueue(2) rather than kill(2)
    ago 20 01:20:48 centoslocalhost kill[48985]: -p, –pid              print pids without signaling them
    ago 20 01:20:48 centoslocalhost kill[48985]: -l, –list [=<signal>] list signal names, or convert one to a name
    ago 20 01:20:48 centoslocalhost kill[48985]: -L, –table            list signal names and numbers
    ago 20 01:20:48 centoslocalhost kill[48985]: -h, –help     display this help and exit
    ago 20 01:20:48 centoslocalhost kill[48985]: -V, –version  output version information and exit
    ago 20 01:20:48 centoslocalhost kill[48985]: For more details see kill(1).

Leave a Reply

Your email address will not be published. Required fields are marked *