zabbix性能监控

简介:
在监控zabbix内部的性能时,我们通常使用如下的几个metric来衡量服务的性能:

nvps, queue,update percent,process busy和pending sync data,cache。

通过增加相应的监控,可以有效的发现zabbix的性能问题,进而进行有的放矢的优化。

下面简要说明下:
1.nvps,每秒钟处理的数据量,是一个理论值。

取值的sql:

整集群:

1
SELECTSUM(1.0/i.delay) AS  qps   FROM  items i,hosts h  WHERE  i.status= '0'  AND  i.hostid=h.hostid  AND  h.status= '0'  AND  i.delay<>0;

breakdown 到proxy的:

1
SELECT h.proxy_hostid,SUM( 1.0 /i.delay) AS qps FROM items i,hosts h  WHERE i.status= '0'  AND i.hostid=h.hostid  AND h.status= '0'  AND i.delay<> 0  AND h.proxy_hostid   is  NOT NULL GROUP BY h.proxy_hostid;

2.数据的delay情况,比如一个item的interval设置为60s,但是在70s左右才进行了更新,那么就说明delay了10s。
queue值越大就说明zabbix内部存在某些性能上的问题了。比较常见的是poller和trapper的进程busy问题。
这个是一个interval check,可以建立如下item:
zabbix[queue]
zabbix[queue,5m]
zabbix[queue,10m]

3.update percent:
用来衡量item值的更新情况,如果percent很低,证明数据存在delay或者某些agent端的数据存在异常。

1)整个集群的
1
2
3
4
5
6
7
8
9
10
select a.aa/b.bb from
       (select count(*)  as  aa from items
         where lastclock > UNIX_TIMESTAMP()- 1800  and delay <  900
             and hostid  in  (select hostid from hosts where status= 0 )
             and status =  0
       ) a,
       (select count(*)  as  bb from items
         where delay <  900  and status =  0
             and hostid  in  (select hostid from hosts where status= 0 )
        ) b

2)到proxy的:

1
2
3
4
5
6
7
8
9
10
select a.aa/b.bb from
      (select count(*)  as  aa from items
        where lastclock > UNIX_TIMESTAMP()- 1800  and delay <  900
            and hostid  in  (select hostid from hosts where status= 0  and proxy_hostid =  10100 )
            and status =  0
      ) a,
      (select count(*)  as  bb from items
        where delay <  900  and status =  0
            and hostid  in  (select hostid from hosts where status= 0  and proxy_hostid =  10100 )
       ) b


其中proxy_hostid是对应的proxy的id.

3)到主机,可以定位哪些主机的值更新存在异常(比unreachable的报警更加准确):

1
2
3
4
5
6
7
8
9
10
11
12
13
select b.hostname ,c.ip,a.update_percent  as  uppercent from
(select a.hostid,round(a.aa* 100 /b.bb, 2 as  update_percent from
       (select hostid,count(*)  as  aa from items
         where lastclock > UNIX_TIMESTAMP()- 1800  and delay <  900
             and hostid  in  (select hostid from hosts where status= 0 )
             and status =  0  group by hostid
       ) a,
       (select hostid,count(*)  as  bb from items
         where delay <  900  and status =  0
             and hostid  in  (select hostid from hosts where status= 0 ) group by hostid
        ) b where a.hostid=b.hostid)a,(select hostid,lower(host)  as  hostname from hosts where status= 0 )b,
       (select hostid,ip from  interface  where type= '1' )c
       where a.hostid=b.hostid and b.hostid=c.hostid  having(a.update_percent) <  80  order by uppercent;


4.内部进程的busy情况:
zabbix的工作线程的情况,可以快速定位zabbix内部的性能瓶颈,具体是一些interval check。
比如 zabbix[process,housekeeper,avg,busy], zabbix[process,http poller,avg,busy], zabbix[process,poller,avg,busy]等


5.proxy的 pending send data的情况
用了衡量proxy到server的数据发送情况,值越小说明数据发送越快。

取值sql:


1
SELECT  (( SELECT  MAX (proxy_history.id)  FROM  proxy_history)-nextid)  FROM  ids  WHERE  field_name= 'history_lastid'



6.cache,interval check

比如: zabbix[wcache,history,pfree], zabbix[wcache,text,pfree]


本文转自菜菜光 51CTO博客,原文链接:http://blog.51cto.com/caiguangguang/1345664,如需转载请自行联系原作者
相关文章
|
敏捷开发 数据可视化 项目管理
2024年最强的5大需求管理工具有哪些?如何选择最适合的需求管理软件?
随着项目管理和产品开发复杂性的增加,需求管理成为团队成功的关键。本文推荐5款需求管理工具:板栗看板、ProdPad、Craft.io、Airfocus和Targetprocess,分别适用于任务分配、产品规划、需求捕捉、优先级管理和敏捷开发等场景,帮助团队提高协作效率和交付质量。
 2024年最强的5大需求管理工具有哪些?如何选择最适合的需求管理软件?
|
机器学习/深度学习 搜索推荐 数据可视化
大数据用户画像之基本概念
大数据用户画像利用大数据技术分析用户基本信息、消费行为、兴趣、社交及地理数据,创建详细用户模型,助力企业精准营销。涉及技术包括数据挖掘、大数据处理(Hadoop、Spark)、数据可视化、机器学习和数据库管理。通过用户画像,企业可实现市场定位、个性化推荐、精准广告、产品优化和风险控制。学习该领域需掌握多个技术栈,包括相关算法、工具及业务理解。
1773 4
|
消息中间件 Java Kafka
windows下kafka的环境配置及rdkafka库的应用
windows下kafka的环境配置及rdkafka库的应用
1078 0
|
机器学习/深度学习 自然语言处理 PyTorch
【多标签文本分类】代码详解Seq2Seq模型
【多标签文本分类】代码详解Seq2Seq模型
484 0
【多标签文本分类】代码详解Seq2Seq模型
|
Android开发 应用服务中间件 开发工具
IntelliJ IDEA 创建Web项目(全教程)
说明:IntelliJ IDEA 版本为14.JDK 版本为1.7tomcat 版本为apache-tomcat-7.0.70 注:在创建过程中注意相关软件版本位数的问题。32位,64位的软件混搭会导致访问不成功的问题!!! 首先要理解一个基本问题:对比eclipse ,在IntelliJ IDEA中“new Project”相当于eclipse中的工作空间(Workspace),而“new Module”相当于eclipse中的工程(Project)。
4697 0
|
4天前
|
搜索推荐 编译器 Linux
一个可用于企业开发及通用跨平台的Makefile文件
一款适用于企业级开发的通用跨平台Makefile,支持C/C++混合编译、多目标输出(可执行文件、静态/动态库)、Release/Debug版本管理。配置简洁,仅需修改带`MF_CONFIGURE_`前缀的变量,支持脚本化配置与子Makefile管理,具备完善日志、错误提示和跨平台兼容性,附详细文档与示例,便于学习与集成。
293 116