mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
23 lines
573 B
Python
Executable file
23 lines
573 B
Python
Executable file
|
|
# https://192.168.1.10/Info.live.htm
|
|
|
|
import os
|
|
import re
|
|
import urllib.request
|
|
from vendor.munin import MuninPlugin
|
|
|
|
class DDWrtPlugin(MuninPlugin):
|
|
category = "Wireless"
|
|
|
|
def __init__(self):
|
|
super(DDWrtPlugin, self).__init__()
|
|
self.root_url = os.environ.get('DDWRT_URL') or "http://192.168.1.1"
|
|
self.url = self.root_url + "/Info.live.htm"
|
|
|
|
def get_info(self):
|
|
res = urllib.request.urlopen(self.url)
|
|
text = res.read()
|
|
return dict(
|
|
x[1:-1].split('::')
|
|
for x in text.split('\n')
|
|
)
|