categraf ident标签

Viewed 67

categraf 采集数据,使用ansible批量部署的categraf能动态采集机器的ident= hostname名吗

2 Answers

用ansible playbook实现将config.toml中的$ip替换成本机hostname

ident其实就是global中的hostname的值

[global]
# whether print configs
print_configs = false

# add label(agent_hostname) to series
# "" -> auto detect hostname
# "xx" -> use specified string xx
# "$hostname" -> auto detect hostname
# "$ip" -> auto detect ip
# "$hostname-$ip" -> auto detect hostname and ip to replace the vars
hostname = "$ip"