zabbix 3.4 安装记录
zabbix
--3.4
https://blog.51cto.com/hwg1227/2126342
https://blog.51cto.com/10981246/2087541
--3.0
https://www.cnblogs.com/linuxk/p/9450616.html
https://www.cnblogs.com/liang-wei/p/5848923.html
鸟哥2.x:
http://blog.chinaunix.net/uid-25266990-id-3380929.html
官网手册:
https://www.zabbix.com/documentation/3.4/zh/manual
1,安装ntp
时间同步:#yum install -y ntpdate
echo '* * * * * /usr/sbin/ntpdate ntp1.aliyun.com &>/etc/null' >>/var/spool/cron/root
2,安装部署zabbix3.0LTS
zabbix_server -V
zabbix_server (Zabbix) 3.4.15
zabbix3.0 安装
初始化数据库
mysql_secure_installation
创建zabbix 普通用户
https://www.cnblogs.com/xujishou/p/6306765.html
创建用户同时授权
mysql> grant all privileges on mq.* to test@localhost identified by '1234';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
PS:必须执行flush privileges;
否则登录时提示:ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: YES )
-------------------
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> quit;
Bye
-----创建zabbix用户并授权107
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> select user,host from mysql.user;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@"%" identified by 'zabbix';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> select user,host from mysql.user;
+--------+-------------+
| user | host |
+--------+-------------+
| root | % |
| zabbix | % |
| root | 127.0.0.1 |
| rep | 192.168.1.% |
| root | ::1 |
+--------+-------------+
------108
[root@zizhen ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.15/
[root@zizhen zabbix-server-mysql-3.4.15]# zcat create.sql.gz | mysql -h 192.168.1.107 -uzabbix -pzabbix;
ERROR 1046 (3D000) at line 1: No database selected
[root@zizhen zabbix-server-mysql-3.4.15]# zcat create.sql.gz | mysql -h 192.168.1.107 -P 3306 -uzabbix -pzabbix;
ERROR 1046 (3D000) at line 1: No database selected
[root@zizhen zabbix-server-mysql-3.4.15]# zcat create.sql.gz | mysql -h 192.168.1.107 -uzabbix -pzabbix -D zabbix;
[root@zizhen zabbix-server-mysql-3.4.15]#
-----
zabbix-server 监听端口10051
zabbix-agent 监听端口10050
MariaDB 端口3306
浏览器访问,并进行安装 http://192.168.203.131/zabbix/
登录最新版Zabbix3.4 默认用户Admin 默认密码zabbix
报错: ip 地址修改后,需要修改:
1,修改配置文件
#cat /etc/zabbix/zabbix_server.conf |grep -v "#" | grep -v "^$"
DBHost=192.168.203.131
#vim /etc/zabbix/web/zabbix.conf.php
$DB['SERVER'] = '192.168.203.131';
2,重新启动服务:
#systemctl restart zabbix-server
#systemctl restart httpd
#########zabbix-agent-4.0安装##########
[root@test opt]# rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
yum install -y zabbix-agent
vim /etc/zabbix/zabbix_agentd.conf
[root@client1 ~]# cat /etc/zabbix/zabbix_agentd.conf |grep -v "#" |grep -v "^$"
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.236.132
ServerActive=192.168.236.132
Hostname=client1
Include=/etc/zabbix/zabbix_agentd.d/*.conf