add bundle:telegraf-monitors-mikrotik
This commit is contained in:
parent
4bcf15a64c
commit
a27ac38bec
4 changed files with 93 additions and 6 deletions
22
bundles/telegraf-monitors-mikrotik/metadata.py
Normal file
22
bundles/telegraf-monitors-mikrotik/metadata.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
@metadata_reactor.provides(
|
||||
'telegraf/input_plugins/exec',
|
||||
)
|
||||
def collect_nodes(metadata):
|
||||
execs = {}
|
||||
|
||||
for rnode in repo.nodes_in_group('switches-mikrotik'):
|
||||
snmp_pw = rnode.metadata.get('routeros/snmp/community', 'public')
|
||||
|
||||
execs[f'snmp_mikrotik_{rnode.name}'] = {
|
||||
'commands': [f'/usr/local/bin/telegraf-plugin-snmp-mikrotik {rnode.name} {rnode.hostname} {snmp_pw}'],
|
||||
'data_format': 'influx',
|
||||
'timeout': '30s',
|
||||
}
|
||||
|
||||
return {
|
||||
'telegraf': {
|
||||
'input_plugins': {
|
||||
'exec': execs,
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue