1.1Zabbix环境准备
[[email protected] ~]# cat /etc/redhat-release #查看系统版本
CentOS Linux release 7.2.1511 (Core)
[[email protected] ~]# uname -r #查看内核版本
3.10.0-327.18.2.el7.x86_64
[[email protected] ~]# getenforce #检测selinux是否关闭
Disabled
[[email protected] ~]# systemctl stop firewalld #关闭firewall防火墙
[[email protected] ~]# ifconfig eth0|awk -F ‘[ :]+‘ ‘NR==2{print $3}‘ #查看IP地址
192.168.90.11
[[email protected] ~]# hostname #查看主机名
linux-node1.com
1.2Zabbix安装
Zabbix存储配置包以及yum配置文件。
[[email protected] ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
Zabbix程序包安装,以及MySQL、Zabbix-agent
[[email protected] ~]# yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent
mariadb-server
1.3初始数据库
创建Zabbix数据库以及用户。对这样的说明,参考MySQL数据库创建脚本
[[email protected] ~]# systemctl start mariadb
[[email protected] ~]# mysql -uroot -p
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 [email protected] identified by ‘zabbix‘;
Query OK, 0 rows affected (0.00 sec)
导入初始模式和数据
[[email protected] ~]# cd /usr/share/doc/zabbix-server-mysql-3.0.3/
[[email protected] zabbix-server-mysql-3.0.3]# zcat create.sql.gz |mysql -uroot zabbix
1.4Zabbix服务器进程启动
在Zabbix_server.conf编辑数据库配置
[[email protected] ~]# grep ^[a-Z] /etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
启动Zabbix服务器进程
[[email protected] ~]# systemctl start zabbix-server
1.5编辑Zabbix前端PHP配置
Apache的配置文件/etc/httpd/conf.d/zabbix.conf一些PHP设置已经配置好了。取消注释,设置正确的时区
[[email protected] ~]# vim /etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone Asia/Shanghai
通过改变配置文件重新启动Apache Web服务器
[[email protected] ~]# systemctl start httpd
第2章安装Zabbix Web
2.1步骤1
在你的浏览器,打开网址http://Zabbix_server_ip/zabbix
4.3.2 php需求检查
4.3.3 MySQL配置
4.3.4 zabbix服务端详细信息
4.3.5 zabbix安装前信息列表
4.3.6 安装完成
登陆zabbix,默认用户名:Admin,密码:zabbix
http://down.51cto.com/data/1976867上面有下载《Zabbix教程从入门到精通》