add bundle:telegraf_airgradient

This commit is contained in:
Franzi 2024-01-23 09:30:13 +01:00
parent bb56f0fb9a
commit 5ffbe50b1e
Signed by: kunsi
GPG key ID: 12E3D2136B818350
4 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,19 @@
@metadata_reactor.provides(
'telegraf/input_plugins/exec',
)
def telegraf(metadata):
result = {}
for location, api_key in metadata.get('telegraf_airgradient', {}).items():
result[f'airgradient_{location}'] = {
'commands': [f'/usr/local/bin/airgradient_telegraf {location} {api_key}'],
'data_format': 'influx',
'timeout': '10s',
}
return {
'telegraf': {
'input_plugins': {
'exec': result,
},
},
}