diff --git a/agent_based/cisco_vpn_tunnel.py b/agent_based/cisco_vpn_tunnel.py index e528de2f0786bead619b02ee3bda6b303f3a53e9..912c365005fb227588023c408e54dad2b9eb0ef9 100644 --- a/agent_based/cisco_vpn_tunnel.py +++ b/agent_based/cisco_vpn_tunnel.py @@ -20,6 +20,9 @@ # IKE_OID_end and cipSecTunIkeTunnelIndex, try to match IPSec nad IKE sa by remote address # 2022-04-01: changed IPSec SA count output to check levels # 2022-12-17: check input values for isdigit() +# 2023-06-07: fixed ValueError (not enough values to unpack (expected 10, got 4)) in parse function (ipsec_tunnel_entry) +# 2023-06-07: fixed ValueError (not enough values to unpack (expected 18, got 4)) in parse function (ike_tunnel_entry) +# # snmpwalk sample # @@ -150,8 +153,12 @@ def parse_cisco_vpn_tunnel(string_table: List[StringTable]) -> Dict[str, IkeSa]: ike_tunnel_entry, ipsec_tunnel_entry = string_table # summarize IPSec SAs, ASSUMPTION: except for counters all SA attributes are identical per IKE index - for ike_tunnel_index, ike_tunnel_alive, tun_remote_addr, active_time, hc_in_octets, in_pkts, in_drop_pkts, \ - hc_out_octets, out_pkts, out_drop_pkts in ipsec_tunnel_entry: + for entry in ipsec_tunnel_entry: + try: + ike_tunnel_index, ike_tunnel_alive, tun_remote_addr, active_time, hc_in_octets, in_pkts, in_drop_pkts, \ + hc_out_octets, out_pkts, out_drop_pkts = entry + except ValueError: + continue if ike_tunnel_index.isdigit(): ipsec_sa = ipsec_sa_summary.setdefault( @@ -169,9 +176,13 @@ def parse_cisco_vpn_tunnel(string_table: List[StringTable]) -> Dict[str, IkeSa]: ipsec_sa.active_time = int(active_time) // 100 # IKE SA - for index, local_type, local_value, local_addr, local_name, remote_type, remote_value, remote_addr, remote_name, \ - active_time, in_octets, in_pkts, in_droppkts, out_octets, out_pkts, out_droppkts, status, \ - nego_mode in ike_tunnel_entry: + for entry in ike_tunnel_entry: + try: + index, local_type, local_value, local_addr, local_name, remote_type, remote_value, remote_addr, remote_name, \ + active_time, in_octets, in_pkts, in_droppkts, out_octets, out_pkts, out_droppkts, status, \ + nego_mode = entry + except ValueError: + continue if index.isdigit(): save_remote_addr = remote_addr diff --git a/cisco_vpn_tunnel-20221217.v0.3b.mkp b/cisco_vpn_tunnel-20221217.v0.3b.mkp new file mode 100644 index 0000000000000000000000000000000000000000..743a614e5663b0bd917141777e0b5944cbc32c67 Binary files /dev/null and b/cisco_vpn_tunnel-20221217.v0.3b.mkp differ diff --git a/cisco_vpn_tunnel.mkp b/cisco_vpn_tunnel.mkp index 7386e52caf27b7db42cc4dfbc45cdaef627fd004..743a614e5663b0bd917141777e0b5944cbc32c67 100644 Binary files a/cisco_vpn_tunnel.mkp and b/cisco_vpn_tunnel.mkp differ diff --git a/packages/cisco_vpn_tunnel b/packages/cisco_vpn_tunnel index 87606471cde29577bd829fd4470c4a5c05ced18b..0b250908024952d4768db7699e94bc9185897f2d 100644 --- a/packages/cisco_vpn_tunnel +++ b/packages/cisco_vpn_tunnel @@ -13,5 +13,5 @@ 'title': 'Monitor Cisco VPN Tunnel', 'version': '20221217.v0.3b', 'version.min_required': '2.0.0', - 'version.packaged': '2021.09.20', + 'version.packaged': '2.1.0p21', 'version.usable_until': None} \ No newline at end of file