1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00
Jellyfrog 61064dc9fe Cleanup some code (#355)
* Format with isort

* Format with Black

* Fix CRLF

* Format with shellcheck

* Fix some warning

* Fix PHP style

* Dont modifiy check_mk files

* Fixes
2021-03-18 12:24:30 +01:00

15 lines
362 B
Python
Executable File

#!/usr/bin/env python3
import json
import subprocess
from subprocess import PIPE, Popen
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("<<<powerdns-recursor>>>")
print(json.dumps(data))