python编写ocx插件_如何使用Python编写收集的插件

python编写ocx插件

Collectd is a system statistics collection daemon. It gathers a lot of information about the system it’s running on, and passes it on to a software that can process and visualize that information, e.g. Grafana.

Collectd是一个系统的统计信息收集守护进程。 它收集了大量有关正在运行的系统的信息,并将其传递给可以处理和可视化该信息的软件,例如Grafana

Collectd already brings along a lot of built-in plugins to gather information about the system load, the network traffic, available entropy, various sensors, etc. But sometimes there’s a value that you want to log which is not covered by an existing plugin.

Collected已经带来了许多内置插件,以收集有关系统负载,网络流量,可用熵,各种传感器等的信息。但是有时您要记录的值不存在于现有插件中。

There’s a generic plugin called Exec, but it has the downside that a new process is spawned for every invocation. That leads to bad performance if a value is queried often.

有一个名为Exec的通用插件,但缺点是每次调用都会产生一个新进程。 如果经常查询某个值,则会导致性能下降。

But there’s another way to include custom scripts, which is the Python plugin. In contrast to Exec, it does not spawn a new process for each invocation. Instead, it loads the specified Python script with an embedded interpreter. This makes it more powerful and efficient.

但是还有另一种包含自定义脚本的方法,那就是Python插件。 与Exec相比,它不会为每次调用生成新的进程。 相反,它将使用嵌入式解释器加载指定的Python脚本。 这使其功能更强大,效率更高。

In this post, we’ll walk through the process of writing a collectd Python plugin for measuring the Raspberry Pi CPU temperature.

在本文中,我们将逐步完成编写收集的Python插件以测量Raspberry Pi CPU温度的过程。

插件结构 (Plugin Structure)

A Python plugin can register various c

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值