diff --git a/panos/firewall.py b/panos/firewall.py index cd5b9e1e..aafb7564 100644 --- a/panos/firewall.py +++ b/panos/firewall.py @@ -426,24 +426,27 @@ def show_system_resources(self): result = self.xapi.xml_root() if self._version_info >= (9, 0, 0): regex = re.compile( - r"load average: ([\d\.]+).*? ([\d\.]+) id,.*KiB Mem :\s+(\d+) total,.*? (\d+) free", + r"load average: ([\d\.]+).*? ([\d\.]+) id,.*KiB Mem :" + r"\s+(\d+) total,.*? (\d+) free.*? (\d+) used," + r".*? (\d+) buff/cache", re.DOTALL, ) else: regex = re.compile( - r"load average: ([\d.]+).* ([\d.]+)%id.*Mem:.*?([\d.]+)k total.*?([\d]+)k free", + r"load average: ([\d.]+).* ([\d.]+)%id.*" + r"Mem:.*?([\d.]+)k total.*?" + r"([\d]+)k free.*?([\d]+)k used.*?([\d]+)k buff/cache", re.DOTALL, ) match = regex.search(result) if match: - """ - return cpu, mem_free, load - """ return { "load": Decimal(match.group(1)), "cpu": 100 - Decimal(match.group(2)), "mem_total": int(match.group(3)), "mem_free": int(match.group(4)), + "mem_used": int(match.group(5)), + "mem_buffer": int(match.group(6)), } else: raise err.PanDeviceError(