mirror of
https://github.com/librenms/librenms-agent.git
synced 2024-05-09 09:54:52 +00:00
* Format with isort * Format with Black * Fix CRLF * Format with shellcheck * Fix some warning * Fix PHP style * Dont modifiy check_mk files * Fixes
41 lines
819 B
Python
Executable File
41 lines
819 B
Python
Executable File
#!/usr/bin/env python3
|
|
from subprocess import PIPE, Popen
|
|
|
|
kvars = [
|
|
"corrupt-packets",
|
|
"deferred-cache-inserts",
|
|
"deferred-cache-lookup",
|
|
"latency",
|
|
"packetcache-hit",
|
|
"packetcache-miss",
|
|
"packetcache-size",
|
|
"qsize-q",
|
|
"query-cache-hit",
|
|
"query-cache-miss",
|
|
"recursing-answers",
|
|
"recursing-questions",
|
|
"servfail-packets",
|
|
"tcp-answers",
|
|
"tcp-queries",
|
|
"timedout-packets",
|
|
"udp-answers",
|
|
"udp-queries",
|
|
"udp4-answers",
|
|
"udp4-queries",
|
|
"udp6-answers",
|
|
"udp6-queries",
|
|
]
|
|
|
|
rvars = {}
|
|
cmd = ["pdns_control", "show", "*"]
|
|
|
|
for l in Popen(cmd, stdout=PIPE).communicate()[0].decode().rstrip().split(","):
|
|
v = l.split("=")
|
|
if len(v) > 1:
|
|
rvars[v[0]] = v[1]
|
|
|
|
print("<<<app-powerdns>>>")
|
|
|
|
for k in kvars:
|
|
print(rvars[k])
|