https://www.zabbix.com

4.png

[root@monitor ~]# yum install -y epel-release
[root@monitor ~]# rpm -ivh https://mirror.webtatic.com/yum/el6/latest.rpm

[root@monitor ~]# yum install -y httpd php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 \
php56w-devel.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 \
php56w-bcmath.x86_64 php56w-xml.x86_64 php56w-mysqlnd.x86_64 php56w-pdo.x86_64

[root@monitor ~]# php -v
PHP 5.6.40 (cli) (built: Jan 12 2019 09:19:57) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

[root@monitor ~]# vi /etc/httpd/conf/httpd.conf 
ServerName 192.168.40.37:80

[root@monitor ~]# vi /etc/php.ini 
date.timezone = Asia/Shanghai
max_execution_time = 300  
max_input_time = 300
post_max_size = 32M
memory_limit = 128M
mbstring.func_overload = off
always_populate_raw_post_data = -1

[root@monitor ~]# rpm -ivh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
[root@monitor ~]# yum install -y mysql-community-server 

[root@monitor ~]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character-set-server = utf8
innodb_buffer_pool_size = 2G
innodb_buffer_pool_instances = 2
innodb_log_file_size = 256M
innodb_log_files_in_group = 3
innodb_log_buffer_size = 16M
innodb_undo_logs= 128
innodb_undo_tablespaces = 3
innodb_data_file_path = ibdata1:1024M:autoextend

[root@monitor ~]# service mysqld start
[root@monitor ~]# service mysqld status
httpd (pid  21919) is running...
[root@monitor ~]# /usr/bin/mysql_secure_installation

[root@monitor ~]# mysql -uroot -pabcd.1234
mysql> create database zabbix default character set utf8;
Query OK, 1 row affected (0.05 sec)

mysql> grant all on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';
Query OK, 0 rows affected (0.10 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

[root@monitor ~]# yum install -y net-snmp net-snmp-utils net-snmp-devel

[root@monitor ~]# tar zxvf zabbix-4.2.1.tar.gz 
[root@monitor ~]# cd zabbix-4.2.1
[root@monitor zabbix-4.2.1]# ./configure --enable-server --enable-agent --with-mysql \
--with-net-snmp --with-libcurl --with-libxml2
[root@monitor zabbix-4.2.1]# make install

[root@monitor zabbix-4.2.1]# mysql -uroot -p zabbix < database/mysql/schema.sql
[root@monitor zabbix-4.2.1]# mysql -uroot -p zabbix < database/mysql/images.sql
[root@monitor zabbix-4.2.1]# mysql -uroot -p zabbix < database/mysql/data.sql
[root@monitor zabbix-4.2.1]# cp misc/init.d/fedora/core/zabbix_* /etc/init.d/
[root@monitor zabbix-4.2.1]# cp -r frontends/php /var/www/html/zabbix

[root@monitor ~]# vi /usr/local/etc/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

[root@monitor ~]# service zabbix_server start
Starting zabbix_server:                                    [  OK  ]
[root@monitor ~]# netstat -tupln |grep zabbix_server
tcp        0      0 0.0.0.0:10051        0.0.0.0:*        LISTEN      16927/zabbix_server 

[root@monitor ~]# chkconfig --add zabbix_agentd
[root@monitor ~]# service zabbix_agentd start
Starting zabbix_agentd:                                    [  OK  ]
[root@monitor ~]# netstat -tupln |grep zabbix_agentd
tcp        0      0 0.0.0.0:10050        0.0.0.0:*        LISTEN      16999/zabbix_agentd

访问地址:http://192.168.40.37/zabbix        用户名:admin        默认密码:zabbix

1.png

2.png

3.png

4.png