基于Centos6.5 构建zabbix平台

前端之家收集整理的这篇文章主要介绍了基于Centos6.5 构建zabbix平台前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Zabbix是使用非常广泛的开源监控管理工具。基于Zabbix可以很方便的建立面向操作系统,应用,中间件,数据库等领域的监控、性能数据可视化、报警、维护窗口管理等监控管理工作。 不多说了,分享直接上实战,zabbix 版本稍微旧了点, 比较是实用, 后期在更新。。


安装EPEL源

[root@linux-node1~]#yuminstallepel-release

安装LAMP环境通过yum方式

[root@linux-node1~]#yuminstallzabbix20zabbix20-agentzabbix20-serverzabbix20-server-MysqLzabbix20-webzabbix20-web-MysqLnet-snmp-devel

启动zabbix服务,且开机启动

[root@linux-node1~]#/etc/init.d/zabbix-serverstart;/etc/init.d/zabbix-agentstart
StartingZabbixserver:[OK]
StartingZabbixagent:[OK]
[root@linux-node1~]#/etc/init.d/MysqLdstart;/etc/init.d/httpdstart
StartingMysqLd:[OK]

导入表库信息

[root@linux-node1~]#MysqL-uroot-popenstack--default-character-set=utf8zabbix</usr/share/zabbix-MysqL/schema.sql
[root@linux-node1~]#MysqL-uroot-popenstack--default-character-set=utf8zabbix</usr/share/zabbix-MysqL/images.sql
[root@linux-node1~]#MysqL-uroot-popenstack--default-character-set=utf8zabbix</usr/share/zabbix-MysqL/data.sql


访问http://ip/zabbix ,通过web方式进行安装

wKioL1gv8bLTuMjKAAN7mg86IZo147.png

出现了时区的问题, 这里修改/etc/PHP.ini 文件

开发其date.timezone =date.timezone=Asia/Chongqing (大概在946行)

重启服务

[root@linux-node1~]#/etc/init.d/httpdrestart
Stoppinghttpd:[OK]
Startinghttpd:[OK]


刷新页面,问题解决

wKioL1gv8iKwTXOkAANLJa1gG5k119.png


点击next 按钮, 出现了以下页面页面参数有三个失败, 这里需要再次修改/etc/PHP.ini

页面提示的红色参数值进行调整

wKiom1gv8mnAsI9rAAHDJE5Bosg874.png

[root@linux-node1~]#grepmax_size/etc/PHP.ini
post_max_size=16M
[root@linux-node1~]#grepmax_exec/etc/PHP.ini
max_execution_time=300
[root@linux-node1~]#grepmax_input_time/etc/PHP.ini
;max_input_time
max_input_time=300


修改完后, 重新加载及刷新页面

wKiom1gv8qGz3GlfAAGeQAxlIFs716.png

问题解决都是OK 状态了


[root@linux-node1~]#MysqL-uroot-popenstack-egrantallonzabbix.*to'zabbix'@localhostidentifiedby'zabbixpasswd'(数据默认无登陆密码可以通过此命令执行)
[root@linux-node1~]#MysqL-uroot-popenstack
Enterpassword:
ERROR1045(28000):Accessdeniedforuser'root'@'localhost'(usingpassword:YES)
[root@linux-node1~]#MysqL-uroot-p
Enterpassword:
WelcometotheMysqLmonitor.Commandsendwith;or\g.
YourMysqLconnectionidis18
Serverversion:5.1.73-logSourcedistribution

Copyright(c)2000,2013,Oracleand/oritsaffiliates.Allrightsreserved.

OracleisaregisteredtrademarkofOracleCorporationand/orits
affiliates.Othernamesmaybetrademarksoftheirrespective
owners.

Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.

MysqL>usezabbix;
Databasechanged
MysqL>grantallonzabbix.*to'zabbix'@localhostidentifiedby'zabbixpasswd'
->;
QueryOK,0rowsaffected(0.07sec)

MysqL>quit
Bye
[root@linux-node1~]#MysqL-uzabbix-pzabbixpasswd
WelcometotheMysqLmonitor.Commandsendwith;or\g.
YourMysqLconnectionidis19
Serverversion:5.1.73-logSourcedistribution

Copyright(c)2000,Oracleand/oritsaffiliates.Allrightsreserved.

OracleisaregisteredtrademarkofOracleCorporationand/orits
affiliates.Othernamesmaybetrademarksoftheirrespective
owners.

Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.

MysqL>quit
Bye
[root@linux-node1~]#

wKiom1gv9MKQiy_yAAGTYrN-Zkw544.png

wKioL1gv9MOQgi8OAAGPVtpGEIw103.png



点击下一步

wKiom1gv9MTBsFJCAAFUUs3_iKA542.png


[root@linux-node1~]#/etc/init.d/zabbix-serverstart
StartingZabbixserver:[OK]
[root@linux-node1~]#psaux|grepzabbix
zabbix35410.00.1746721100?S05:380:00/usr/sbin/zabbix_agentd-c/etc/zabbix_agentd.conf
zabbix35430.00.1746721100?S05:380:01/usr/sbin/zabbix_agentd-c/etc/zabbix_agentd.conf
zabbix35440.00.174672888?S05:380:00/usr/sbin/zabbix_agentd-c/etc/zabbix_agentd.conf
zabbix35450.00.174672888?S05:380:00/usr/sbin/zabbix_agentd-c/etc/zabbix_agentd.conf
zabbix35460.00.174672888?S05:380:00/usr/sbin/zabbix_agentd-c/etc/zabbix_agentd.conf
zabbix35470.00.1746841076?S05:380:00/usr/sbin/zabbix_agentd-c/etc/zabbix_agentd.conf
49443470.00.21160002428?S06:050:00/usr/sbin/zabbix_server-c/etc/zabbix_server.conf
root43530.00.0103248848pts/1S+06:050:00grepzabbix
[root@linux-node1~]#


wKioL1gv9MTxEa_mAAFsChHJhgQ521.png

wKiom1gv9MWSp2AVAAFmg8FH93A508.png

wKioL1gv9MahyI0QAAFY6DfAmf4278.png


点击Finish 即可出现zabbix 的登陆界面


wKioL1gv9MfRWvIQAAH5dSd55m8072.png

wKiom1gv9MiwQLD5AAF6CHiTx9Y048.png


在以上配置的时候注意zabbix数据库密码设置,若配置文件没有定义zabbix 数据库密码, 这里修改

[root@linux-node1~]#vim/etc/zabbix/zabbix_server.conf

111DBPassword=zabbixpasswd

[root@linux-node1~]#/etc/init.d/zabbix-serverrestart
ShuttingdownZabbixserver:[OK]
StartingZabbixserver:[OK]
[root@linux-node1~]#netstat-tulnp|grepzabbix
tcp000.0.0.0:100500.0.0.0:*LISTEN3541/zabbix_agentd
tcp000.0.0.0:100510.0.0.0:*LISTEN4520/zabbix_server
tcp00:::10050:::*LISTEN3541/zabbix_agentd
tcp00:::10051:::*LISTEN4520/zabbix_server



客户端安装:

[root@linux-node2yum.repos.d]#yuminstallzabbix20-agent
[root@linux-node2yum.repos.d]#vim/etc/zabbix_agentd.conf
[root@linux-node2yum.repos.d]#/etc/init.d/zabbix-agentstart
StartingZabbixagent:[OK]
[root@linux-node2yum.repos.d]#netstat-tnlp|grepzabbix
tcp000.0.0.0:100500.0.0.0:*LISTEN2760/zabbix_agentd
tcp00:::10050:::*LISTEN2760/zabbix_agentd
[root@linux-node2yum.repos.d]#




在Server 端进行测试

[root@linux-node1yum.repos.d]#zabbix_get-s192.168.229.146-k"system.hostname"
linux-node2.openstack.com
[root@linux-node1yum.repos.d]#


接下来在web页面进行配置了,并且可以修改语言在profile 里设置

wKiom1gv9GDSiH1tAAGQAqzrQds227.png

wKiom1gv9GHBjcHTAAGb6ze5mQ8961.png

wKioL1gv9GLiAOQjAALaE0L75Jk796.png

wKiom1gv9GPT85o3AAFM0k0Farg504.png

wKioL1gv9GSRTDjxAAGpAMV-4V0811.png

原文链接:https://www.f2er.com/centos/379846.html

猜你在找的CentOS相关文章