I. This series is divided into 6 parts
1.Centos 7.0 installation of Zabbix Server server and the addition of monitoring host
2.Centos 6.5 Installation of Zabbix server server and the addition of monitoring host
The Discover function of 3.zabbix Server enables the automatic addition of Zabbix agent in large quantities and links to the specified template
e-mail alarm of 4.zabbix alarm mode
Alarm of the public number of the 5.zabbix alarm mode
6.zabbix Server-side optimization (resolves MySQL performance degradation, and Zabbix runs slowly)
Two. Introduction of Zabbix Server
Zabbix (Zæbix) is an enterprise-class open source solution that provides distributed system monitoring and network monitoring capabilities based on a web interface. Zabbix can monitor various network parameters, ensure the safe operation of the server system, and provide a flexible notification mechanism to enable system administrators to quickly locate/resolve various problems.
The Zabbix monitoring server consists of 2 parts, Zabbix Server and the optional Component Zabbix Agent.
Zabbix server can be used Snmp,zabbix agent,ping, port monitoring and other methods to provide remote server/network status monitoring, data collection and other functions, it can run in Linux,solaris,hp-ux,aix,free BSD, Open Bsd,os x and other platforms.
Two. Introduction to the basic environment
1. System:CentOS Linux release 7.1.1503 (Core)
2. Compiling the Environment: "Deveolpment Tools"
3.zabbix-server:ip:192.168.1.125 agent:192.168.1.128 (Linux)
Three. Zabbix server-side operation
1. Install the zabbix-server and the required MySQL components, zabbix-agent
[[email protected] ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
[[email protected] ~]# yum install zabbix-server-mysql zabbix-web-mysql -y
[[email protected] ~]# yum install zabbix-agent -y
2. Since the CentOS 7 default database was changed by MARIADB, after Oracle acquired MySQL, the father of MySQL wrote the database again. This environment requires MySQL, so download the MySQL source below and install MySQL. In addition, MySQL installed, root no password, you can directly login, follow-up if you need to change the password to log on to the database modification, or run mysql_secure_installation initialization tool
[[email protected] ~]# yum install wget -y
[[email protected] ~]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
[[email protected] ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
[[email protected] ~]# yum install mysql-community-server -y
[[email protected] ~]# service mysqld start #or systemctl start mysqld.service
[[email protected] ~]# mysql -uroot
Create the Zabbix database and authorize the Zabbix user, and set the Zabbix user login password to Zabbix
[[email protected] ~]# mysql -uroot
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;
mysql> quit;
Enter the directory imported by the Zabbix database script to import the library data into the Zabbix database.
[[email protected] ~]# cd /usr/share/doc/zabbix-server-mysql-3.0.1/
[[email protected] ~]# zcat create.sql.gz | mysql -uroot zabbix
3. Modify the Zabbix-server configuration file. The default path is:/etc/zabbix/zabbix_server.conf, modified as follows. or backup the original file, the following content directly replace the original content, but the subsequent changes to add a bit more trouble. (Note: Here you only need to modify 4, also can, red bold place)
[[email protected] ~]# grep -v ‘^#‘ /etc/zabbix/zabbix_server.conf | grep -v ‘^$‘
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
StartPollers=10
StartPollersUnreachable=5
StartTrappers=5
StartPingers=1
StartDiscoverers=1
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
HousekeepingFrequency=1
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
After the modification is complete, restart the Zabbix-server service
[Email protected] ~]# systemctl restart Zabbix-server
Issue 1: If a startup failure occurs, as follows
[Email protected] ~]# systemctl start zabbix-for"systemctl Status Zabbix-server.service"journalctl-xe " for details.
Workaround: First check if SELinux is off, shut down, and install the following two software. Start the Zabbix-server service again to start the success.
Yum Install trousers-yuminstall gnutls-y
4. Modify the PHP configuration file below, and restart httpd after the modification is completed.
sed " s/, Date.timezone =/date.timezone =asia/shanghai/g "/etc/php.ini [Email protected] ~]# vim/etc/httpd/conf.d/zabbix.conf
<IfModule mod_php5.c> 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 Asia/Shang </IfModule>
~]# systemctl Restart httpd
5. Add the service to the boot entry
[[email protected] ~] # systemctl start zabbix-agent # It turned out that the zabbix-agent service was not started.
[[email protected] ~] # systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[[email protected] ~] # systemctl enable zabbix-server
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
[[email protected] ~] # systemctl enable zabbix-agent
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
6. No, now you can go to the client to access the Web Installation page, Http://192.168.1.125/zabbix. (If you can't access the site, look at the server side of the firewall, Systemctl stop FIREWALLD) The following steps are not necessary. Follow the prompts to proceed step by step.
Installation and monitoring of the Zabbix server server installed under Centos 7.0 join (1)