Zabbix server installation and deployment of enterprise-level monitoring software zabbix
Zabbix has been applied online for more than half a year. I want to write down my experiences on zabbix's use in the production environment and some experiences, so that you can learn from them without detours!
Environment:
Server: CentOS6.3 _ X86.64
Zabbix: zabbix-2.0.8.tar
Zabbix_agents: zabbix_agents_2.0.8.linux2_6.amd64.tar
Server naming rules:
Zabbix-Server: 192.168.100.239
Zabbix-Agent01: 192.168.100.240
Installation Planning Process
1. Set the name of your server according to the naming rules of the server;
2. Disable the firewall. You can enable the Firewall Based on the configured zabbix Server port and the Agents port.
3. Disable Selinux
4. Install LAMP/LNMP
5. Install zabbixServer/Agetns
5. 1. Install ZabbixServer ----------------- The document has been written successfully.
. Configure zabbixServer ------------- successfully written in the document on the web page
5. 3. Install zabbixAgents ----------------- The document has been written successfully.
6. configure a custom monitoring template
7. Add the first agent for Zabbix Configuration
7.1.1. Add the first linux agent to configure zabbix --------------- the document has been written
7.1.2. Add the first windows agent to configure zabbix ----------------
7.1.3. Configure and create a topology ----------------- a PDF file is required for successful creation, which is relatively simple.
7.1.4. Create a filter topology ----------------- a PDF file is required to be successfully created, which is relatively simple.
7.1.5. For the added agents, customize the server selection template.
7.1.6.zabbix custom add monitoring port, Service
8. Configure the zabbix trigger and Topology
9. Configure Zabbix email Alarm Mechanism
10. Configure zabbix SMS alert
11. zabbbix standardization and process-based
12. zabbix's Asset Management report audit function
Implement deployment;
Deploy and build ZabbixServer
01. Naming server rules
[Root @ localhost ~] # Hostname
Zabbix-Server
[Root @ localhost ~] # Cat/etc/sysconfig/network
NETWORKING = yes
HOSTNAME = Zabbix-Server
[Root @ localhost ~] #
02. Disable firewall and Selinux
[Root @ localhost ~] #/Etc/rc. d/init. d/iptables stop
Iptables: Flushing firewall rules: [OK]
Iptables: Setting chains to policy ACCEPT: filter [OK]
Iptables: Unloading modules: [OK]
[Root @ localhost ~] # Setenforce 0
Setenforce: SELinux is disabled
[Root @ localhost ~] #
03. Install the LAMP environment,
You must note that the relevant dependency packages are installed before installation. In this project, we use yum to install the configurations. If you have special requirements, you can use the source code for installation and deployment.
To install LAMP directly using YUM, you need to install gcc-c ++.
Yum-y install zlib-devel glibc-devel libxml2 libxml2-devel freetype-devel
Yum-y install mysql-server php-mysql-devel php-xmlrpc php-xml php-odbc php-gd php-bcmath php-mbstring httpd
Install SNMP in YUM
Yum-y install net-snmp-devel curl-devel perl-DBI
04. test if LAMP is normal
4.1.1. Modify vim/etc/httpd/conf/httpd. conf
You can make a virtual directory or directly configure it. here we can simply make it the default one.
4.1.2. Write a php applet to test whether php is normal.
The directory is under/var/www/html /.
4.1.3. Start the service
/Etc/rc. d/init. d/httpd start
/Etc/rc. d/init. d/mysqld start
Then open IE to make it work.
05. Start zabbix Service Installation
05. 1. Create zabbix user Transfer
Useradd-s/sbin/nologin zabbix
05. 2. Start to install the configuration
[Root @ Zabbix-Server home] # tar xf zabbix-2.0.8.tar.gz
[Root @ Zabbix-Server home] # cd zabbix-2.0.8
[Root @ Zabbix-Server zabbix-2.0.8] # mkdir/usr/local/zabbix
[Root @ Zabbix-Server zabbix-2.0.8] # mysqladmin-uroot password 123.com
05. 3. Create a mysql database and authorize a database
[Root @ Zabbix-Server zabbix-2.0.8] # mysql-uroot-p123.com
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 3
Server version: 5.1.61 Source distribution
Copyright (c) 2000,201 1, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql> create database zabbix;
Query OK, 1 row affected (0.00 sec)
Mysql> grant all privileges on zabbix. * to 'zabbix' @ localhost identified by '2017. com ';
Query OK, 0 rows affected (0.00 sec)
Mysql> grant all privileges on zabbix. * to 'zabbix' @ 192.168.100.239 identified by '2017. com ';
Query OK, 0 rows affected (0.00 sec)
Mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
Mysql> exit
05. 3. Import zabbix Database
[Root @ Zabbix-Server zabbix-2.0.8] # mysql-uroot-p123.com zabbix [Root @ Zabbix-Server zabbix-2.0.8] # mysql-uroot -p123.com zabbix [Root @ Zabbix-Server zabbix-2.0.8] # mysql-uroot-p123.com zabbix
05. 4. Install zabbix Server
[Root @ Zabbix-Server zabbix-2.0.8] #. /configure-prefix =/usr/local/zabbix/-enable-server-enable-proxy-enable-agent-with-mysql-with-net-snmp-with-libcurl
[Root @ Zabbix-Server zabbix-2.0.8] # make & make install
05. 5. modify the configuration file vim/etc/services to add
Zabbix-agent 10050/tcp # Zabbix Agent
Zabbix-agent 10050/udp # Zabbix Agent
Zabbix-trapper 10051/tcp # Zabbix Trapper
Zabbix-trapper 10051/udp # Zabbix Trapper
05. 6. modify the configuration file of zabbix Server and the User password of the database.
[Root @ Zabbix-Server zabbix-2.0.8] # vim/usr/local/zabbix/etc/zabbix_server.conf
Replace DBUser = root with DBUser = zabbix.
Add DBPassword or remove the comment # DBPassword
DBPassword = 123.com
05. 7. Configure the startup script and grant the execution permission;
[Root @ Zabbix-Server zabbix-2.0.8] # cp misc/init. d/Fedora/core/zabbix _ */etc/init. d/
[Root @ Zabbix-Server zabbix-2.0.8] # sed-I's/BASEDIR =\/ usr \/local \/zabbix/'/etc/ init. d/zabbix_server
[Root @ Zabbix-Server zabbix-2.0.8] # sed-I's/BASEDIR =\/ usr \/local \/zabbix/'/etc/ init. d/zabbix_agentd
[Root @ Zabbix-Server zabbix-2.0.8] # chmod + x/etc/init. d/zabbix_server
[Root @ Zabbix-Server zabbix-2.0.8] # chmod + x/etc/init. d/zabbix_agentd
[Root @ Zabbix-Server zabbix-2.0.8] #
05. 8. Start zabbix
[Root @ Zabbix-Server zabbix-2.0.8] #/etc/rc. d/init. d/zabbix_server start
Starting zabbix_server: [OK]
[Root @ Zabbix-Server zabbix-2.0.8] #
05.9.configure zabbixServer on the web page
[Root @ Zabbix-Server zabbix-2.0.8] # cp-a frontends/php/*/var/www/html/
Cp: overwrite '/var/www/html/index. php '? Y
[Root @ Zabbix-Server zabbix-2.0.8] #/etc/rc. d/init. d/httpd restart
Stopping httpd: [OK]
Starting httpd: [OK]
[Root @ Zabbix-Server zabbix-2.0.8] #
05. 10. Modify the php. ini file
Handle Time Zone errors in zabbixweb
[Root @ Zabbix-Server zabbix-2.0.8] # sed-I's/^ post_max_size =./Post_max_size = 16 M/'/etc/php. ini
[Root @ Zabbix-Server zabbix-2.0.8] # sed-I's/max_execution_time =./Max_execution_time = 300/'/etc/php. ini
[Root @ Zabbix-Server zabbix-2.0.8] # sed-n's/^ max_input_time =./Max_input_time = 300/gp '/etc/php. ini
Max_input_time= 300
[Root @ Zabbix-Server zabbix-2.0.8] # sed-I's/^ max_input_time =./Max_input_time = 300/'/etc/php. ini
[Root @ Zabbix-Server zabbix-2.0.8] #
If the above error is reported, change the file and add ini_set ('date. timezone ', 'Asia/Shanghai') to the start line of the Code ');
Add the following line: About 22 rows in the configuration file
Vi/var/www/html/zabbix/include/page_header.php
Ini_set ('date. timezone ', 'Asia/Shanghai ');
05. 11. Restart the service
[Root @ Zabbix-Server zabbix-2.0.8] #/etc/rc. d/init. d/httpd restart
Stopping httpd: [OK]
Starting httpd: [OK]
[Root @ Zabbix-Server zabbix-2.0.8] #
[Root @ Zabbix-Server ~] #/Etc/rc. d/init. d/zabbix_server restart
Shutting down zabbix_server: [OK]
Starting zabbix_server: [OK]
[Root @ Zabbix-Server ~] #/Etc/rc. d/init. d/zabbix_agentd restart
Shutting down zabbix_agentd: [FAILED]
Starting zabbix_agentd: [OK]
[Root @ Zabbix-Server ~] #
Set to start the service
[Root @ Zabbix-Server ~] # Echo "/etc/rc. d/init. d/zabbix_agentd">/etc/rc. local
[Root @ Zabbix-Server ~] # Echo "/etc/rc. d/init. d/zabbix_server">/etc/rc. local
05. 12. Create a custom template
You can add a Template for Zabbix as a link. For example, a Template exists. For example, Template OS Linux
We can create a new Template to reference the Template OS Linux Template ~~~~~
Then we can customize our monitoring options and define the images we selected.
For more information about the web interface configuration, see the next article <configure zabbix Services web in the enterprise-level monitoring software zabbix setup and deployment>
ZABBIX details: click here
ZABBIX: click here
Install and deploy the distributed monitoring system Zabbix 2.06
Install and deploy the distributed monitoring system Zabbix 2.06
Install and deploy Zabbix in CentOS 6.3
Zabbix distributed monitoring system practice
Under CentOS 6.3, Zabbix monitors apache server-status
Monitoring MySQL database Parameters Using Zabbix in CentOS 6.3