Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New template for NGFW FortiGate #1872

Merged
merged 15 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
#
# Pavel Pestov
#
# 2024-10-09: Inital Version
#
# SW Version: 7.0.15
# HW : FortiGate-40F
# Mode : HA A-P
# VDOMS : DISABLE
#
# Neighbors : Huawei CloudEngine S5735-L Series Switches, HPE Aruba 2530 Series Switches, Cisco Catalyst 3000 Series Switches, Cisco Nexus 3000 Series Switches
#
# The number of parameters may vary depending on the type of neighbor
#
Value PORT (\S+)
Value PORT_TXT (\S+)
Value MAC_ADDRESS (\S+)

jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
Value CHASSIS_TYPE (\S+)
Value CHASSIS_TYPE_TXT (\S+)
Value CHASSIS_DATA (\S+)
Value PORT_ID_TYPE (\S+)
Value PORT_ID_TYPE_TXT (\S+)
Value PORT_ID_LEN (\S+)
Value PORT_ID_DATA (\S+)
Value TTL (\S+)
Value PORT_DESC_LEN (\S+)
Value PORT_DESC_DATA ([\S\s]+)
Value SYSTEM_NAME_LEN (\S+)
Value SYSTEM_NAME_DATA (\S+)
Value SYSTEM_DESC_LEN (\S+)
Value List SYSTEM_DESC_DATA ([^1][\S\s]+)
Value SYSTEM_CAPS_AVAILABLE (\S+)
Value SYSTEM_CAPS_AVAILABLE_TXT ([\S\s]+)
Value SYSTEM_CAPS_ENABLED (\S+)
Value SYSTEM_CAPS_ENABLED_TXT ([\S\s]+)
Value ADDRESS_COUNT (\S+)
Value ADDRESS_1_TYPE (\S+)
Value ADDRESS_1_TYPE_TXT (\S+)
Value ADDRESS_1_LEN (\S+)
Value ADDRESS_1_ADDR (\S+)
Value ADDRESS_1_ADDR_INTERFACE_TYPE (\S+)
Value ADDRESS_1_ADDR_INTERFACE_TYPE_TXT (\S+)
Value ADDRESS_1_ADDR_INTERFACE_NUMBER (\S+)
Value VLAN_ID (\S+)
Value VLAN_PROTOCOL_COUNT (\S+)
Value VLAN_PROTOCOL_1_FLAG (\S+)
Value VLAN_PROTOCOL_1_FLAG_TXT ([\S\s]*)
Value VLAN_PROTOCOL_1_ID (\S+)
Value VLAN_NAME_COUNT (\S+)
Value VLAN_NAME_1_ID (\S+)
Value VLAN_NAME_1_LEN (\S+)
Value VLAN_NAME_1_DATA ([\S\s]+)
Value AGGREGATION_STATUS (\S+)
Value AGGREGATION_STATUS_TXT (\S+)
Value AGGREGATION_PORT (\S+)
Value MAC_PHY_AUTO (\S+)
Value MAC_PHY_AUTO_TXT ([\S\s]+)
Value MAC_PHY_PMD (\S+)
Value MAC_PHY_PMD_TXT ([\S\s]+)
Value MAC_PHY_MAU (\S+)
Value MAC_PHY_MAU_TXT (\S+)
Value POWER_STATUS (\S+)
Value POWER_STATUS_TXT (\S+)
Value POWER_PAIR (\S+)
Value POWER_CLASS (\S+)
Value MAX_FRAME_SIZE (\S+)

Start
^1\s+port:\s+${PORT}
^1\s+port\.txt:\s+${PORT_TXT}
^1\s+mac:\s+${MAC_ADDRESS}

jmcgill298 marked this conversation as resolved.
Show resolved Hide resolved
^1\s+chassis\.type:\s+${CHASSIS_TYPE}
^1\s+chassis\.type\.txt:\s+${CHASSIS_TYPE_TXT}
^1\s+chassis\.data:\s+${CHASSIS_DATA}
^1\s+port\.id\.type:\s+${PORT_ID_TYPE}
^1\s+port\.id\.type\.txt:\s+${PORT_ID_TYPE_TXT}
^1\s+port\.id\.len:\s+${PORT_ID_LEN}
^1\s+port\.id\.data:\s+${PORT_ID_DATA}
^1\s+ttl:\s+${TTL}
^1\s+port\.desc\.len:\s+${PORT_DESC_LEN}
^1\s+port\.desc\.data:\s+${PORT_DESC_DATA}
^1\s+system\.name\.len:\s+${SYSTEM_NAME_LEN}
^1\s+system\.name\.data:\s+${SYSTEM_NAME_DATA}
^1\s+system\.desc\.len:\s+${SYSTEM_DESC_LEN}
^1\s+system\.desc\.data:\s+${SYSTEM_DESC_DATA} -> MultipleLines
^1\s+system\.caps\.available:\s+${SYSTEM_CAPS_AVAILABLE}
^1\s+system\.caps\.available\.txt:\s+${SYSTEM_CAPS_AVAILABLE_TXT}
^1\s+system\.caps\.enabled:\s+${SYSTEM_CAPS_ENABLED}
^1\s+system\.caps\.enabled\.txt:\s+${SYSTEM_CAPS_ENABLED_TXT}
^1\s+address\.count:\s+${ADDRESS_COUNT}
^1\s+address\.1\.type:\s+${ADDRESS_1_TYPE}
^1\s+address\.1\.type\.txt:\s+${ADDRESS_1_TYPE_TXT}
^1\s+address\.1\.len:\s+${ADDRESS_1_LEN}
^1\s+address\.1\.addr:\s+${ADDRESS_1_ADDR}
^1\s+address\.1\.addr\.interface\.type:\s+${ADDRESS_1_ADDR_INTERFACE_TYPE}
^1\s+address\.1\.addr\.interface\.type\.txt:\s+${ADDRESS_1_ADDR_INTERFACE_TYPE_TXT}
^1\s+address\.1\.addr\.interface\.number:\s+${ADDRESS_1_ADDR_INTERFACE_NUMBER}
^1\s+vlan\.id:\s+${VLAN_ID}
^1\s+vlan\.protocol\.count:\s+${VLAN_PROTOCOL_COUNT}
^1\s+vlan\.protocol\.1\.flag:\s+${VLAN_PROTOCOL_1_FLAG}
^1\s+vlan\.protocol\.1\.flag\.txt:\s*${VLAN_PROTOCOL_1_FLAG_TXT}
^1\s+vlan\.protocol\.1\.id:\s+${VLAN_PROTOCOL_1_ID}
^1\s+vlan\.name\.count:\s+${VLAN_NAME_COUNT}
^1\s+vlan\.name\.1\.id:\s+${VLAN_NAME_1_ID}
^1\s+vlan\.name\.1\.len:\s+${VLAN_NAME_1_LEN}
^1\s+vlan\.name\.1\.data:\s+${VLAN_NAME_1_DATA}
^1\s+aggregation\.status:\s+${AGGREGATION_STATUS}
^1\s+aggregation\.status\.txt:\s+${AGGREGATION_STATUS_TXT}
^1\s+aggregation\.port:\s+${AGGREGATION_PORT}
^1\s+mac_phy\.auto:\s+${MAC_PHY_AUTO}
^1\s+mac_phy\.auto\.txt:\s+${MAC_PHY_AUTO_TXT}
^1\s+mac_phy\.pmd:\s+${MAC_PHY_PMD}
^1\s+mac_phy\.pmd\.txt:\s+${MAC_PHY_PMD_TXT}
^1\s+mac_phy\.mau:\s+${MAC_PHY_MAU}
^1\s+mac_phy\.mau\.txt:\s+${MAC_PHY_MAU_TXT}
^1\s+power\.status:\s+${POWER_STATUS}
^1\s+power\.status\.txt:\s+${POWER_STATUS_TXT}
^1\s+power\.pair:\s+${POWER_PAIR}
^1\s+power\.class:\s+${POWER_CLASS}
^1\s+max-frame-size:\s+${MAX_FRAME_SIZE}
# Processing possible new information to eliminate errors
^1\s+[\S\s]+
^\s*$$
^. -> Error

MultipleLines
^${SYSTEM_DESC_DATA}
^1\s+system\.caps\.available:\s+${SYSTEM_CAPS_AVAILABLE} -> Start
pnpestov marked this conversation as resolved.
Show resolved Hide resolved
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ fortinet_get_system_arp.textfsm, .*, fortinet, g[[et]] sy[[stem]] arp
fortinet_execute_date.textfsm, .*, fortinet, exec[[ute]] da[[te]]
fortinet_execute_ping.textfsm, .*, fortinet, exec[[ute]] ping
fortinet_execute_time.textfsm, .*, fortinet, exec[[ute]] ti[[me]]
fortinet_diagnose_lldprx_port_neighbor_details_port-name.textfsm, .*, fortinet, d[[iagnose]] lldpr[[x]] p[[ort]] n[[eighbor]] d[[etails]] (\S+)

hp_comware_display_lldp_neighbor-information_verbose.textfsm, .*, hp_comware, di[[splay]] ll[[dp]] n[[eighbor-information]] v[[erbose]]
hp_comware_display_lldp_neighbor-information_list.textfsm, .*, hp_comware, di[[splay]] ll[[dp]] n[[eighbor-information]] l[[ist]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
1 port: 6
1 port.txt: lan1
1 mac: 00:11:22:33:44:55
1 chassis.type: 4
1 chassis.type.txt: interface-mac
1 chassis.data: 00:11:22:33:44:55
1 port.id.type: 5
1 port.id.type.txt: interface-name
1 port.id.len: 20
1 port.id.data: GigabitEthernet1/0/5
1 ttl: 120
1 port.desc.len: 10
1 port.desc.data: Port
1 system.name.len: 15
1 system.name.data: Switch
1 system.desc.len: 179
1 system.desc.data: Huawei Switch S5735-L48T4S-A1
Huawei Versatile Routing Platform Software
VRP (R) software, Version 5.170 (S5735 V200R022C00SPC500)
Copyright (C) 2000-2022 HUAWEI TECH Co., Ltd.
1 system.caps.available: 0014
1 system.caps.available.txt: bridge router
1 system.caps.enabled: 0014
1 system.caps.enabled.txt: bridge router
1 address.count: 1
1 address.1.type: 1
1 address.1.type.txt: ipv4
1 address.1.len: 4
1 address.1.addr: aaa.bbb.ccc.ddd
1 address.1.addr.interface.type: 2
1 address.1.addr.interface.type.txt: if-index
1 address.1.addr.interface.number: 269
1 vlan.id: 1
1 vlan.protocol.count: 1
1 vlan.protocol.1.flag: 0
1 vlan.protocol.1.flag.txt:
1 vlan.protocol.1.id: 0
1 vlan.name.count: 1
1 vlan.name.1.id: 1
1 vlan.name.1.len: 9
1 vlan.name.1.data: VLAN 0001
1 aggregation.status: 1
1 aggregation.status.txt: capable
1 aggregation.port: 0
1 mac_phy.auto: 3
1 mac_phy.auto.txt: supported enabled
1 mac_phy.pmd: 7c05
1 mac_phy.pmd.txt: 10BaseT 10BaseTFD 100BaseT4 100BaseTX 100baseTXFD 1000baseXFd
1 mac_phy.mau: 001e
1 mac_phy.mau.txt: 1000baseTFD
1 power.status: 0
1 power.status.txt: PD
1 power.pair: 0
1 power.class: 0
1 max-frame-size: 10240

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---

Check failure on line 1 in tests/fortinet/diagnose_lldprx_port_neighbor_details_port-name/fortinet_diagnose_lldprx_port_neighbor_details_port-name.yml

View workflow job for this annotation

GitHub Actions / yamllint

1:4 [new-lines] wrong new line character: expected \n
parsed_sample:
- address_1_addr: "aaa.bbb.ccc.ddd"
address_1_addr_interface_number: "269"
address_1_addr_interface_type: "2"
address_1_addr_interface_type_txt: "if-index"
address_1_len: "4"
address_1_type: "1"
address_1_type_txt: "ipv4"
address_count: "1"
aggregation_port: "0"
aggregation_status: "1"
aggregation_status_txt: "capable"
chassis_data: "00:11:22:33:44:55"
chassis_type: "4"
chassis_type_txt: "interface-mac"
mac_address: "00:11:22:33:44:55"
mac_phy_auto: "3"
mac_phy_auto_txt: "supported enabled"
mac_phy_mau: "001e"
mac_phy_mau_txt: "1000baseTFD"
mac_phy_pmd: "7c05"
mac_phy_pmd_txt: "10BaseT 10BaseTFD 100BaseT4 100BaseTX 100baseTXFD 1000baseXFd"
max_frame_size: "10240"
port: "6"
port_desc_data: "Port"
port_desc_len: "10"
port_id_data: "GigabitEthernet1/0/5"
port_id_len: "20"
port_id_type: "5"
port_id_type_txt: "interface-name"
port_txt: "lan1"
power_class: "0"
power_pair: "0"
power_status: "0"
power_status_txt: "PD"
system_caps_available: "0014"
system_caps_available_txt: "bridge router"
system_caps_enabled: "0014"
system_caps_enabled_txt: "bridge router"
system_desc_data:
- "Huawei Switch S5735-L48T4S-A1"
- "Huawei Versatile Routing Platform Software"
- "VRP (R) software, Version 5.170 (S5735 V200R022C00SPC500)"
- "Copyright (C) 2000-2022 HUAWEI TECH Co., Ltd."
system_desc_len: "179"
system_name_data: "Switch"
system_name_len: "15"
ttl: "120"
vlan_id: "1"
vlan_name_1_data: "VLAN 0001"
vlan_name_1_id: "1"
vlan_name_1_len: "9"
vlan_name_count: "1"
vlan_protocol_1_flag: "0"
vlan_protocol_1_flag_txt: ""
vlan_protocol_1_id: "0"
vlan_protocol_count: "1"
Loading