文章系转载,方便整理和归纳
源文地址:https://book.open-falcon.org/zh/faq/linux-metrics.html

1. Linux运维基础采集项

做运维,不怕出问题,怕的是出了问题,抓不到现场,两眼摸黑。所以,依靠强大的监控系统,收集尽可能多的指标,意义重大。但哪些指标才是有意义的呢,本着从实践中来的思想,各位工程师在长期摸爬滚打中总结出来的经验最有价值。

在各位运维工程师长期的工作实践中,我们总结了在系统运维过程中,经常会参考的一些指标,主要包括以下几个类别:

  • CPU
  • Load
  • 内存
  • 磁盘
  • IO
  • 网络相关
  • 内核参数
  • ss 统计输出
  • 端口采集
  • 核心服务的进程存活信息采集
  • 关键业务进程资源消耗
  • NTP offset采集
  • DNS解析采集

每个类别,具体的详细指标如下,这些指标,都是open-falcon的agent组件直接支持的。falcon-agent每隔一定时间间隔(目前是60秒)会采集一次相关的指标,并汇报给server端。

2. CPU相关采集项

计算方法:通过采集/proc/stat来得到,大家可以参考sar命令的统计输出来理解。

  • cpu.idle:Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
  • cpu.busy:与cpu.idle相对,他的值等于100减去cpu.idle。
  • cpu.guest:Percentage of time spent by the CPU or CPUs to run a virtual processor.
  • cpu.iowait:Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
  • cpu.irq:Percentage of time spent by the CPU or CPUs to service hardware interrupts.
  • cpu.softirq:Percentage of time spent by the CPU or CPUs to service software interrupts.
  • cpu.nice:Percentage of CPU utilization that occurred while executing at the user level with nice priority.
  • cpu.steal:Percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor.
  • cpu.system:Percentage of CPU utilization that occurred while executing at the system level (kernel).
  • cpu.user:Percentage of CPU utilization that occurred while executing at the user level (application).
  • cpu.cnt:cpu核数。
  • cpu.switches:cpu上下文切换次数,计数器类型。

3. 磁盘相关采集项

计算方法:先读取/proc/mounts拿到所有挂载点,然后通过syscall.Statfs_t拿到blocks和inode的使用情况。每个metric都会附加一组tag描述,类似mount=mount,fstype=mount,fstype=mount,fstype=fstype,其中mount是挂载点,比如/home,mount是挂载点,比如/home,mount是挂载点,比如/home,fstype是文件系统,比如ext4。

  • df.bytes.free:磁盘可用量,int64
  • df.bytes.free.percent:磁盘可用量占总量的百分比,float64,比如32.1
  • df.bytes.total:磁盘总大小,int64
  • df.bytes.used:磁盘已用大小,int64
  • df.bytes.used.percent:磁盘已用大小占总量的百分比,float64
  • df.inodes.total:inode总数,int64
  • df.inodes.free:可用inode数目,int64
  • df.inodes.free.percent:可用inode占比,float64
  • df.inodes.used:已用的inode数据,int64
  • df.inodes.used.percent:已用inode占比,float64

4. megacli工具输出

使用 megacli 工具读取 RAID 相关信息,每个metric都会附件一组tag描述,用来标明所属PD或者 VD,PD格式为PD=Enclosure_ID:SLOT_ID,比如PD=32:0表明第一块磁盘 ,VD=0 表明第一个逻辑磁盘。

  • sys.disk.lsiraid.pd.Media_Error_Count:这个及以下三个指标目前仅作为数据收集,不一定意味磁盘损坏(只是表示损坏概率变大)
  • sys.disk.lsiraid.pd.Other_Error_Count
  • sys.disk.lsiraid.pd.Predictive_Failure_Count
  • sys.disk.lsiraid.pd.Drive_Temperature
  • sys.disk.lsiraid.pd.Firmware_state:如果值不为0,则此物理磁盘出现问题
  • sys.disk.lsiraid.vd.cache_policy:如果值不为0,表示此逻辑磁盘缓存策略和设置不符
  • sys.disk.lsiraid.vd.state: 如果值不为0,表示此逻辑磁盘出现问题

5. SMART工具输出

使用 smartctl 工具读取磁盘 SMART 信息,目前所有指标仅作为数据收集,不一定意味磁盘损坏(只是表示概率变大),每个metric都会有一组tag描述,表明盘符,例如device=/dev/sda。

  • sys.disk.smart.Reallocated_Sector_Ct
  • sys.disk.smart.Spin_Retry_Count
  • sys.disk.smart.Reallocated_Event_Count
  • sys.disk.smart.Current_Pending_Sector
  • sys.disk.smart.Offline_Uncorrectable
  • sys.disk.smart.Temperature_Celsius

6. 分区读写监控

测试所有已挂载分区是否可读写,每个metric都会有一组tag描述,表示挂载点,比如mount=/home

  • sys.disk.rw: 如果值不为0,表明此分区读写出现问题

7. IO相关采集项

计算方法:每秒采集一次/proc/diskstats,计算差值,都是计数器类型的。每个metric都会有一组tag描述,形如device=$device,用来表示具体的设备,比如sda1、sdb。用户可以参考iostat的帮助文档来理解具体的metric含义。

  • disk.io.ios_in_progress:Number of actual I/O requests currently in flight.
  • disk.io.msec_read:Total number of ms spent by all reads.
  • disk.io.msec_total:Amount of time during which ios_in_progress >= 1.
  • disk.io.msec_weighted_total:Measure of recent I/O completion time and backlog.
  • disk.io.msec_write:Total number of ms spent by all writes.
  • disk.io.read_merged:Adjacent read requests merged in a single req.
  • disk.io.read_requests:Total number of reads completed successfully.
  • disk.io.read_sectors:Total number of sectors read successfully.
  • disk.io.write_merged:Adjacent write requests merged in a single req.
  • disk.io.write_requests:total number of writes completed successfully.
  • disk.io.write_sectors:total number of sectors written successfully.
  • disk.io.read_bytes:单位是byte的数字
  • disk.io.write_bytes:单位是byte的数字
  • disk.io.avgrq_sz:下面几个值就是iostat -x 1看到的值
  • disk.io.avgqu-sz
  • disk.io.await
  • disk.io.svctm
  • disk.io.util:是个百分数,比如56.43,表示56.43%

8. 机器负载相关采集项

计算方法:读取/proc/loadavg,都是原始值类型的:

  • load.1min
  • load.5min
  • load.15min

9. 内存相关采集项

计算方法:读取/proc/meminfo 中的内容,其中的mem.memfree是free+buffers+cached,mem.memused=mem.memtotal-mem.memfree。用户具体可以参考free命令的输出和帮助文档来理解每个metric的含义。

  • mem.memtotal:内存总大小
  • mem.memused:使用了多少内存
  • mem.memused.percent:使用的内存占比
  • mem.memfree
  • mem.memfree.percent
  • mem.swaptotal:swap总大小
  • mem.swapused:使用了多少swap
  • mem.swapused.percent:使用的swap的占比
  • mem.swapfree
  • mem.swapfree.percent

10. 网络相关采集项

计算方法:读取/proc/net/dev的内容,每个metric都附加有一组tag,形如iface=$iface,标明具体那个interface,比如eth0。metric中带有in的表示流入情况,out表示流出情况,total是总量in+out,支持的metric如下:

  • net.if.in.bytes
  • net.if.in.compressed
  • net.if.in.dropped
  • net.if.in.errors
  • net.if.in.fifo.errs
  • net.if.in.frame.errs
  • net.if.in.multicast
  • net.if.in.packets
  • net.if.out.bytes
  • net.if.out.carrier.errs
  • net.if.out.collisions
  • net.if.out.compressed
  • net.if.out.dropped
  • net.if.out.errors
  • net.if.out.fifo.errs
  • net.if.out.packets
  • net.if.total.bytes
  • net.if.total.dropped
  • net.if.total.errors
  • net.if.total.packets

11. 端口采集项

计算方法,通过ss -ln,来判断指定的端口是否处于listen状态。原始值类型,值要么是1:代表在监听,要么是0,代表没有在监听。每个metric都附件一组tag,形如port=port,port,port,port就是具体的端口。

  • net.port.listen

12. 机器内核配置

  • kernel.maxfiles: 读取的/proc/sys/fs/file-max
  • kernel.files.allocated:读取的/proc/sys/fs/file-nr第一个Field
  • kernel.files.left:值=kernel.maxfiles-kernel.files.allocated
  • kernel.maxproc:读取的/proc/sys/kernel/pid_max

13. ntp采集项

使用 ntpq -pn 获取本机时间相对于 ntp 服务器的 offset。

  • sys.ntp.offset: 本机偏移时间,单位为ms,值过大或者为0则表明有异常,需要报警

14. 进程监控

  • proc.num:判断某个进程的数目,这里需要分两个场景,一种是根据进程的名字来判定,比如name=sshd;另外一种是根据cmdline来判定,比如Java的应用进程名可能都是java,根据第一种情况没法做区分,此时可以配置cmdline,如cmdline=./falcon_agent-c./cfg.ini

15. 进程资源监控

  • process.cpu.all:进程和它的子进程使用的sys+user的cpu,单位是jiffies
  • process.cpu.sys:进程和它的子进程使用的sys cpu,单位是jiffies
  • process.cpu.user:进程和它的子进程使用的user cpu,单位是jiffies
  • process.swap:进程和它的子进程使用的swap,单位是page
  • process.fd:进程使用的文件描述符个数
  • process.mem:进程占用内存,单位byte

16. ss命令输出

  • ss.orphaned
  • ss.closed
  • ss.timewait
  • ss.slabinfo.timewait
  • ss.synrecv
  • ss.estab

open-falcon采集的一些指标及说明相关推荐

  1. 百度可观测系列 | 采集亿级别指标,Prometheus 集群方案这样设计

    [百度云原生导读]在前一篇<基于 Prometheus 的大规模线上业务监控实践>中,我们为大家介绍了针对大规模业务监控场景,百度云原生团队基于 Prometheus 技术方案的一些探索, ...

  2. 沃特玛采集均衡模块_云原生在京东丨云原生时代下的监控:如何基于云原生进行指标采集?...

    从 Kubernetes 成为容器管理领域的事实标准开始,基于云原生也就是基于 Kubernetes 原生.在云的体系下,基础硬件基本上都被抽象化.模糊化,硬故障需要人为干预的频次在逐渐降低,健康检查 ...

  3. 一文搞懂指标采集利器 Telegraf

    作者| 姜闻名 来源|尔达 Erda 公众号 ​ 导读:为了让大家更好的了解 MSP 中 APM 系统的设计实现,我们决定编写一个<详聊微服务观测>系列文章,深入 APM 系统的产品.架构 ...

  4. Metricbeat 指标采集工具应用示例

    文章目录 Metricbeat介绍 Metricbeat组成 Metricbeat部署及测试 部署 配置及测试 Module 使用 启用nginx Module 并修改配置 nginx 安装对应的Mo ...

  5. 前端性能优化方法与实战05 指标采集:白屏、卡顿、网络环境指标采集方法

    上一讲我们介绍了首屏时间的指标采集,这一讲我们来聊聊前端其他的性能指标采集,比如白屏.卡顿和网络环境. 你乘火车.地铁.飞机都走过安检吧?如果说首屏时间类似你过安检的时刻,那么,白屏时间就是你排队到安 ...

  6. zookeeper使用zookeeper_export采集指标报错mntr is not executed because it is not in the whitelist.

    起因,刚刚部署好的zookeeper.用户反馈说监控看不到指标了. Zookeeper监控告警export指标采集不到排查结果. grafana显示集群指标无数据 3.需要在普罗米修斯上查询组件节点使 ...

  7. 【开源】Tsar——灵活的系统和应用采集软件

    摘要: 在开源人的盛会LinuxCon + ContainerCon + CloudOpen中国(简称LC3)大会上,阿里云CDN团队的空见(花名),为大家分享了开源的系统和应用采集软件Tsar的背景 ...

  8. hbase 监控指标项

    名词解释 JMX:Java Management Extensions,用于用于Java程序扩展监控和管理项 GC:Garbage Collection,垃圾收集,垃圾回收机制 指标项来源 主机名 u ...

  9. 百度可观测系列 | 如何构建亿级指标的高可用 TSDB 存储集群?

    [百度云原生导读]在前一篇<采集亿级别指标,Prometheus 集群方案这样设计中>,我们为大家介绍了针对针对亿级指标场景,百度云原生团队基于Prometheus 技术方案的研究,包括资 ...

  10. Elasticsearch:如何在 Elastic Agents 中配置 Beats 来采集定制日志

    在我之前的文章 "Observability:使用 Elastic Agent 来摄入日志及指标 - Elastic Stack 8.0",我详细地描述了如何安装 Elastics ...

最新文章

  1. 万字长文,别再说你不懂Linux内存管理了(合辑),30 张图给你安排的明明白白...
  2. 电商企业纷纷结缘信息化 管理系统如何给力?
  3. 计算机听不到音乐怎么回事,电脑听不到声音怎么解决 电脑听不到声音的处理方法...
  4. python3-numpy np.nditer 迭代数组、np.nditer修改数组、np.nditer广播迭代
  5. android中的so加固,so加固-加密特定section中的内容
  6. java中常见的包类接口_Java中一些常用的类,包,接口
  7. C#3.0新特性 扩展方法
  8. android 布局属性
  9. Linux 信号(signal)
  10. 对“使用MyEclipse,写的jsp代码因有汉字而无法保存”问题的解决
  11. pod install pod update
  12. 值得关注的开源软件推荐
  13. pla3d打印材料密度_3D打印材料:透明PLA材料
  14. word 去掉段落背景颜色
  15. 定义fact(n)函数,调用函数,返回值
  16. java爬虫正则表达式_Java爬虫预热之正则表达式 - 菜鸟头头
  17. IE安全系列:IE浏览器的技术变迁(上)
  18. 服务器自带软件怎么样卸载,告别卸载软件难 四大方法轻松搞定
  19. el轮播图片image单张图比例缩放及多张图宽度固定高度等比例自适应展示;
  20. 常用地图投影转换公式

热门文章

  1. L1-064 估值一亿的AI核心代码 (20 分)—团体程序设计天梯赛
  2. 批量将ANSI文本txt文件转换成UTF8编码格式 (vbs方法)
  3. unittest测试框架详谈及实操(一)
  4. centos7.2 kvm 安装超详细
  5. eMMC基础技术2:eMMC概述
  6. Android中Service的一个Demo例子
  7. Ctrl+F5为强制刷新
  8. Rearchitect Your Web Applications for Microsoft ASP.NET 2.0
  9. web安全day25:linux的NAT网络配置和yum的配置和使用
  10. 基于Cocos2d-x开发guardCarrot--7 《保卫萝卜2》关卡选择页面开发