centos7.x之yum安装zabbix

前端之家收集整理的这篇文章主要介绍了centos7.x之yum安装zabbix前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1、安装LAMP

#关闭防火墙方便测试
yuminstallepel-release-y
systemctlstopfirewalld.service
systemctldisablefirewalld.service
setenforce0
#安装httpd
yuminstallhttpd
systemctlstarthttpd.service
systemctlenablehttpd.service
#安装数据库5.6
wgethttp://dev.MysqL.com/get/MysqL-community-release-el7-5.noarch.rpm
rpm-ivhMysqL-community-release-el7-5.noarch.rpm
yuminstallMysqL-community-server
systemctlrestartMysqLd.service
#设置msyql密码为123456
MysqL>setpasswordfor'root'@'localhost'=password('123456');

#远程连接设置,所有以root账号连接的远程用户,设其密码为123456
MysqL>grantallonxxxx.*to'root'@'%'identifiedby'123456'withgrantoption;

#更新权限
MysqL>flushprivileges;

#数据库开机启动
systemctlenableMysqLd.service
#安装PHP
yuminstallPHP-y
#安装PHP组件,使PHP支持MysqL
yuminstallPHP-MysqLPHP-gdlibjpeg*PHP-ldapPHP-odbcPHP-pearPHP-xmlPHP-xmlrpcPHP-mbstringPHP-bcmathPHP-mhash-y
#重启对应服务
systemctlrestartMysqLd.service
systemctlrestarthttpd.service

#以上安装apahce、MysqLPHP安装完毕。

查看安装环境版本:

cd/var/www/html,新建index.PHP文件,输入:
<?PHP
PHPinfo();
?>

2、安装zabbix

#安装zabbixserver
rpm-ivhhttp://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
#安装Zabbixserverandagent(agent是可选的)
yuminstallzabbix-server-MysqLzabbix-web-MysqLzabbix-agentzabbix-java-gateway-y
vi/etc/httpd/conf.d/zabbix.conf
更新时区:
PHP_valuedate.timezoneAsia/Shanghai
#重启httpd
systemctlrestarthttpd
#创建MysqL数据库用户
MysqL–uroot–p
MysqL>createdatabasezabbixcharactersetutf8;

MysqL>grantallprivilegesonzabbix.*to'zabbix'@'%'identifiedby'zabbix';

MysqL>flushprivileges;
#数据库导入zabbixtemplate
#-p后面的zabbix不是密码,而是选择zabbix数据库,导入都是数据表
zcat/usr/share/doc/zabbix-server-MysqL-3.4.0/create.sql.gz|MysqL-uzabbix-pzabbix

#ConfiguredatabaseforZabbixserver/proxy
#vi/etc/zabbix/zabbix_server.conf
DBHost=192.168.1.100
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
#StartingZabbixserverprocess
systemctlstartzabbix-server
systemctlenablezabbix-server
#添加selinux设置
setsebool-Phttpd_can_connect_zabbixon
setsebool-Phttpd_can_network_connect_dbon
systemctlstarthttpd
#修改PHP设置,后来再搭建多几次发现这个PHP设置可以不用更改
vi/etc/PHP.ini
max_execution_time=600
max_input_time=600
memory_limit=256
Mpost_max_size=32M
upload_max_filesize=16M
date.timezone=Asia/Shanghai
#允许Zabbixwebconsole对特定IP段可用(可选)
vi/etc/httpd/conf.d/zabbix.conf
如果设置‘AllowfromAll’,这可以允许全部可以访问
PHP_valueupload_max_filesize2M
PHP_valuemax_input_time300
PHP_valuealways_populate_raw_post_data-1
#PHP_valuedate.timezoneEurope/Riga
PHP_valuedate.timezoneAsia/Shanghai
</IfModule>
</Directory>

<Directory"/usr/share/zabbix/conf">
Requirealldenied
</Directory>

<Directory"/usr/share/zabbix/app">
Requirealldenied
</Directory>

<Directory"/usr/share/zabbix/include">
Requirealldenied
</Directory>

<Directory"/usr/share/zabbix/local">
Requirealldenied
</Directory>
#前端web界面访问配置
http://192.168.1.100/zabbix/setup.PHP

#zabbix默认账号和密码
ThedefaultusernameisAdmin,passwordzabbix.
#添加zabbix-agent,前面安装zabbixserver的时候,一起yum安装了,现在只要修改一下数据即可
vim/etc/hosts
添加
192.168.1.100Zabbixserver

servicezabbix-agentstart
chkconfigzabbix-agenton

猜你在找的CentOS相关文章