Installing and Configuring Zabbix 2.4.5 on Debian 8 and RHEL/CentOS 7
Step 8: Configure Zabbix Server
16. On this step open zabbix server configuration file for editing by issuing the following command:
# nano /usr/local/etc/zabbix_server.conf
Once the file is opened for editing search and replace the following values accordingly:
ListenPort=10051 LogFile=/var/log/zabbix_server.log DBHost=localhost ## Replace with the IP of the remote database in case MySQL server is located on a different host DBName=zabbix ## Use the name of the Zabbix MySQL database DBUser =zabbix ## Use the name of the Zabbix MySQL database User DBPassword=password ## Zabbix MYSQL database password DBSocket=/var/run/mysqld/mysqld.sock DBPort=3306
17. As the configuration file of the Zabbix server suggests you need to create the log file and add permissions to Zabbix server to write the log by issuing the following commands:
# touch /var/log/zabbix_server.log # chmod 775 /var/log/zabbix_server.log # chgrp zabbix /var/log/zabbix_server.log
18. Finally, after all the server configurations are in place, start Zabbix Server and Agent (to collect data about localhost) by issuing the following commands:
# /usr/local/sbin/zabbix_server # /usr/local/sbin/zabbix_agentd # /usr/local/sbin/zabbix_agent
You can get the status of the Zabbix daemons and their listening ports by running netstat command.
# netstat -tulpn
Step 9: Install Zabbix Web Frontend Interface
19. Now it’s time to install Zabbix Server Frontend web interface. In order to accomplish this step open a browser and navigate to your server IP Address using HTTP or HTTPS protocol and the welcome screen should appear. Hit the Next button to move forward.
http://192.168.1.221/setup.php OR https://192.168.1.221/setup.php
20. After a series of checks, if all pre-requires values are satisfied, hit the Next button to proceed further.
21. On the next step provide the settings for MySQL database (supply the same values as above on step 16), hit the Test connection button to test MySQL connectivity and move to the step by pressing the Next button.
22. Next, supply the Host (or IP Address) and the Port of the Zabbix server (use the host localhost and the port 10051 because zabbix server is configured to run on the same host as the zabbix frontend web interface in this tutorial) and a Name for Zabbix frontend installation. When you’re done hit Next to continue.
23. Next, check all the configurations parameters, enter command line and issue the following command to grant zabbix permissions to write the apache web configuration file in conf directory.
Then switch back to web interface and hit Next button to write zabbix configuration file.
# chown -R www-data /var/www/html/conf/ [on Debian 8] # chown -R apache /var/www/html/conf/ [on RHEL/CentOS 7]
24. After the configuration file has been written, hit Finish button to complete the installation process and enter command line to revert changes made to zabbix conf directory.
# chown -R root /var/www/html/conf/
25. Now you can log in to Zabbix web interface using the default credentials:
Username: admin Password: zabbix
26. In order to start Zabbix daemons after system reboot, open /etc/rc.local file for editing and add the following lines before exit 0 statement:
# /usr/local/sbin/zabbix_agentd # /usr/local/sbin/zabbix_agent # /usr/local/sbin/zabbix_server
That’all! On the next series concerning Zabbix monitoring system will discuss how to setup the server further using the web interface and how to install and configure Zabbix agents on different Linux distributions or even Windows systems.