我创建了一个在系统中运行的SystemD服务,我想使用我已经在实例上安装的Telegraf代理进行监视。
该代理商目前正在监视基本的基础内容,我需要将监视添加到新服务中。
我找不到有关如何做的示例,这很奇怪,我希望Telegraf为基本内容提供某种插件。
我的服务正在运行一个不会暴露任何端口的Python脚本,因此我可以进行普通的HTTP健康检查。
任何帮助将不胜感激。
I created a systemd service that is running in our system and I want to monitor it using a telegraf agent that I already have installed on the instance.
The Agent is currently monitoring the basic infra stuff and I need to add monitoring to the new service.
I couldn't find any example on how to do it which is strange, I would expect telegraf to have some sort of plugin for something that basic.
My service is running a python script that doesn't expose any port so I can do a normal HTTP health check.
any help will be appreciated.
发布评论
评论(1)
所以我发现确实有一个可以监视系统服务的插件,
该名称为 systemd_units 。
这是我实现的配置:
在InfluxDB中获取指标后,这是我用来提取所需数据的查询:
这就是Grafana中的样子:
So I found that indeed there is a plugin that monitors systems service,
The name is systemd_units.
This is the configuration I've implemented:
After getting the metrics in the influxDB This is the query I used to extract the data I needed:
And this is how it looks like in Grafana:
https://docs.influxdata.com/telegraf/v1.22/plugins/#systemd_units