Skip to content
Snippets Groups Projects
Unverified Commit 233e0c17 authored by Nico's avatar Nico
Browse files

add example output

parent 028b1998
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,12 @@ class ZyxelClient:
def collect(self):
slots = {}
"""
Router> show fqdn
host name : ffs01
domain name: none
FQDN : ffs01
"""
resp = self._run_cmd("show fqdn")
for line in resp.split("\n"):
line = line.strip()
......@@ -45,6 +51,23 @@ class ZyxelClient:
_, hostname = line.split(":", maxsplit=1)
hostname = hostname.strip()
"""
Router> show interface lan
active: yes
interface name: br0
description:
join count: 1
member: vlan88
IP type: dhcp
IP address: 192.168.88.61
netmask: 255.255.255.0
gateway: 192.168.88.252
metric: 0
MTU: 1500
MSS: 0
forward delay time: 0
stp: off
"""
resp = self._run_cmd("show interface lan")
for line in resp.split("\n"):
line = line.strip()
......@@ -95,6 +118,11 @@ class ZyxelClient:
uptime += 60 * int(up_minutes)
uptime += int(up_seconds)
"""
Router> show wireless-hal current channel
Slot1: 9 (20 MHz)
Slot2: 104 (40 MHz)
"""
resp = self._run_cmd("show wireless-hal current channel")
for line in resp.split("\n"):
line = line.strip()
......@@ -107,7 +135,13 @@ class ZyxelClient:
slots[slot]["hostname"] = hostname
slots[slot]["ip"] = ip
slots[slot]["uptime"] = uptime
slots[slot]["location"] = location
"""
Router> show wireless-hal station number
Slot1: 8
Slot2: 38
"""
resp = self._run_cmd("show wireless-hal station number")
for line in resp.split("\n"):
line = line.strip()
......@@ -115,6 +149,27 @@ class ZyxelClient:
slot, client_count = line.split(":", maxsplit=2)
slots[slot]["client_count"] = int(client_count.strip())
"""
Router> show wireless-hal statistic
Slot: 1
ReceivedPktCount: 2718430
TransmittedPktCount: 1875083
wlanReceivedByte: 384667289
wlanTransmittedByte: 1954443927
RetryCount: 0
FCSErrorCount: 1560481
TxPower: 19
Channel Utilization: 37
Slot: 2
ReceivedPktCount: 3377503
TransmittedPktCount: 3073845
wlanReceivedByte: 1567639988
wlanTransmittedByte: 3247054240
RetryCount: 0
FCSErrorCount: 2186819
TxPower: 26
Channel Utilization: 21
"""
resp = self._run_cmd("show wireless-hal statistic")
current_slot = ""
for line in resp.split("\n"):
......@@ -128,6 +183,7 @@ class ZyxelClient:
_, util = line.split(":", maxsplit=2)
slots[current_slot]["util"] = int(util.strip())
statobjs = []
for slot, stats in slots.items():
if stats["channel"] in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment