About Zabbix
Zabbix is a free and open source network monitoring Software tool which is used to monitor and track the availability and performance of your IT infrastracture: servers, network devices and other IT assets.
In this article we will install Zabbix 3.4 on CentOS 7 and RHEL 7, in order to use Zabbix we required a Web Server (Apache), database server(Mysql, Mariadb, Postgresql …) and PHP to work.
Environment:
- Hostname = zabbix.yallalabs.com
- IP Address = 192.168.1.200
- OS = CentOS 7 / RHEL 7
Before we begin, note that I have installed lamp stack in my server:
[root@zabbix ~]# yum update [root@zabbix ~]# yum install httpd -y [root@zabbix ~]# yum install php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml -y [root@zabbix ~]# yum install mariadb-server -y [root@zabbix ~]# systemctl enable httpd && systemctl start httpd [root@zabbix ~]# systemctl enable mariadb && systemctl start mariadb
– Don’t forget to set a password for the root using mysql_secure_installtion, take a look to this tutorial: Securing MySQL server / Mariadb with mysql_secure_installation
Step 1 – Install Zabbix Server with MySQL
Before starting the installation we need to enable the zabbix repository using this commands:
[root@zabbix ~]# rpm --import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX [root@zabbix ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
Now use the below command to install Zabbix and necessary packages
[root@zabbix ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway -y
Step 2 – Edit PHP timezone
Open the file /etc/httpd/conf.d/zabbix.conf created by Zabbix with your favourite editer
[root@zabbix ~]# vi /etc/httpd/conf.d/zabbix.conf
It’s necessary to uncomment the “date.timezone” setting and set the right timezone for you.
php_value date.timezone Europe/Rome
– Save the file and don’t forget to reload httpd service using the below command:
[root@zabbix ~]# systemctl reload httpd
Step 3 – Edit create and import initial zabbix database and user
First we need to create zabbix database (zabbixdb) and create a zabbix user (zabbixuser).
[root@zabbix ~]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.47-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> CREATE DATABASE zabbixdb CHARACTER SET utf8 COLLATE utf8_bin; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbixdb.* TO zabbixuser@localhost IDENTIFIED BY "Password"; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> exit Bye [root@zabbix ~]#
– After creating the zabbix database and user we need to import the zabbix initial database using the below commands:
[root@zabbix ~]# zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz | mysql -uroot -p zabbixdb
– Now we need to edit database configuration in the zabbix server configuration file zabbix_server.conf
[root@zabbix ~]# vi /etc/zabbix/zabbix_server.conf
Specify the database name for zabbix , database user name and the password
DBHost=localhost DBName=zabbixdb DBUser=zabbixuser DBPassword=Password
Step 4 – Set SELinux settings and adjust Firewall
– Having SELinux status enabled in enforcing mode, you need to execute the following command to enable successful connection of Zabbix frontend to the server
[root@zabbix ~]# setsebool -P httpd_can_network_connect=1 [root@zabbix ~]# setsebool -P httpd_can_connect_zabbix=1 [root@zabbix ~]# setsebool -P zabbix_can_network=1
– SELinux configuration is done, you need to restart Apache web server:
[root@zabbix ~]# systemctl start httpd
– Execute the following command to enable http service and connection between the Zabbix server and agents:
[root@zabbix ~]# firewall-cmd --permanent --add-service=http success [root@zabbix ~]# firewall-cmd --permanent --zone=public --add-port=10051/tcp success [root@zabbix ~]# firewall-cmd --permanent --zone=public --add-port=10050/tcp success [root@zabbix ~]# firewall-cmd --reload success
– After adjusting the Selinux settings and the firewall we need to enable and start zabbix service on boot using the bellow commands
[root@zabbix ~]# systemctl enable zabbix-server [root@zabbix ~]# systemctl start zabbix-server [root@zabbix ~]# systemctl enable zabbix-agent [root@zabbix ~]# systemctl start zabbix-agent
Note: If you have issues starting the zabbix-server daemon and the zabbix-agent daemon and you got this error “Job for zabbix-server.service failed because a configured resource limit was exceeded. See “systemctl status zabbix-server.service” and “journalctl -xe” for details“, you need to set Selinux roles using the audit2allow command:
[root@zabbix ~]# yum install policycoreutils-python -y
* SELINUX for Zabbix-agent:
[root@zabbix ~]# cat /var/log/audit/audit.log | grep zabbix_agentd | grep denied | audit2allow -M zabbix_agent_setrlimit [root@zabbix ~]# semodule -i zabbix_agent_setrlimit.pp
* SELINUX for Zabbix-server:
[root@zabbix ~]# cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit [root@zabbix ~]# semodule -i zabbix_server_setrlimit.pp
– Finaly:
[root@zabbix ~]# systemctl start zabbix-server [root@zabbix ~]# systemctl start zabbix-agent
Step 5 – Configure Zabbix via Web console
– Navigate to http://ip_address/zabbix or http://host_name/zabbix
– Make sure that all software prerequisites are met.
– Enter details for connecting to the database. Zabbix database must already be created.
– Enter Zabbix server details.
– Review a summary of settings.
– Finish the installation.
– Now you’ll be redirected to the zabbix web console page. The default user name is Admin and the password is zabbix .
Last thing to do is to enable your server zabbix to be monitored: go to Configuration -> Hosts. Select the host (zabbix server) and click “Disabled”
We hope this tutorial was enough Helpful. If you need more information, or have any questions, just comment below and we will be glad to assist you!
PS. If you like this post please share it with your friends on the social networks using the buttons below.Thanks.
64 comments
Followed steps but Zabbix web popup following error massage
“zabbix server is not running the information displayed may not be current”
Last login: Wed Oct 4 02:06:58 2017 from 192.168.202.53
[root@zabbixhk ~]# systemctl status zabbix-server
● zabbix-server.service – Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: deactivating (stop-sigterm) (Result: exit-code) since Wed 2017-10-04 02:35:10 HKT; 1s ago
Process: 12337 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
Process: 12281 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 12283 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/zabbix-server.service
└─12318 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
Oct 04 02:35:10 zabbixhk.localdomain kill[12337]: with the same uid as the present process
Oct 04 02:35:10 zabbixhk.localdomain kill[12337]: -s, –signal send specified signal
Oct 04 02:35:10 zabbixhk.localdomain kill[12337]: -q, –queue use sigqueue(2) rather than kill(2)
Oct 04 02:35:10 zabbixhk.localdomain kill[12337]: -p, –pid print pids without signaling them
Oct 04 02:35:10 zabbixhk.localdomain kill[12337]: -l, –list [=] list signal names, or convert one to a name
Oct 04 02:35:10 zabbixhk.localdomain kill[12337]: -L, –table list signal names and numbers
Oct 04 02:35:10 zabbixhk.localdomain kill[12337]: -h, –help display this help and exit
Oct 04 02:35:10 zabbixhk.localdomain kill[12337]: -V, –version output version information and exit
Oct 04 02:35:10 zabbixhk.localdomain kill[12337]: For more details see kill(1).
Oct 04 02:35:10 zabbixhk.localdomain systemd[1]: zabbix-server.service: control process exited, code=exited status=1
[root@zabbixhk ~]#
Hi Ivan,
I think that you having problem starting the zabbix server because of SeLinux, try to disable it using the following command temporary # setenforce 0 and restart the zabbix server. In the case is the issue is Selinux Policy than you have to run this commands :
# setsebool -P httpd_can_network_connect=1
# setsebool -P httpd_can_connect_zabbix=1
# setsebool -P zabbix_can_network=1
# cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit
# semodule -i zabbix_server_setrlimit.pp
Hope you can resolve the problem .
Lotfi,
I was having the same issue and tried the commands about, but still no luck. Getting “Zabbix server is not running: the information may not be current”
Any ideas?
Hi Brian,
Try to run those commands more than once, it should works and check the logs
cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit
# semodule -i zabbix_server_setrlimit.pp
If doesn’t work set the Selinux in permissive mode and start the zabbix server.
Hello, I followed your guide and got problem about Configure DB connection.
It says “The frontend does not match Zabbix database”
How can fix this ?
Hi Tori,
Drop the existing zabbix db that you imported in the step number 3 and recreat it again, it should works.
Hello, thank you for help. But it didnt work. But i change the command
zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz | mysql -uroot -p zabbixdb
to
zcat /usr/share/doc/zabbix-server-mysql-3.4.2/create.sql.gz | mysql -uroot -p zabbixdb
and no more “The frontend does not match Zabbix database” error
You are welcome anytime, subscribe to hour YouTube channel to keep updated
i follwed you tutorial and have the same ptoblem zabbix server is nort running the information displayed may not be current. upon typing command systemctl status zabbix-server Igot following output
systemctl status zabbix-server
● zabbix-server.service – Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2017-11-08 15:31:45 PKT; 26min ago
Process: 79711 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 79718 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 79720 (zabbix_server)
CGroup: /system.slice/zabbix-server.service
└─79720 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
Nov 08 15:31:45 localhost.localdomain systemd[1]: zabbix-server.service: main process exited, code=exited, status=1/FAILURE
Nov 08 15:31:45 localhost.localdomain systemd[1]: Unit zabbix-server.service entered failed state.
Nov 08 15:31:45 localhost.localdomain systemd[1]: zabbix-server.service failed.
Nov 08 15:31:45 localhost.localdomain systemd[1]: Starting Zabbix Server…
Nov 08 15:31:45 localhost.localdomain systemd[1]: PID file /run/zabbix/zabbix_server.pid not readable (yet?) after start.
Nov 08 15:31:45 localhost.localdomain systemd[1]: Started Zabbix Server.
Hi Abeera,
Try to set the SeLinux to permissive mode and retry to start the Zabbix Server. if the problem is Selinux try to execute those commands more than once
# cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit
# semodule -i zabbix_server_setrlimit.pp
it log file says cannot disable core dump…kindly tell me how to disable core dumps
Run those commands:
– Selinux Zabbix Agent
cat /var/log/audit/audit.log | grep zabbix_agentd | grep denied | audit2allow -M zabbix_agent_setrlimit
# semodule -i zabbix_agent_setrlimit.pp
– Selinux Zabbix Server
# cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit
# semodule -i zabbix_server_setrlimit.pp
Finally start the zabbix server and Agent daemon
I fixed it with that link : https://support.zabbix.com/browse/ZBX-12567
Glenn Matthys added a comment – 2017 Aug 23 10:13 – edited
Looks like I had a successful start now. I had to allow the following selinux AVC’s:
allow zabbix_t self:unix_stream_socket connectto;
allow zabbix_t tmp_t:sock_file unlink;
allow zabbix_t tmp_t:sock_file create;
allow zabbix_t tmp_t:sock_file write;
Makes sense.
Vladislavs Sokurenko thanks for the report, we will see what can be done from our side, it could be at least documented.
Oleksiy Zagorskyi I can confirm that these rules are enough. I’ve prepared zabbix_server_add.te file, which contains policies for 2 directories: /tmp and /var/run/zabbix (to be user friendly for older and newest .conf files). Also, a rule for “process setrlimit” included here, which should be included to CentOS 7.4 (as I’ve understood).
To apply it, download and execute:
yum install policycoreutils-python
checkmodule -M -m -o zabbix_server_add.mod zabbix_server_add.te
semodule_package -m zabbix_server_add.mod -o zabbix_server_add.pp
semodule -i zabbix_server_add.pp
//////////////////////////////////
Result
[root@zabbix-srv ~]# systemctl status zabbix-server
● zabbix-server.service – Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: active (running) since mer. 2017-11-22 15:26:08 CET; 19s ago
Process: 1138 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 1447 (zabbix_server)
CGroup: /system.slice/zabbix-server.service
├─1447 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
├─9059 /usr/sbin/zabbix_server: configuration syncer [waiting 60 sec for processes]
├─9061 /usr/sbin/zabbix_server: alerter #1 started
├─9063 /usr/sbin/zabbix_server: alerter #2 started
├─9066 /usr/sbin/zabbix_server: alerter #3 started
├─9067 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]
├─9068 /usr/sbin/zabbix_server: timer #1 [processed 0 triggers, 0 events in 0.000000 sec, 0 maintenances in 0.000000 sec, idle 12 sec]
├─9069 /usr/sbin/zabbix_server: http poller #1 [got 0 values in 0.000426 sec, idle 5 sec]
├─9074 /usr/sbin/zabbix_server: discoverer #1 [processed 0 rules in 0.005849 sec, idle 60 sec]
├─9075 /usr/sbin/zabbix_server: history syncer #1 [synced 0 items in 0.000001 sec, idle 1 sec]
├─9076 /usr/sbin/zabbix_server: history syncer #2 [synced 0 items in 0.000002 sec, idle 1 sec]
├─9078 /usr/sbin/zabbix_server: history syncer #3 [synced 0 items in 0.000002 sec, idle 1 sec]
├─9080 /usr/sbin/zabbix_server: history syncer #4 [synced 0 items in 0.000002 sec, idle 1 sec]
├─9084 /usr/sbin/zabbix_server: escalator #1 [processed 0 escalations in 0.000736 sec, idle 3 sec]
├─9087 /usr/sbin/zabbix_server: proxy poller #1 [exchanged data with 0 proxies in 0.000002 sec, idle 5 sec]
├─9088 /usr/sbin/zabbix_server: self-monitoring [processed data in 0.000009 sec, idle 1 sec]
├─9089 /usr/sbin/zabbix_server: task manager [processed 0 task(s) in 0.000370 sec, idle 5 sec]
├─9091 /usr/sbin/zabbix_server: poller #1 [got 0 values in 0.000002 sec, idle 5 sec]
├─9093 /usr/sbin/zabbix_server: poller #2 [got 0 values in 0.000002 sec, idle 5 sec]
├─9095 /usr/sbin/zabbix_server: poller #3 [got 0 values in 0.000002 sec, idle 5 sec]
├─9098 /usr/sbin/zabbix_server: poller #4 [got 0 values in 0.000003 sec, idle 5 sec]
├─9099 /usr/sbin/zabbix_server: poller #5 [got 0 values in 0.000002 sec, idle 5 sec]
├─9101 /usr/sbin/zabbix_server: unreachable poller #1 [got 0 values in 0.000003 sec, idle 5 sec]
├─9102 /usr/sbin/zabbix_server: trapper #1 [processed data in 0.000000 sec, waiting for connection]
├─9103 /usr/sbin/zabbix_server: trapper #2 [processed data in 0.000000 sec, waiting for connection]
├─9105 /usr/sbin/zabbix_server: trapper #3 [processed data in 0.000000 sec, waiting for connection]
├─9106 /usr/sbin/zabbix_server: trapper #4 [processed data in 0.000000 sec, waiting for connection]
├─9107 /usr/sbin/zabbix_server: trapper #5 [processed data in 0.000000 sec, waiting for connection]
├─9108 /usr/sbin/zabbix_server: icmp pinger #1 [got 0 values in 0.000003 sec, idle 5 sec]
├─9109 /usr/sbin/zabbix_server: alert manager #1 [sent 0, failed 0 alerts, idle 5.088732 sec during 5.088748 sec]
├─9110 /usr/sbin/zabbix_server: preprocessing manager #1 [queued 0, processed 0 values, idle 5.099011 sec during 5.099034 sec]
├─9112 /usr/sbin/zabbix_server: preprocessing worker #1 started
├─9115 /usr/sbin/zabbix_server: preprocessing worker #2 started
└─9120 /usr/sbin/zabbix_server: preprocessing worker #3 started
nov. 22 15:26:07 zabbix-srv systemd[1]: Starting Zabbix Server…
nov. 22 15:26:08 zabbix-srv systemd[1]: Started Zabbix Server.
[root@zabbix-srv ~]# version
-bash: version : commande introuvable
[root@zabbix-srv ~]# uname -a
Linux zabbix-srv 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@zabbix-srv ~]# uname -r
3.10.0-693.5.2.el7.x86_64
I hope it will work for you,
enjoy 🙂
Hello
any suggestions why I’m not able to connect to the db..
Cannot connect to the database.
Details
System error occurred. Please contact Zabbix administrator.
Hi Manpreet,
Are you using a local database ? Make sure that mysql is up and running
Thanks LOTFI for your prompt response…
YES I’m using local database and ran the command same as your instruction with my own username and password.. below is the output of my sql server…
[root@localhost ~]# systemctl status mysqld
Unit mysqld.service could not be found.
[root@localhost ~]# systemctl status mariadb
● mariadb.service – MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2017-11-17 10:48:13 EST; 1min 55s ago
Process: 1037 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 973 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 1036 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─1036 /bin/sh /usr/bin/mysqld_safe –basedir=/usr
└─1223 /usr/libexec/mysqld –basedir=/usr –datadir=/var/lib/mysql –plugin-dir=/usr/lib64/mysql/plugin –log-error=/var/log/mariadb/mariadb.log…
Nov 17 10:48:09 localhost.localdomain systemd[1]: Starting MariaDB database server…
Nov 17 10:48:09 localhost.localdomain mariadb-prepare-db-dir[973]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Nov 17 10:48:10 localhost.localdomain mysqld_safe[1036]: 171117 10:48:10 mysqld_safe Logging to ‘/var/log/mariadb/mariadb.log’.
Nov 17 10:48:10 localhost.localdomain mysqld_safe[1036]: 171117 10:48:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Nov 17 10:48:13 localhost.localdomain systemd[1]: Started MariaDB database server.
Thanks LOTFI for your prompt response…
YES I’m using local database and ran the command same as your instruction with my own username and password.. below is the output of my sql server…
[root@localhost ~]# systemctl status mysqld
Unit mysqld.service could not be found.
[root@localhost ~]# systemctl status mariadb
● mariadb.service – MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2017-11-17 10:48:13 EST; 1min 55s ago
Process: 1037 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 973 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 1036 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─1036 /bin/sh /usr/bin/mysqld_safe –basedir=/usr
└─1223 /usr/libexec/mysqld –basedir=/usr –datadir=/var/lib/mysql –plugin-dir=/usr/lib64/mysql/plugin –log-error=/var/log/mariadb/mariadb.log…
Nov 17 10:48:09 localhost.localdomain systemd[1]: Starting MariaDB database server…
Nov 17 10:48:09 localhost.localdomain mariadb-prepare-db-dir[973]: Database MariaDB is probably initialized in /var/lib/mysql already, nothing is done.
Nov 17 10:48:10 localhost.localdomain mysqld_safe[1036]: 171117 10:48:10 mysqld_safe Logging to ‘/var/log/mariadb/mariadb.log’.
Nov 17 10:48:10 localhost.localdomain mysqld_safe[1036]: 171117 10:48:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Nov 17 10:48:13 localhost.localdomain systemd[1]: Started MariaDB database server.
okay, did you create the zabbix database? did you import the schema using the command zcat ?
in phase of the installation did you set the correct configuration of your database and username ?
YES I did… but even in your instruction.. I havn’t created the db user ?
I just ran the the below command .. IS THIS ENOUGH ?
CREATE DATABASE dbzabbix CHARACTER SET utf8 COLLATE utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON dbzabbix.* TO zabbixuser@localhost IDENTIFIED BY “zabpassword”;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
It’s enough, check the zabbix config file /etc/zabbix/zabbix_server.conf the db parameter access
Try to disable the selinux and the firewalld and try to reconnect
Sorry Sir… still same even I disabled SeLinux and firewall.
Drop the database and recreat it
tried it already…. not sure what I’m missing or doing wrong
Okay, try to connect to the database using the zabbix user locally using mysqld maybe you did something wrong while creating the db
I can connect to it….
[root@localhost ~]# mysql -u zabbixuser -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 175
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| dbzabbix |
+——————–+
2 rows in set (0.00 sec)
MariaDB [(none)]>
Check the tables of the dbzabbix database, if everything is alright check the zabbix config file the database name, user and the password
Do you have teamviewer, could I connect remotely to resolve the problem?
MariaDB [(none)]> show tables from dbzabbix;
Empty set (0.00 sec)
Is this correct ? not sure what should be there.
Hello, I am getting unable to connect to DB as well. I am also seeing Uni Zabbix-server.service entered failed state when i run
: systemctl status zabbix-server
Hi Nathan,
Ithink you having issues with Selinux, you should run those commands more than once until you can start zabbix server daemon
# cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit
# semodule -i zabbix_server_setrlimit.pp
Or set to permessive mode temporally the Selinux using the following command
# setenforce 0
Even when i setenforce 0 it still will not start. any option you can think of?
Hi Nathan,
Could u share the logs of the zabbix server like this we can help u to resolve the problem
HI Lotfi,
i tried mant times i m also getting same issue.
Job for zabbix-server.service failed because a configured resource limit was exceeded. See “systemctl status zabbix-server.service” and “journalctl -xe” for details.
Hi Ram,
Try to execute the following commands:
# setsebool -P httpd_can_network_connect=1
# setsebool -P httpd_can_connect_zabbix=1
# setsebool -P zabbix_can_network=1
# systemctl restart httpd
# yum install policycoreutils-python -y
*********************************************
Execute the following commands and after that start the zabbix-server daemon if doesn’t work execute more than once
# cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit
# semodule -i zabbix_server_setrlimit.pp
After that comands I get this:
[root@localhost ~]# semodule -i zabbix_server_setrlimit.pp
libsemanage.map_file: Unable to open zabbix_server_setrlimit.pp
(No such file or directory).
libsemanage.semanage_direct_install_file: Unable to read file zabbix_server_setrlimit.pp
(No such file or directory).
semodule: Failed on zabbix_server_setrlimit.pp!
Hi,
did u installed the policycoreutils-python?
# yum install policycoreutils-python -y
# cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit
# semodule -i zabbix_server_setrlimit.pp
You can check the steps on the video https://youtu.be/GKBAmtzWI5Y?t=17m7s
Hi, I have de same problem as PAULZ. I installed “policycoreutils-python”.
When I do : cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit this message is displayed : Nothing to do.
Then, when I do : semodule -i zabbix_server_setrlimit.pp the same message is displayed..
Hi chris,
Try to run the command cat /var/log/audit/audit.log | grep zabbix_server | grep denied . If there’s no output mean nothing is denied –> you can procceed with the configuration
Thanks ! But I installed a fresh new CentOS 7 and take all steps from de begging. Great tutorial Lotfi !
We are glad that our tutorial was useful
Hi! I know I’m digging out so old topic, but I just wanted to say thank you to LOFTI. I just installed latest at the moment Zabbix 4.2 on Centos 7, had the same issue. and this is what exactly what helped me:
# setsebool -P httpd_can_network_connect=1
# setsebool -P httpd_can_connect_zabbix=1
# setsebool -P zabbix_can_network=1
# systemctl restart httpd
# yum install policycoreutils-python -y
*********************************************
Execute the following commands and after that start the zabbix-server daemon if doesn’t work execute more than once
# cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit
# semodule -i zabbix_server_setrlimit.pp
So, THANK YOU LOFTI!
Hi Malec,
You are welcome any time, we are so glad to know that our guides are so helfull, please subscribe to our newsletter and our Youtube channel to keep updated.
Hi Lofti , I had Zabbix 3.0 installed and it worked very well. Then update to 3.2 and it also worked. Yesterday I got creative and updated to 3.4, now it does not work. when opening my address http://192.168.1.250/zabbix it shows me the following message: Database error
System error occurred. Please contact Zabbix administrator.
I followed steps of your forum but still I can not solve the problem.
When I consult the zabbix server service I have this error:
● zabbix-server.service – Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2017-11-25 18:57:45 -04; 3s ago
Process: 2402 ExecStop = / bin / kill -SIGTERM $ MAINPID (code = exited, status = 1 / FAILURE)
Process: 16618 ExecStart = / usr / sbin / zabbix_server -c $ CONFFILE (code = exited, status = 0 / SUCCESS)
Main PID: 16620 (zabbix_server)
CGroup: /system.slice/zabbix-server.service
└─16620 / usr / sbin / zabbix_server -c /etc/zabbix/zabbix_server.conf
Nov 25 18:57:45 ZABBIXSRV.localdomain systemd [1]: Starting Zabbix Server …
Nov 25 18:57:45 ZABBIXSRV.localdomain systemd [1]: PID file /run/zabbix/zabbix_server.pid not readable (and … rt.
Nov 25 18:57:45 ZABBIXSRV.localdomain systemd [1]: Started Zabbix Server.
Hint: Some lines were ellipsized, use -l to show in full.
Forgive my English is not my language.
You think you can help me!
My knowledge about Linux Centos or Free Software must be the same as your knowledge of Quantum Physics, that is, 0 match in 2
Hi Juan,
I think that the zabbix server having problem to connect to the database. Could you please forward us using the contact form the steps of upgrading. And the content of zabbix- server
hi Lotfi,,
thankyou for your great tutorial,
I already finish the tutorial until i can open the web dashboard.
but like the others guy,, i found there is a notification that say my zabbix server is not running.
—-
[root@zabbix ~]# systemctl status zabbix-server.service
● zabbix-server.service – Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: deactivating (stop-sigterm) (Result: exit-code) since Wed 2017-11-29 13:36:59 WIB; 40min ago
Main PID: 13330 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/zabbix-server.service
└─13359 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: -a, –all do not restrict the name-to-pid co…sses
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: with the same uid as the present process
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: -s, –signal send specified signal
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: -q, –queue use sigqueue(2) rather than kill(2)
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: -p, –pid print pids without signaling them
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: -l, –list [=] list signal names, or convert one …name
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: -L, –table list signal names and numbers
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: -h, –help display this help and exit
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: -V, –version output version information and exit
Nov 29 13:36:59 zabbix.bercacloud kill[13382]: For more details see kill(1).
Hint: Some lines were ellipsized, use -l to show in full.
—-
then i try to start the service using command : systemctl start zabbix-server.service
but,, no result,, the command just hanged..
what should i do ???
Hi Haris Minanda,
Try to set the selinux in permissive mode and try again.
# setenforce 0
Hi Lotfi,
I’m new to zabbix. I followed your instructions and everything worked perfect. But I need to clarify one thing, when I want to create a new ESXi host and linked to a template (Template Virt VMware ) I no longer see it, instead I can see three of them; Template VM VMware, Template VM VMware Guest and Template VM VMware Hypervisor. Is Template Virt VMware has been deprecated? Your quick response will be greatly appreciated.
Regards,
Jassem Aldulaimi
Hi Jassem,
Sorry for the late answer, it’s not deprecated if u don’t find it u can import it from the zabbix official templates http://www.zabbix.org/wiki/Zabbix_Templates/Official_Templates
Good luck
Hi Lotfi,
Thanks for your prompt reply.
According to the following command (zabbix_server –version) my zabbix server is 3.4.6. Those templates available only for as high as version 3.2. Can I still import them?
Hi Jassem,
Yes of course u can import them according to the official zabbix website honestly we still using the version 3.2.x in our production environment we didn’t yet update to the version 3.4
Hi Lotfi,
If you can, please email practical examples, of items/triggers that you use to monitor your environment and happy with and you think it’s a good practice. Anything to monitor ESXi hots, Virtual Machines (MS OS and Linux Guest), Cisco switches, ASA 5000 series, etc.
For the “Cannot connect database” during the graphical installation be carefull about the zabbix version !
In this document :
[root@zabbix ~]# zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz | mysql -uroot -p zabbixdb
In this case, be sure the version you already installed is 3.4.0.
If you use completion you will have no problem when typing and installing.
Hi Yohann,
Thanks for your comment, we already mentionned that we are installing the zabbix version 3.4 in the top of the topic .If you like our article please subscribe to our Youtube channel.
Hi Lotfi
It’s a great article!!! thank you very much!!!
I read all the comments about the Zabbix-server start service issue…
I followed your detailed YouTube channel and re-run these commands:
[root@zabbix ~]# yum install policycoreutils-python -y
[root@zabbix ~]# cat /var/log/audit/audit.log | grep zabbix_agentd | grep denied | audit2allow -M zabbix_agent_setrlimit
[root@zabbix ~]# semodule -i zabbix_agent_setrlimit.pp
[root@zabbix ~]# cat /var/log/audit/audit.log | grep zabbix_server | grep denied | audit2allow -M zabbix_server_setrlimit
[root@zabbix ~]# semodule -i zabbix_server_setrlimit.pp
[root@zabbix ~]# systemctl start zabbix-server
[root@zabbix ~]# systemctl start zabbix-agent
But still I get this message:
Job for zabbix-server.service failed because a configured resource limit was exceeded. See “systemctl status zabbix-server.service” and “journalctl -xe” for details
This is what I get whaen I run systemctl status Zabbix-server: [root@ZabbiX ~]# systemctl status zabbix-server
â— zabbix-server.service – Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: resources) since Mon 2018-04-23 09:11:37 EDT; 8s ago
Process: 5812 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 2755 (code=exited, status=1/FAILURE)
CGroup: /system.slice/zabbix-server.service
Apr 23 09:11:37 ZabbiX.localdomain systemd[1]: Failed to start Zabbix Server.
Apr 23 09:11:37 ZabbiX.localdomain systemd[1]: Unit zabbix-server.service entered failed state.
Apr 23 09:11:37 ZabbiX.localdomain systemd[1]: zabbix-server.service failed.
Thank you very much
Elyada
Hi,
try to run those commands :
semanage permissive -a zabbix_server_t
semanage permissive -a zabbix_agent_t
if doesn’t work then disable or set to permissive the Selinux using the below command:
sed -i ‘s/^SELINUX=.*/SELINUX=disabled/g’ /etc/sysconfig/selinux && reboot
Hi,
Can you help me this error while installing zabbix-mysql
Error: Package: zabbix-web-mysql-3.4.9-1.el7.noarch (zabbix)
Requires: php-mysql
Available: php-mysql-5.4.16-45.el7.x86_64 (base)
php-mysql = 5.4.16-45.el7
Available: php-mysqlnd-5.4.16-45.el7.x86_64 (base)
php-mysql = 5.4.16-45.el7
Available: php-pecl-mysql-1.0.0-0.8.20151007git294ce3b.el7.remi.7.0.x86_64 (remi-php70)
php-mysql = 1:1.0.0
Available: php-pecl-mysql-1.0.0-0.9.20151007git294ce3b.el7.remi.7.0.x86_64 (remi-php70)
php-mysql = 1:1.0.0
Removing: php-mysqlnd-7.0.27-1.el7.remi.x86_64 (@remi-php70)
Not found
Updated By: php-mysqlnd-7.0.30-1.el7.remi.x86_64 (remi-php70)
Not found
Available: php-mysqlnd-7.0.29-1.el7.remi.x86_64 (remi-php70)
Not found
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest
Hi Ron,
you having problems with the php packages versions, i think you have to remove all the php packages and after that use the follwoing command it will install all the php dependencies packages:
# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get -y
Hi Lofti,
Is there another way to deal with this as I cant remove php package on a live env.
Then you need to skip the broken packages or update the required packages with the conflicts to the php version that you use
ahm – okay – thanks.
Then the zabbix server/agent will work ?
Sorry for keep asking 🙂
I think it should works but I’m not sure . Usually you need to install the same version of the required php packages
Hello Below Error coming .. Tried all stuff but no luck .. do you have any hint
Zabbix server is not running: the information displayed may not be current …
Hi Reveesh,
I think that you’re facing problems with Selinux, try to disable it and check again.