1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

Copy powerdns-recursor to snmp and remove <<<powerdns-recursor>>> header (#111)

This commit is contained in:
Tony Murray
2017-03-29 19:11:23 -05:00
committed by GitHub
parent 74faec281c
commit a7fe1f8e6f

12
snmp/powerdns-recursor Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/python
import json, subprocess
from subprocess import Popen, PIPE
input = Popen(['rec_control', 'get-all'], stdout=PIPE).communicate()[0]
data = []
for line in input.splitlines():
item = line.split()
data.append({'name': item[0].decode(), 'value': int(item[1].decode())})
print(json.dumps(data))