diff --git a/zyxel.py b/zyxel.py index 22de703e7838f20d7858ae5cb71d2dab7e1b3d4f..2b30dee1c7b96b6f66c64288f58a72b065bdb2bc 100644 --- a/zyxel.py +++ b/zyxel.py @@ -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"]: