Zabbix 安装部署
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Zabbix 安装部署相关的知识,希望对你有一定的参考价值。
Zabbix
安装服务器端:
yum install zabbix-server-mysql-3.0.2-1.el7.x86_64.rpm zabbix-get-3.0.2-1.el7.x86_64.rpm
安装Web GUI
yum install httpd php php-mysql php-mbstring php-gd php-bcmath php-ldap php-xml yum install zabbix-web-3.0.2-1.el7.noarch.rpm zabbix-web-mysql-3.0.2-1.el7.noarch.rpm
准备zabbix 数据库
[[email protected] ~]# yum -y install mariadb-server mysql [[email protected] ~]# systemctl enable mariadb.service [[email protected] ~]# systemctl start mariadb.service MariaDB [(none)]> CREATE DATABASE zabbix CHARSET ‘utf8‘; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> GRANT ALL ON zabbix.* TO ‘zabbix_user‘@‘%‘ IDENTIFIED BY ‘zabbix_pass‘; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
服务端数据库初始化:
查看数据库文件安装目录 [[email protected] ~]# rpm -ql zabbix-server-mysql /etc/logrotate.d/zabbix-server /etc/zabbix/zabbix_server.conf /usr/lib/systemd/system/zabbix-server.service /usr/lib/tmpfiles.d/zabbix-server.conf /usr/lib/zabbix/alertscripts /usr/lib/zabbix/externalscripts /usr/sbin/zabbix_server_mysql /usr/share/doc/zabbix-server-mysql-3.0.2 /usr/share/doc/zabbix-server-mysql-3.0.2/AUTHORS /usr/share/doc/zabbix-server-mysql-3.0.2/COPYING /usr/share/doc/zabbix-server-mysql-3.0.2/ChangeLog /usr/share/doc/zabbix-server-mysql-3.0.2/NEWS /usr/share/doc/zabbix-server-mysql-3.0.2/README /usr/share/doc/zabbix-server-mysql-3.0.2/create.sql.gz /usr/share/man/man8/zabbix_server.8.gz /var/log/zabbix /var/run/zabbix [[email protected] ~]# cp /usr/share/doc/zabbix-server-mysql-3.0.2/create.sql.gz . [[email protected] ~]# gzip -d create.sql.gz [[email protected] ~]# mysql -uzabbix_user -h192.168.99.82 -p zabbix < create.sql
zabbix服务端配置:
[[email protected] ~]# grep -v "^#" /etc/zabbix/zabbix_server.conf | grep -v "^$" LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_server.pid DBHost=192.168.99.82 DBName=zabbix DBUser=xxxx DBPassword=xxxxx SNMPTrapperFile=/var/log/snmptrap/snmptrap.log Timeout=4 AlertScriptsPath=/usr/lib/zabbix/alertscripts ExternalScripts=/usr/lib/zabbix/externalscripts LogSlowQueries=3000
配置zabbix-web:
php时区设定:
[[email protected] ~]# grep date.timezone /etc/php.ini ; http://php.net/date.timezone date.timezone = Asia/Shanghai [[email protected] ~]# grep date.timezone /etc/httpd/conf.d/ autoindex.conf php.conf README userdir.conf welcome.conf zabbix.conf [[email protected] ~]# grep date.timezone /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai
启动zabbix-server
[[email protected] ~]# systemctl start zabbix-server.service [[email protected] ~]# systemctl enable zabbix-server.service Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
开启httpd服务
[[email protected] ~]# systemctl start httpd.service [[email protected] ~]# systemctl enable httpd.service Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
访问:
http://zabbix.runner.vip/zabbix/
安装zabbix 并配置mysql的相关信息
安装完成后,默认的登录用户名密码
admin:zabbix
本文出自 “迷荼” 博客,谢绝转载!
以上是关于Zabbix 安装部署的主要内容,如果未能解决你的问题,请参考以下文章