Play with Zabbix (by quqi99)

版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明 (作者:张华 发表于:2018-08-13)

问题

客户说keystone端口总在zabbit中报错:

net.tcp.service.perf[http,,35357] 
({host1:net.tcp.service.perf[http,,35357].count(#3,0)}=3 & {host2:net.tcp.service.perf[http,,35357].count(#3,0)}=3) | {host1:net.tcp.service.perf[http,,35357].prev(0)}>15 | {host2:net.tcp.service.perf[http,,35357].prev(0)}>15 
net.tcp.service.perf[http,,5000] 
({host1:net.tcp.service.perf[http,,5000].count(#3,0)}=3 & {host2:net.tcp.service.perf[http,,5000].count(#3,0)}=3) | {host1:net.tcp.service.perf[http,,5000].prev(0)}>15 | {host2:net.tcp.service.perf[http,,5000].prev(0)}>15 

改成下列的配置可能会减小误报:

net.tcp.service.perf[http,,35357] 
({host1:net.tcp.service.perf[http,,35357].max(#3)}=0 & {host2:net.tcp.service.perf[http,,35357].max(#3)}=0) 
net.tcp.service.perf[http,,5000] 
({host1:net.tcp.service.perf[http,,5000].max(#3)}=0 & {host2:net.tcp.service.perf[http,,5000].max(#3)}=0) 

Zabbix是什么? 我不是做运维的, 之前从来没有用过也没有听说过这个名词. 好吧, 学吧. 另外, 我发现网上安装zabbix的文章一搜一堆堆的, 但没有一篇照着是可以顺利安装成功的, 包括官方文档, 总共遇到了下列4个错误:

  1. ‘Table ‘users’ already exists’
  2. Job for zabbix-server.service failed because a configured resource limit was exceeded.
  3. Cannot connect to the database.
  4. Zabbix server cannot work with a Zabbix proxy database

所以我还是将这么个玩意也写篇博客吧. Zabbix是一个监控软件, Zabbix 3.0中提供的监控方式包括:
- Active agents
- Passive agents
- Extending agents
- Simple checks
- SNMP agents
- Zabbix Internal checks
- Zabbix trapper
- IPMI agents
- JMX agents
- External checks
- Database monitoring
- SSH agents
- Telnet agents
- SNMP Traps
- Aggregate checks
- Calculated checks

Install Zabbix Server

# https://tecadmin.net/install-zabbix-on-ubuntu/
wget https://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
sudo dpkg -i zabbix-release_3.4-1+xenial_all.deb
sudo apt update
sudo apt install zabbix-server-mysql zabbix-frontend-php mysql-server
sudo apt-get install php php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql libapache2-mod-php

sudo vim /etc/php/7.0/apache2/php.ini
[Date]
date.timezone = Asia/Shanghai
max_input_time = 600
max_execution_time= 600
post_max_size = 32M
sudo service apache2 restart

mysql -uroot -hlocalhost -ppassword
mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@'localhost' identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@'t440p.lan' identified by 'password';
mysql> flush privileges;
mysql> exit;

sudo zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz |mysql -uzabbix -hlocalhost -p zabbix
#sudo zcat /usr/share/doc/zabbix-proxy-mysql/schema.sql.gz |mysql -uzabbix -hlocalhost -p zabbix
cat << EOF | sudo tee -a /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=password
EOF

#sudo apt install policycoreutils
#setsebool -P httpd_can_connect_zabbix on
sudo systemctl start zabbix-server
http://192.168.99.124  Admin/zabbix

Install Zabbix Agent

http://blog.51cto.com/dyc2005/1971212
wget https://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
sudo dpkg -i zabbix-release_3.4-1+xenial_all.deb
sudo apt update
sudo apt install zabbix-agent
sudo vi /etc/zabbix/zabbix_agentd.conf
Server=192.168.99.124
ServerActive=192.168.99.124:1005 #主动提交监控数据时使用
sudo systemctl restart zabbix-agent

Configuration -> Templates -> Create Host
Click this host, and select the monitor template, eg: Template OS Linux 
How to Define template(http://blog.51cto.com/ywzhou/1579917), 'Configuration -> Templates', 
 - create 'Item' for this template, eg: net.tcp.service.perf[tcp,192.168.99.216,7070]
 - create 'Trigger' for this template
 - create 'Graph' for this template, it will link to 'Item'
 - Link template to Host

上几张图

这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述
这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

quqi99

你的鼓励就是我创造的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值