Telegraf监控客户端调研笔记(6)-PING监控、进程监控

本文介绍了Telegraf的ping和procstat插件,用于远程探测和进程监控。ping插件配置包括urls、method和deadline,可用于网络监控;procstat插件通过过滤器监控进程资源,如CPU、内存使用,并讨论了pid_finder的可靠性问题。建议根据进程生命周期合理配置pid_tag,同时关注rlimit_num_fds_soft字段以监控文件句柄限制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本篇介绍两个采集插件,ping和procstat。ping监控就是用于远程探测的,年底夜莺v5最终版会内置nodata的处理逻辑,对机器的监控就不用ping了,不过有的时候,有些机器没法安装agent,这种情况可能就要考虑ping监控了。procstat主要有两个功能,一个是采集进程个数,比如nginx这种多进程模型,会采集总的进程数量,同时对每个单一进程,会采集进程相关的cpu、内存使用情况以及一些资源限制信息等。

ping

ping插件的默认配置如下:

# # Ping given url(s) and return statistics# [[inputs.ping]]#   ## Hosts to send ping packets to.#   urls = ["example.org"]##   ## Method used for sending pings, can be either "exec" or "native".  When set#   ## to "exec" the systems ping command will be executed.  When set to "native"#   ## the plugin will send pings directly.#   ###   ## While the default is "exec" for backwards compatibility, new deployments#   ## are encouraged to use the "native" method for improved compatibility and#   ## performance.#   # method = "exec"##   ## Number of ping packets to send per interval.  Corresponds to the "-c"#   ## option of the ping command.#   # count = 1##   ## Time to wait between sending ping packets in seconds.  Operates like the#   ## "-i" option of the ping command.#   # ping_interval = 1.0##   ## If set, the time to wait for a ping response in seconds.  Operates like#   ## the "-W" option of the ping command.#   # timeout = 1.0##   ## If set, the total ping deadline, in seconds.  Operates like the -w option#   ## of the ping command.#   # deadline = 10##   ## Interface or source address to send ping from.  Operates like the -I or -S#   ## option of the ping command.#   # interface = ""##   ## Percentiles to calculate. This only works with the native method.#   # percentiles = [50, 95, 99]##   ## Specify the ping executable binary.#   # binary = "ping"##   ## Arguments for ping command. When arguments is not empty, the command from#   ## the binary option will be used and other options (ping_interval, timeout,#   ## etc) will be ignored.#   # arguments = ["-c", "3"]##   ## Use only IPv6 addresses when resolving a hostname.#   # ipv6 = false

urls这个字段,可以写很多ip,Telegraf就会对这些ip发起ping探测,待会咱们写一个能连通的ip,一个不能连通的ip,测试下,method有两种取值,一个是exec,就是调用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值