设为首页 收藏本站
查看: 1494|回复: 0

[经验分享] 基于Centos6.5 构建zabbix平台

[复制链接]
YunVN网友  发表于 2019-1-20 06:15:20 |阅读模式
  Zabbix是使用非常广泛的开源监控管理工具。基于Zabbix可以很方便的建立面向操作系统,应用,中间件,数据库等领域的监控、性能数据可视化、报警、维护窗口管理等监控管理工作。 不多说了,分享直接上实战,zabbix 版本稍微旧了点, 比较是实用, 后期在更新。。

  

  安装EPEL源

[root@linux-node1 ~]# yum install epel-release  安装LAMP 环境通过yum方式
[root@linux-node1 ~]# yum install zabbix20 zabbix20-agent zabbix20-server zabbix20-server-mysql zabbix20-web zabbix20-web-mysql net-snmp-devel  启动zabbix 服务,且开机启动
[root@linux-node1 ~]# /etc/init.d/zabbix-server start; /etc/init.d/zabbix-agent start
Starting Zabbix server:                                    [  OK  ]
Starting Zabbix agent:                                     [  OK  ]
[root@linux-node1 ~]# /etc/init.d/mysqld start; /etc/init.d/httpd start
Starting mysqld:                                           [  OK  ]  导入表库信息

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

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

  出现了时区的问题, 这里修改/etc/php.ini 文件
  开发其date.timezone = date.timezone = Asia/Chongqing     (大概在946行)
  
  重启服务

[root@linux-node1 ~]# /etc/init.d/httpd restart
Stopping httpd:                                              [  OK  ]
Starting httpd:                                              [  OK  ]  

  刷新页面,问题解决

  

  点击next 按钮, 出现了以下页面,页面参数有三个失败, 这里需要再次修改/etc/php.ini
  将页面上提示的红色参数值进行调整

[root@linux-node1 ~]# grep max_size /etc/php.ini
post_max_size = 16M
[root@linux-node1 ~]# grep max_exec /etc/php.ini
max_execution_time = 300
[root@linux-node1 ~]# grep max_input_time /etc/php.ini
; max_input_time
max_input_time = 300  

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

  问题解决都是OK 状态了
  

[root@linux-node1 ~]# mysql -uroot -p openstack -e grant all on zabbix.* to 'zabbix'@localhost identified by 'zabbixpasswd'   (数据默认无登陆密码可以通过此命令执行)
[root@linux-node1 ~]# mysql -u root -p openstack
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@linux-node1 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.1.73-log Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use zabbix;
Database changed
mysql> grant all on zabbix.* to 'zabbix'@localhost identified by 'zabbixpasswd'
    -> ;
Query OK, 0 rows affected (0.07 sec)
mysql> quit
Bye
[root@linux-node1 ~]# mysql -uzabbix -pzabbixpasswd
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.1.73-log Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> quit
Bye
[root@linux-node1 ~]#



  

  点击下一步


[root@linux-node1 ~]# /etc/init.d/zabbix-server start
Starting Zabbix server:                                    [  OK  ]
[root@linux-node1 ~]# ps aux |grep zabbix
zabbix     3541  0.0  0.1  74672  1100 ?        S    05:38   0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
zabbix     3543  0.0  0.1  74672  1100 ?        S    05:38   0:01 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
zabbix     3544  0.0  0.1  74672   888 ?        S    05:38   0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
zabbix     3545  0.0  0.1  74672   888 ?        S    05:38   0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
zabbix     3546  0.0  0.1  74672   888 ?        S    05:38   0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
zabbix     3547  0.0  0.1  74684  1076 ?        S    05:38   0:00 /usr/sbin/zabbix_agentd -c /etc/zabbix_agentd.conf
494        4347  0.0  0.2 116000  2428 ?        S    06:05   0:00 /usr/sbin/zabbix_server -c /etc/zabbix_server.conf
root       4353  0.0  0.0 103248   848 pts/1    S+   06:05   0:00 grep zabbix
[root@linux-node1 ~]#  





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



  

  在以上配置的时候注意zabbix数据库密码设置,若配置文件没有定义zabbix 数据库密码, 这里修改
[root@linux-node1 ~]#  vim /etc/zabbix/zabbix_server.conf
111 DBPassword=zabbixpasswd
[root@linux-node1 ~]# /etc/init.d/zabbix-server restart
Shutting down Zabbix server:                               [  OK  ]
Starting Zabbix server:                                    [  OK  ]
[root@linux-node1 ~]# netstat -tulnp |grep zabbix
tcp        0      0 0.0.0.0:10050               0.0.0.0:*                   LISTEN      3541/zabbix_agentd  
tcp        0      0 0.0.0.0:10051               0.0.0.0:*                   LISTEN      4520/zabbix_server  
tcp        0      0 :::10050                    :::*                        LISTEN      3541/zabbix_agentd  
tcp        0      0 :::10051                    :::*                        LISTEN      4520/zabbix_server  

  
客户端安装:
[root@linux-node2 yum.repos.d]# yum install zabbix20-agent
[root@linux-node2 yum.repos.d]# vim /etc/zabbix_agentd.conf
[root@linux-node2 yum.repos.d]# /etc/init.d/zabbix-agent start
Starting Zabbix agent:                                     [  OK  ]
[root@linux-node2 yum.repos.d]# netstat -tnlp|grep zabbix
tcp        0      0 0.0.0.0:10050               0.0.0.0:*                   LISTEN      2760/zabbix_agentd  
tcp        0      0 :::10050                    :::*                        LISTEN      2760/zabbix_agentd  
[root@linux-node2 yum.repos.d]#  

  

  

  在Server 端进行测试
[root@linux-node1 yum.repos.d]# zabbix_get -s 192.168.229.146 -k "system.hostname"
linux-node2.openstack.com
[root@linux-node1 yum.repos.d]#  
接下来在web页面进行配置了,并且可以修改语言在profile 里设置
  





  


  

  





运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-665331-1-1.html 上篇帖子: zabbix_agentd.win.conf全文和配置 下篇帖子: zabbix基础详解及安装配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表