diff --git a/sa/profiles/Cisco/IOS/get_chassis_id.py b/sa/profiles/Cisco/IOS/get_chassis_id.py index 8c5a057551804855da5fdf19e93c5f11d5337584..77ed65480f347696e6b6d93a70f721b5bad01cff 100644 --- a/sa/profiles/Cisco/IOS/get_chassis_id.py +++ b/sa/profiles/Cisco/IOS/get_chassis_id.py @@ -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) diff --git a/sa/profiles/Cisco/IOS/get_inventory.py b/sa/profiles/Cisco/IOS/get_inventory.py index 9c1dbc5a48b355a19e547f9d3b02e77e5f6b10db..122573d87dd4757453e14b276656b5ff233439e6 100644 --- a/sa/profiles/Cisco/IOS/get_inventory.py +++ b/sa/profiles/Cisco/IOS/get_inventory.py @@ -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 diff --git a/sa/profiles/Cisco/IOS/profile.py b/sa/profiles/Cisco/IOS/profile.py index 4cd8a2ae5054d13c60c46e5a999cbd203047eed9..f159f28610f0b35af0a66a204d8f61439b6b0f6d 100644 --- a/sa/profiles/Cisco/IOS/profile.py +++ b/sa/profiles/Cisco/IOS/profile.py @@ -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)$"}},