我正在尝试设置电讯报在普罗克斯莫克斯(基于 Debian 的发行版)将指标发送到流入数据库。但是,它似乎在抱怨 sysstat 语法。
我正在使用Telegraf 中的 sysstat 插件。
根据配置文件,我有一个这样的部分
# ## sysstat version.
# [inputs.sysstat.options]
# -C = "cpu"
# -B = "paging"
# -b = "io"
# -d = "disk" # requires DISK activity
"-n ALL" = "network"
# "-P ALL" = "per_cpu"
# -q = "queue"
# -R = "mem"
-r = "mem_util"
# -S = "swap_util"
# -u = "cpu_util"
# -v = "inode"
# -W = "swap"
# -w = "task"
# # -H = "hugepages" # only available for newer linux distributions
# # "-I ALL" = "interrupts" # requires INT activity
但是,这些选项似乎出了错误:
root@syd1:/var/run/ceph# telegraf --test
2019-03-15T07:56:35Z I! Starting Telegraf 1.10.0
2019-03-15T07:56:35Z I! Using config file: /etc/telegraf/telegraf.conf
2019-03-15T07:56:35Z E! [telegraf] Error running agent: Error parsing /etc/telegraf/telegraf.conf, line 3845: field corresponding to `-n ALL' is not defined in `*sysstat.Sysstat'
但如果我运行sysstat -h
,我会看到:
root@syd1:/var/run/ceph# sar -h
Usage: sar [ options ] [ <interval> [ <count> ] ]
Main options and reports:
-B Paging statistics
-b I/O and transfer rate statistics
-d Block devices statistics
-F [ MOUNT ]
Filesystems statistics
-H Hugepages utilization statistics
-I { <int> | SUM | ALL | XALL }
Interrupts statistics
-m { <keyword> [,...] | ALL }
Power management statistics
Keywords are:
CPU CPU instantaneous clock frequency
FAN Fans speed
FREQ CPU average clock frequency
IN Voltage inputs
TEMP Devices temperature
USB USB devices plugged into the system
-n { <keyword> [,...] | ALL }
Network statistics
Keywords are:
DEV Network interfaces
EDEV Network interfaces (errors)
NFS NFS client
NFSD NFS server
SOCK Sockets (v4)
IP IP traffic (v4)
EIP IP traffic (v4) (errors)
ICMP ICMP traffic (v4)
EICMP ICMP traffic (v4) (errors)
TCP TCP traffic (v4)
ETCP TCP traffic (v4) (errors)
UDP UDP traffic (v4)
SOCK6 Sockets (v6)
IP6 IP traffic (v6)
EIP6 IP traffic (v6) (errors)
ICMP6 ICMP traffic (v6)
EICMP6 ICMP traffic (v6) (errors)
UDP6 UDP traffic (v6)
FC Fibre channel HBAs
-q Queue length and load average statistics
-R Memory statistics
-r [ ALL ]
Memory utilization statistics
-S Swap space utilization statistics
-u [ ALL ]
CPU utilization statistics
-v Kernel tables statistics
-W Swapping statistics
-w Task creation and system switching statistics
-y TTY devices statistics
因此,类似-d
或-n ALL
是可用的。
知道发生什么事了吗?
答案1
哎呀,这实际上是我的配置文件中的语法错误。具体来说,我需要取消注释以下行:
[输入.sysstat.选项]
就在
# -C = "cpu"
# -B = "paging"
# -b = "io"
-d = "disk" # requires DISK activity
"-n ALL" = "network"
# "-P ALL" = "per_cpu"
# -q = "queue"
# -R = "mem"
-r = "mem_util"
# -S = "swap_util"
# -u = "cpu_util"
# -v = "inode"
# -W = "swap"
# -w = "task"
# # -H = "hugepages" # only available for newer linux distributions
# # "-I ALL" = "interrupts" # requires INT activity
如果没有它,它就无法正确解析上述行。