Zabbix installation Configuration
Introduction
Zabbix is a software that monitors various network parameters and server health and integrity. Zabbix uses a flexible notification mechanism that allows you to configure email-based alarms for almost any event. This allows you to quickly report server problems. Based on the stored data, Zabbix provides excellent reporting and data visualization functions. These features make Zabbix an ideal solution for capacity planning.
The new version has reached version 3.4, and it has been written and forgotten to be released by the end of Article 16. Therefore, we will introduce the installation of version 2.4, but there is no difference between the content and the new version.
Prerequisites:
1. Configure time network automatic synchronization reference: http://www.cnblogs.com/chenmh/p/5485829.html
2. Disable selinux
3. Install mysql reference: http://www.cnblogs.com/chenmh/p/5413881.html
Monitoring ip Address: 192.168.1.9
Proxy ip Address: 192.168.1.100
1. monitoring terminal installation1. install php and httpd
yum -y install php httpd
2. Install rpm
Source
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
3.
Install zabbix_server, web, and agent
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get.x86_64
4.
Create a database import table
Create a database
create database zabbix;
Import table structure
Cd/usr/share/doc/zabbix-server-mysql-2.4.8/create/Note: the path here will vary based on the version number mysql-uroot-p zabbix <schema. sqlmysql-uroot-p zabbix <images. sqlmysql-uroot-p zabbix <data. SQL
After MySQL 3.0, these three SQL files are merged into one file. You can use "zcat/usr/share/doc/zabbix-server-mysql/create. SQL .gz | mysql-uzabbix-p zabbix"
Create a monitoring user
grant all privileges on zabbix.* to 'zabbix'@'%' identified by 'zabbix';flush privileges;
Note: it is better to specify the hostname here. Otherwise, the actual machine name will be specified. To avoid unnecessary troubles, the password can be more complex.
5. Server File Configuration
mkdir -p /etc/zabbix/alertscriptsmkdir -p /etc/zabbix/externalscripts
Vim/etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.logPidFile=/var/run/zabbix/zabbix_server.pidDBHost=192.168.1.9DBName=zabbixDBUser=zabbixDBPassword=zabbixDBSocket=/tmp/mysql.sockSNMPTrapperFile=/var/log/snmptt/snmptt.logAlertScriptsPath=/etc/zabbix/alertscriptsExternalScripts=/etc/zabbix/externalscripts
Timeout=20
Note: The DBHost, DBName, DBUser, and DBPassword must be consistent with the monitoring user created earlier. DBHost uses an IP address. Unless the host name specified by the monitoring user is the server name, the IP address is used for unnecessary trouble.
6. Configure Service Startup
Add boot item
chkconfig --add zabbix-serverchkconfig zabbix-server on
Start zabbix-server
service zabbix-server restart
7. Enable the firewall port
vim /etc/sysconfig/iptables
Ii. web-side configuration1. service configuration
Start httpd first
service httpd restart
Open your browser and enter http: // ip/zabbix.
This step must ensure that all options are normal. These parameters may need to be modified. Modify the file/etc/php. ini.
date.timezone=Asia/Shanghaimemory_limit=128Mpost_max_size=16Mmax_execution_time=300max_input_time=300session.auto_start = 0
If other related parameters are found to be abnormal, you can directly go to/etc/php. search for this parameter in the INI file and modify it according to the required value (generally, you only need to modify the date here. timezone)
Note: If you have modified the/etc/php. ini parameter, restart the httpd service.
The database connection used here is the monitoring user created previously to ensure that the test connection is normal.
The connection information related to the database configuration will eventually be written to the file "/etc/zabbix/web/zabbix. conf. php"
After configuration, a web file "/etc/httpd/conf. d/zabbix. conf" is generated"
2. Chinese zabbix
Vim/usr/share/zabbix/include/locales. inc. php modify the 55th line of code to (this step is usually normal and does not need to be modified)
'zh_CN' => ['name' => _('Chinese (zh_CN)'), 'display' => true]
Find "" in the "C: \ windows \ Fonts \" directory of the current Windows computer and rename msyh. put ttf in the directory "/usr/share/zabbix/fonts /".
Modify file
sed -i "s/graphfont/msyh/g" /usr/share/zabbix/include/defines.inc.php
Iii. linux Agent installation
Agent monitoring must be installed on the monitoring server. The linux agent is installed on the monitoring server as follows.
1. Install rpm
Source
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
2.
Install zabbix_agent
yum install zabbix-agent zabbix-sender.x86_64
3. Configuration File
PidFile=/var/run/zabbix/zabbix_agentd.pidLogFile=/var/log/zabbix/zabbix_agentd.logLogFileSize=0Server=192.168.1.9#ServerActive=192.168.1.9Hostname=192.168.1.100Include=/etc/zabbix/zabbix_agentd.d/
Timeout=20
Server: monitoring IP Address
ServerActive
Hostname: proxy IP Address
4. Monitor mysql
To monitor mysql, create the ". my. cnf" file in the/etc/zabbix directory on the proxy.
[mysql]host = localhostuser = zabbix_agentpassword = zabbix_agent[mysqladmin]host = localhostuser = zabbix_agentpassword = zabbix_agent
Note: You must create a zabbix_agent user in mysql.
grant all privileges on zabbix.* to 'zabbix_agent'@'localhost' identified by 'zabbix_agent';flush privileges;
4. Install Windows proxy
Download the windows agent pressure package and decompress it to the C: \ zabbix directory. Then, create a log folder under the C: \ zabbix directory.
1. Configuration File
Modify C: \ zabbix \ conf \ zabbix_agentd.win.conf
LogFile=C:\zabbix\log\zabbix_agentd.logServer=192.168.1.9#ServerActive=192.168.1.9Hostname=192.168.1.100
Timeout=20
2. Add a service
C:\zabbix\bin\win64\zabbix_agentd.exe -c C:\zabbix\conf\zabbix_agentd.win.conf -i
V. Others
1. zabbix_get
Run zabbix_get on the monitoring terminal to check the communication status of the agent, and 1 is returned. Otherwise, check whether the agent is started and whether the firewall is blocked.
zabbix_get -s 192.168.137.100 -p 10050 -k 'agent.ping'
2. Restart the service
1. monitoring end
service httpd restartservice zabbix-server restart
2. Proxy
service zabbix-agent restart
3. Modify the Server IP Address
The zabbix server must modify the IP address as follows:
/etc/sysconfig/network-scripts/zabbix/zabbix_server.confzabbix/zabbix_agentd.confzabbix/web/zabbix.conf.php/etc/hostsservice network restartservice zabbix-server restart service zabbix-agent restart
4. Export windows performance monitor parameters
typeperf -q > D:\counters.txt typeperf -qx > D:\counters.txt
Summary
During the configuration process, you must pay attention to selinux and the impact of the firewall. You can add the port number to the firewall: 10051 proxy port 10050 on the monitoring end; if the configuration file and related parameters are modified on both the monitoring and Agent end, remember to restart the service. Otherwise, the Service may become unavailable.
Note: Author: pursuer. chen Blog: http://www.cnblogs.com/chenmh All essays on this site are original. You are welcome to repost them. However, you must indicate the source of the article and clearly give the link at the beginning of the article. Welcome to discussion |