初探zabbix_agent2 plugin

本文介绍了zabbix_agent2的特性,强调其强大的监控能力和采用Go语言的插件化管理。通过实例展示了如何创建一个简单的插件,包括定义Plugin结构体、注册指标以及验证插件的正确性。zabbix_agent2的灵活性使得监控解决方案更加丰富。

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

概述

  • zabbix_agent2作为可以完全替代zabbix_agent功能的客户端,较以往的功能非常强大。
  • 采用go语言进行编写,插件化方式对监控的能力进行管理。
  • 一栈式代理能力,官方提供的5.2版本已经具有很强的监控能力

zabbix_agent2指标

  • 在代理运行的情况下,我们可以执行zabbix_agent2 -R metrics 获取当前代理所支持的指标,以及指标的运行情况
[Agent]
active: true
capacity: 0/100
tasks: 0
agent.hostname: Returns Hostname from agent configuration.
agent.ping: Returns agent availability check result.
agent.version: Version of Zabbix agent.

[Ceph]
active: false
capacity: 0/100
tasks: 0
ceph.df.details: Returns information about cluster’s data usage and distribution among pools.
ceph.osd.discovery: Returns a list of discovered OSDs.
ceph.osd.dump: Returns usage thresholds and statuses of OSDs.
ceph.osd.stats: Returns aggregated and per OSD statistics.
ceph.ping: Tests if a connection is alive or not.
ceph.pool.discovery: Returns a list of discovered pools.
ceph.status: Returns an overall cluster's status.

[Cpu]
active: true
capacity: 0/100
tasks: 12
system.cpu.discovery: List of detected CPUs/CPU cores, used for low-level discovery.
system.cpu.num: Number of CPUs.
system.cpu.util: CPU utilisation percentage.

[Docker]
active: false
capacity: 0/100
tasks: 0
docker.container_info: Return low-level information about a container.
docker.container_stats: Returns near realtime stats for a given container.
docker.containers: Returns a list of containers.
docker.containers.discovery: Returns a list of containers, used for low-level discovery.
docker.data_usage: Returns information about current data usage.
docker.images: Returns a list of images.
docker.images.discovery: Returns a list of images, used for low-level discovery.
docker.info: Returns information about the docker server.
docker.ping: Pings the server and returns 0 or 1.

[File]
active: true
capacity: 0/100
tasks: 3
vfs.file.cksum: Returns File checksum, calculated by the UNIX cksum algorithm.
vfs.file.contents: Retrieves contents of the file.
vfs.file.exists: Returns if file exists or not.
vfs.file.md5sum: Returns MD5 checksum of file.
vfs.file.regexp: Find string in a file.
vfs.file.regmatch: Find string in a file.
vfs.file.size: Returns file size.
vfs.file.time: Returns file time information.

[Kernel]
active: true
capacity: 0/100
tasks: 2
kernel.maxfiles: Returns maximum number of opened files supported by OS.
kernel.maxproc: Returns maximum number of processes supported by OS.

[Log]
active: false
capacity: 0/100
tasks: 0
log: Log file monitoring.
log.count: Count of matched lines in log file monitoring.
logrt: Log file monitoring with log rotation support.
logrt.count: Count of matched lines in log file monitoring with log rotation support.

[MQTT]
active: false
capacity: 0/100
tasks: 0
mqtt.get: Subscribe to MQTT topics for published messages.

[Memcached]
active: false
capacity: 0/100
tasks: 0
memcached.ping: Test if connection is alive or not.
memcached.stats: Returns output of stats command.

[Memory]
active: true
capacity: 0/100
tasks: 3
vm.memory.size: Returns memory size in bytes or in percentage from total.

[Modbus]
active: false
capacity: 0/100
tasks: 0
modbus.get: Returns a JSON array of the requested values, usage: modbus.get[endpoint,<slave id>,<function>,<address>,<count>,<type>,<endianness>,
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值