Zabbix deployment (deployment / monitoring side / monitored side on Linux)
First, a brief introduction to the monitoring system
(1) cacti: strong data storage capacity and poor alarm performance
(2) nagios: the alarm performance is poor, and there is only a simple section to judge whether the data length is within a reasonable range, which is stored in memory. For example, when continuously sampled data is stored, the alarm will be given if the data is not within a reasonable range for three consecutive times.
(3) zabbix: combining the advantages of the above two tools, it can not only store data, but also alarm.
II. Zabbix characteristics
(1) data sampling: collect the data of the monitored host through snmp, ssh, telnet, agent, ipmi, jmx and other channels. You can customize the detection mechanism and the time interval
(2) Real-time drawing: display, read data drawing, support graph,map,screen, slide show (slide show)
(3) alarm: (upgrade the alarm and upload things that cannot be solved within a specified period of time)
(4) data storage: databases include mysql,pgsql, time series database, etc.
III. Program composition
(1) zabbix_server: server daemon
(2) daemon on zabbix_agented:agent
(3) zabbix_proxy: proxy server (optional, distributed only)
(4) zabbix_get: command line tool for manual test data acquisition
(5) zabbix_sender: a command-line tool that runs on the agent side and manually sends data to the server side
(6) zabbixjavagateway:java gateway
4. Zabbix deployment (monitoring side)
(1) zabbix depends on database configuration
① yum install mariadb-server
② vim / etc/my.cnf, add under [mysqld_safe]
Skip_name_resolve=oninnodb_file_per_table=on
③ systemctl start mariadb.service, ss-tnl
④ create database: CREATE DATABASE zabbix CHARSET utf8
⑤ authorizes an ordinary user to (access it remotely or locally): GRANT ALL ON zabbix.* TO zbxuser@'192.168.%.%' IDENTIFIED BY & apos;zbxpass'; I set it to be remote, and the local one is 127.0.0.1
⑥ FLUSH PRIVILEGES
⑦ exit
(2) configure server components
① installation server: yum install zabbix-server-mysql zabbix-get
② install webGUI:yum install zabbix-web zabbix-web-mysql
③ installs the Agent side (you can monitor yourself): yum install zabbix-agent zabbix-sender
④ zabbix server database initialization: (import create.sql into database)
Cd / usr/share/doc/zabbix-server-mysql-3.0.7/gzip-d creat.sql.gzmysql-h292.168.1.108-uzbxuser-p zabbix < create.sql
⑤ mysql; use zabbix; SHOW TABLES; View
(3) modify the server configuration file: / etc/zabbix/zabbix_server.conf (backup first)
① SourceIP: if there is more than one IP, enable one source IP and the IP authorized by the other party
② DBHost: database service address
③ DBname: same as the one we created
④ DBuser: same as the one we created
⑤ DBpassword: we customized
⑥ DBSocket: if database and server are on the same host, it will be changed. If not, it will be fine.
⑦ startup: systemctl start zabbix-server, note that if the centos is version 7. 0 or 7. 1, the trousers package should be updated.
(4) configure other matters
① installs php-mysql (rpm-Q php-mysql), which has been installed before
② configure zabbix-web, configure php time zone assignment: vim / etc/httpd/conf.d/zabbix.conf, php_value date.timezone Asia/Shanghai
③ starts httpd:systemctl start httpd.service
④ access: 192.168.1.108/zabbix
All the ok on the ⑤ side are ok:
⑥ went through the last few steps. All right.
5. Zabbix deployment (monitored side, based on agent)
① installation: yum install zabbix-agent zabbix-sender-y
② edit configuration file cd / etc/zabbix, cp zabbix_agentd.conf {, .bak}
③ vim zabbix_agentd.conf
Passive monitoring, agent waits for server to request data under passive checks related what active monitoring can be authorized by Server=192.168.1.108 separated by commas: the monitored end actively sends the data to the normal host name of the ServerActive=192.168.1.108Hostname= server under the server active checks related.
④ startup service: systemctl start zabbix-agent.service
Article source: Ma GE Education
Official Wechat: Ma GE linux operation and maintenance staff
Technology Exchange Group: 485374463