一、准备工作
1、 搭建lnmp环境
参考:http://blog.csdn.net/guyan0319/article/details/74295713
2、需要关闭 selinux
临时关闭
setenforce 0
永久关闭
修改 /etc/selinux/config,设置 SELINUX=disabled
二、设置YUM源
rpm -ivh http://mirrors.aliyun.com/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
三、安装
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get
cd /usr/share/doc/zabbix-server-mysql-3.0.13
在数据库服务器新建zabbix 数据库将 create.sql.gz导入到数据库中。
四、配置Nginx, zb.com 是自定义域名,修改自己需要的域名。
zb.conf
server {
listen 80;
server_name zb.com; #自定义域名
#charset koi8-r;
#access_log logs/host.access.log main;
root /usr/share/zabbix;
access_log /var/log/nginx/zabbix.access.log;
error_log /var/log/nginx/zabbix.error.log;
location / {
index index.html index.htm index.php;
autoindex off;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
五、访问 http://zb.com/
点next step
修改PHP.INI 配置文件,确保上图红色区域都是”OK”。
点next step
配置数据库相关参数
点next step
默认即可,点next step
点 finish
默认用户名是Admin 密码 zabbix 然后点击sign in
登录成功,默认是英文界面,配置成中文界面。
六、安装客户端 zabbix_agent
yum -y install zabbix-agent
修改配置
vim /etc/zabbix/zabbix_agentd.conf
修改Server、ServerActive和Hostname这三项即可
Server=服务器ip地址
ServerActive=服务器ip地址
Hostname=客户端ip地址
systemctl start zabbix-agent
systemctl enable zabbix-agent
查看状态
这个时候你会发现在图形下面有中文乱码问题,解决办法如下
把Windows 系统中找到 C:\Windows\Fonts 中的楷体( simkai.ttf) 复制到服务器的/usr/share/zabbix/fonts/ 目录
cd /usr/share/zabbix/fonts/
mv graphfont.ttf graphfont.ttf.bak
mv simkai.ttf graphfont.ttf
刷新图形页面
到此安装完成。
希望能给各位带来些许帮助,如有什么好的建议或问题欢迎给我回复。