Skip to content
Snippets Groups Projects
Commit 994eac76 authored by Kerri Wait's avatar Kerri Wait
Browse files

Add custom fact file for `hw_counters` fact in telegraf role

parent 386b079c
No related branches found
No related tags found
9 merge requests!399Capture extra NFS stats,!393Hotfix: monitor NFS GETATTR stats via telegraf,!392Temporarily disable inputs.filecount in telegraf,!389Update telegraf config to ignore more ethX interfaces in ethtool plugin,!388Fix the telegraf config for mlx hw counters to get rid of errors in logs,!387Telegraf 1.15 nvidia_smi fix,!386Telegraf 1.15 nvidia_smi plugin,!380Telegraf monitoring for Karaage (hpc.erc.monash.edu.au),!374Fix hw_counters for telegraf and enable ethtool telegraf plugin
This commit is part of merge request !380. Comments created here will be created in the context of that merge request.
#!/usr/bin/python3
import json
import os
def render_data(data):
return json.dumps(data)
device_name = 'mlx5_0'
hw_counters = {}
path = '/sys/class/infiniband/{}/ports/1/hw_counters/'.format(device_name)
hw_counters[device_name] = os.listdir(path)
print(render_data(hw_counters))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment