add bundle:telegraf_airgradient
This commit is contained in:
parent
bb56f0fb9a
commit
5ffbe50b1e
4 changed files with 80 additions and 0 deletions
19
bundles/telegraf_airgradient/metadata.py
Normal file
19
bundles/telegraf_airgradient/metadata.py
Normal 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,
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue