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方式进行安装
开发其date.timezone =date.timezone=Asia/Chongqing (大概在946行)
重启服务
[root@linux-node1~]#/etc/init.d/httpdrestart Stoppinghttpd:[OK] Startinghttpd:[OK]
点击next 按钮, 出现了以下页面,页面参数有三个失败, 这里需要再次修改/etc/PHP.ini
[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
问题解决都是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~]#
[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~]#
点击Finish 即可出现zabbix 的登陆界面
在以上配置的时候注意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 里设置