千家信息网

【Zabbix4.2学习笔记】1、CentOS7.5安装zabbix4.2

发表于:2024-11-14 作者:千家信息网编辑
千家信息网最后更新 2024年11月14日,1、关闭防火墙和selinux#systemctl stop firewalld #vim /etc/selinux/configSELINUX=permissive#setenforce 02、添加
千家信息网最后更新 2024年11月14日【Zabbix4.2学习笔记】1、CentOS7.5安装zabbix4.2

1、关闭防火墙和selinux

#systemctl stop firewalld #vim /etc/selinux/configSELINUX=permissive#setenforce 0

2、添加zabbix存储库

rpm -Uvh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm

3、安装zabbix-server-mysql和zabbix-web-mysql

# yum install -y zabbix-server-mysql zabbix-web-mysql# yum install zabbix-proxy-mysql -y

安装zabbix-agent客户端

# yum install zabbix-agent -y设置开机自启动# systemctl start zabbix-agent# chkconfig zabbix-agent on

4、安装并且启动mysql5.6及初始化数据库信息

# rpm -U vh http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm# yum install -y mysql-community-server# systemctl start mysqld# chkconfig mysqld on# mysql_secure_installation

5、创建zabbix数据库,创建zabbix账号

# mysql -uroot -p创建一个zabbix库并设置为utf8的字符编码格式mysql> create database zabbix character set utf8 collate utf8_bin;创建账户并且授权设置密码mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';刷新mysql> flush privileges;

6、导入默认的zabbix数据库信息

# zcat /usr/share/doc/zabbix-server-mysql-4.2.0/create.sql.gz | mysql zabbix -uzabbix -pzabbix

7、修改zabbix_server.conf的配置文件

# vim /etc/zabbix/zabbix_server.confDBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=zabbix# vim /etc/php.ini在最后一行添加一下内容php_value max_execution_time 300php_value memory_limit 128Mphp_value post_max_size 16Mphp_value upload_max_filesize 2Mphp_value max_input_time 300

8、修改系统时间

安装ntp服务# yum install ntpdate -y调整为亚洲上海时区# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 同步时间服务器# ntpdate us.pool.ntp.org# date

9、修改httpd配置文件

# vim /etc/httpd/conf.d/zabbix.confphp_value date.timezone Asia/Shanghai

10、启动apache/zabbix-server服务并设置为开机启动

启动apache

# systemctl start httpd# systemctl enable httpd# systemctl status httpd

启动zabbix-server服务并设置为开机启动

# systemctl start zabbix-server# systemctl enable zabbix-server

查看zabbix-server日志

# vim  /var/log/zabbix/zabbix_server.log 18050:20190827:135341.502 Starting Zabbix Server. Zabbix 4.2.5 (revision 2c0e4d1d39). 18050:20190827:135341.503 ****** Enabled features ****** 18050:20190827:135341.503 SNMP monitoring:           YES 18050:20190827:135341.503 IPMI monitoring:           YES 18050:20190827:135341.503 Web monitoring:            YES 18050:20190827:135341.503 VMware monitoring:         YES 18050:20190827:135341.503 SMTP authentication:       YES 18050:20190827:135341.503 Jabber notifications:       NO 18050:20190827:135341.503 Ez Texting notifications:  YES 18050:20190827:135341.503 ODBC:                      YES 18050:20190827:135341.503 SSH2 support:              YES 18050:20190827:135341.503 IPv6 support:              YES 18050:20190827:135341.503 TLS support:               YES 18050:20190827:135341.503 ****************************** 18050:20190827:135341.503 using configuration file: /etc/zabbix/zabbix_server.conf

10、访问网站,

http://本机IP/zabbix![在这里插入图片描述](https://img-blog.csdnimg.cn/2019082715465132.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTQ1MjY0Mg==,size_16,color_FFFFFF,t_70)

11、首页是英文可以从用户设置改成中文


希望可×××学习。蟹蟹

0