一看必会系列:zabbix-server 安装配置

来源:本站原创 Linux 超过109 views围观 0条评论

直接操作

1

 

rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
yum install -y zabbix-server-mysql zabbix-web-mysql
getenforce
setenforce 0
getenforce
setsebool -P httpd_can_connect_zabbix on
systemctl enable zabbix-server
systemctl start zabbix-server
netstat -ntlp
systemctl status zabbix-server
netstat -ntlp
systemctl start httpd
netstat -ntlp
vim /etc/httpd/conf.d/zabbix.conf
vim /etc/httpd/conf.d/welcome.conf
systemctl status firewalld
systemctl stop firewalld

 

2

http://192.168.142.103/zabbix/setup.php

报错,
PHP option "date.timezone" unknown  Fail
解决
"/etc/httpd/conf.d/zabbix.conf" 38L, 877C 
   php_value date.timezone Asia/Shanghai #开启并修改

 

3

登陆数据库
mysql -u root -p  回车 回车

输入以下命令
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@’%’ identified by ‘zabbix’;
flush privileges

4

初始化
zcat /usr/share/doc/zabbix-server-mysql-3.2.11/create.sql.gz | mysql -u zabbix -p -h服务器IP -P3307

进页面直接操作
http://192.168.142.103/zabbix/setup.php
完成安装

Congratulations! You have successfully installed Zabbix frontend.

Configuration file "/etc/zabbix/web/zabbix.conf.php" created.

vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=2wsxVFR$

 

5 登陆

关闭selinux

vi /etc/setlinux/config

改成disable

 

6管理登陆

默认密码 Admin zabbix

——————————————
监控模版
http://www.zabbix.org/wiki/Zabbix_Templates#Network_devices

 

# vim /etc/zabbix/zabbix_agentd.conf 
Server=127.0.0.1 
ServerActive=127.0.0.1 
Hostname=Zabbix server 

AGENT配置

安装
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-agent-3.2.4-1.el6.x86_64.rpm
rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/x86_64/zabbix-agent-3.2.4-1.el7.x86_64.rpm
rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/6/x86_64/zabbix-agent-3.2.4-1.el6.x86_64.rpm

直接上传也可

关闭selinux

getsebool -a |grep zabbix 查bool值
setsebool -P httpd_can_connect_zabbix on 重启后生效
setsebool -P zabbix_can_network on  重启后生效
setsebool  zabbix_can_network on 临时生效
setsebool httpd_can_connect_zabbix on 临时生效

开放 iptables
iptables -I  INPUT 1 -p tcp –dport 10050 -j ACCEPT
保存
service iptables save

7.0配置

PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix-agent/zabbix_agentd.log
LogFileSize=0

LogFileSize=0
Server=被动服务器IP

ServerActive=主动服务器IP

Hostname=datacentercrawer03
Include=/etc/zabbix/zabbix_agentd.conf.d/*.conf

6.0 配置
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=被动服务器IP

ServerActive=主动服务器IP

Include=/etc/zabbix/zabbix_agentd.d/*.conf

chkconfig zabbix-agent on
chkconfig |grep zabbix
service zabbix-agent start

ubuntu配置
sudo apt-get install zabbix-agent
sudo vi /etc/zabbix/zabbix_agentd.conf
sudo service zabbix-agent start

exmind@datacentercrawer02:~$sudo service zabbix-agent status
● zabbix-agent.service – Zabbix Agent
   Loaded: loaded (/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: enabled)
   Active: active (running) since 一 2017-03-06 18:08:37 CST; 9min ago

文章出自:CCIE那点事 http://www.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文链接:http://www.jdccie.com/?p=3787转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
  • 相关文章
  • 为您推荐
  • 各种观点

暂时还木有人评论,坐等沙发!
发表评论

快捷键:Ctrl+Enter