Commit c146fcc7 authored by Dmitry Lukhtionov's avatar Dmitry Lukhtionov Committed by Andrey Vertiprahov
Browse files

Update Cisco.IOS profile to support old hardware

parent 41243719
......@@ -2,7 +2,7 @@
# ---------------------------------------------------------------------
# Cisco.IOS.get_chassis_id
# ---------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
......@@ -121,7 +121,7 @@ class Script(BaseScript):
7200, 7301
:return:
"""
v = self.cli("show c%s | i MAC" % self.version["platform"])
v = self.cli("show c%s00 | i MAC" % self.version["platform"][:2])
macs = []
for f, t in [
(mac, MAC(mac).shift(int(count) - 1)) for count, mac in self.rx_7200.findall(v)
......
......@@ -2,7 +2,7 @@
# ---------------------------------------------------------------------
# Cisco.IOS.get_inventory
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
......@@ -373,6 +373,15 @@ class Script(BaseScript):
and "Supervisor Engine" in descr
):
return "SUP", self.slot_id, pid
if pid.startswith("PA-"):
# Port Adapter
return "PA", self.slot_id, pid
if "I/O Controller" in descr:
# I/O controller directly attached to chassis, without container
match = self.rx_slot_id.search(name)
if match:
return "IO", match.group("slot_id"), pid
return "IO", self.slot_id, pid
else:
if pid == "N/A" and "Gibraltar,G-20" in descr:
# 2-port 100BASE-TX Fast Ethernet port adapter
......@@ -483,6 +492,9 @@ class Script(BaseScript):
elif "Compact Flash Disk" in descr:
# Compact Flash
return "Flash | CF", name, pid
elif "PCMCIA Flash Disk" in descr:
# PCMCIA Flash
return "Flash | PCMCIA", name, pid
# Unknown
return None, None, None
......
......@@ -3,7 +3,7 @@
# Vendor: Cisco
# OS: IOS
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
......@@ -56,7 +56,7 @@ class Profile(BaseProfile):
rx_ver = re.compile(r"(\d+)\.(\d+)[\(.](\d+)[\).]\S*")
matchers = {
"is_platform_7200": {"platform": {"$regex": r"7200|7301"}},
"is_platform_7200": {"platform": {"$regex": r"720[0146]|730[14]"}},
"is_platform_7600": {"platform": {"$regex": r"76(0[3459](\-S)?|13)"}},
"is_platform_me3x00x": {"platform": {"$regex": r"^ME\-3[68]00X"}},
"is_isr_router": {"platform": {"$regex": r"^(19\d\d|29\d\d|39\d\d)$"}},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment