diff --git a/ntc_templates/templates/fortinet_get_system_ha_status.textfsm b/ntc_templates/templates/fortinet_get_system_ha_status.textfsm index 566fb253e0..49109e0a66 100644 --- a/ntc_templates/templates/fortinet_get_system_ha_status.textfsm +++ b/ntc_templates/templates/fortinet_get_system_ha_status.textfsm @@ -1,8 +1,8 @@ # -# FG Version: 5.6, 6.0, 6.2, 6.4 +# FG Version: 5.6, 6.0, 6.2, 6.4, 7.0 # HW : varied # -Value HA_HEALTH (\S+) +Value HA_HEALTH (\S+|.*) Value MODEL (\S+) Value HA_MODE ([\S\s]+) Value HA_GROUP (\S+) @@ -20,6 +20,7 @@ Value HA_SLAVE_UNIT_INDEX (\S+) Start ^HA\s+Health\s+Status:\s+${HA_HEALTH} + ^HA\s+Health\s+Status:$$ -> UnhealthyStatus ^Model:\s+${MODEL} ^Mode:\s+${HA_MODE} ^Group:\s+${HA_GROUP} @@ -35,6 +36,11 @@ Start ^System\s+Usage\s+stats: -> System_Usage_stats ^. -> Error "in-Start" +UnhealthyStatus + # semicolon necessary to anchor + ^${HA_HEALTH};$$ + ^Model:\s+${MODEL} -> Start + Configuration_Status ^System\s+Usage\s+stats: -> System_Usage_stats ^\s*\S+\([\S\s]+\):\s\S+$$ diff --git a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_5.6.yml b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_5.6.yml index 9c3c4a2448..fa011d9dee 100644 --- a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_5.6.yml +++ b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_5.6.yml @@ -1,17 +1,17 @@ --- parsed_sample: - - ha_health: "OK" - model: "FortiGate-200D" - ha_mode: "HA A-P" - ha_group: "0" + - cluster_state_changed_time: "2020-11-18 20:06:07" cluster_uptime: "913 days 6:17:44" - cluster_state_changed_time: "2020-11-18 20:06:07" - ha_session_pickup_status: "enable" - ha_session_pickup_delay: "disable" - ha_override_status: "disable" + ha_group: "0" + ha_health: "OK" + ha_master_unit_index: "0" ha_master_unit_name: "fgt_200d_b" - ha_slave_unit_name: "fgt_200d_a" ha_master_unit_serial: "FG200Dyyyyyyyyyy" - ha_slave_unit_serial: "FG200Dxxxxxxxxxx" - ha_master_unit_index: "0" + ha_mode: "HA A-P" + ha_override_status: "disable" + ha_session_pickup_delay: "disable" + ha_session_pickup_status: "enable" ha_slave_unit_index: "1" + ha_slave_unit_name: "fgt_200d_a" + ha_slave_unit_serial: "FG200Dxxxxxxxxxx" + model: "FortiGate-200D" diff --git a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.0.yml b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.0.yml index 39c97d1a12..02b16e163b 100644 --- a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.0.yml +++ b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.0.yml @@ -1,17 +1,17 @@ --- parsed_sample: - - ha_health: "OK" - model: "FortiGate-200D" - ha_mode: "HA A-P" - ha_group: "0" + - cluster_state_changed_time: "2019-08-16 11:08:27" cluster_uptime: "764 days 22:45:44" - cluster_state_changed_time: "2019-08-16 11:08:27" - ha_session_pickup_status: "enable" - ha_session_pickup_delay: "disable" - ha_override_status: "enable" + ha_group: "0" + ha_health: "OK" + ha_master_unit_index: "1" ha_master_unit_name: "fgt-200d_a" - ha_slave_unit_name: "fgt-200d_b" ha_master_unit_serial: "FG200Dxxxxxxxxxx" - ha_slave_unit_serial: "FG200Dyyyyyyyyyy" - ha_master_unit_index: "1" + ha_mode: "HA A-P" + ha_override_status: "enable" + ha_session_pickup_delay: "disable" + ha_session_pickup_status: "enable" ha_slave_unit_index: "0" + ha_slave_unit_name: "fgt-200d_b" + ha_slave_unit_serial: "FG200Dyyyyyyyyyy" + model: "FortiGate-200D" diff --git a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.0_noha.yml b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.0_noha.yml index 06eb1163a2..1b0ecf8358 100644 --- a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.0_noha.yml +++ b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.0_noha.yml @@ -1,17 +1,17 @@ --- parsed_sample: - - ha_health: "OK" - model: "FortiGate-60D" - ha_mode: "Standalone" - ha_group: "0" + - cluster_state_changed_time: "N/A" cluster_uptime: "0 days 0:0:0" - cluster_state_changed_time: "N/A" - ha_session_pickup_status: "enable" - ha_session_pickup_delay: "disable" - ha_override_status: "enable" + ha_group: "0" + ha_health: "OK" + ha_master_unit_index: "" ha_master_unit_name: "" - ha_slave_unit_name: "" ha_master_unit_serial: "" - ha_slave_unit_serial: "" - ha_master_unit_index: "" + ha_mode: "Standalone" + ha_override_status: "enable" + ha_session_pickup_delay: "disable" + ha_session_pickup_status: "enable" ha_slave_unit_index: "" + ha_slave_unit_name: "" + ha_slave_unit_serial: "" + model: "FortiGate-60D" diff --git a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.2.yml b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.2.yml index ee3f1a6d44..6c5b3a1667 100644 --- a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.2.yml +++ b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.2.yml @@ -1,17 +1,17 @@ --- parsed_sample: - - ha_health: "OK" - model: "FortiGate-600E" - ha_mode: "HA A-P" - ha_group: "5" + - cluster_state_changed_time: "2020-12-02 22:40:46" cluster_uptime: "36 days 22:20:40" - cluster_state_changed_time: "2020-12-02 22:40:46" - ha_session_pickup_status: "enable" - ha_session_pickup_delay: "disable" - ha_override_status: "enable" + ha_group: "5" + ha_health: "OK" + ha_master_unit_index: "1" ha_master_unit_name: "fgt-600e_a" - ha_slave_unit_name: "fgt-600e_b" ha_master_unit_serial: "FG6H0Exxxxxxxxxx" - ha_slave_unit_serial: "FG6H0Eyyyyyyyyyy" - ha_master_unit_index: "1" + ha_mode: "HA A-P" + ha_override_status: "enable" + ha_session_pickup_delay: "disable" + ha_session_pickup_status: "enable" ha_slave_unit_index: "0" + ha_slave_unit_name: "fgt-600e_b" + ha_slave_unit_serial: "FG6H0Eyyyyyyyyyy" + model: "FortiGate-600E" diff --git a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.4.yml b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.4.yml index 0ef6d22d4f..b1a87717b5 100644 --- a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.4.yml +++ b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_6.4.yml @@ -1,17 +1,17 @@ --- parsed_sample: - - ha_health: "OK" - model: "FortiGate" - ha_mode: "HA A-P" - ha_group: "0" + - cluster_state_changed_time: "2021-10-12 11:24:28" cluster_uptime: "40 days 19:16:5" - cluster_state_changed_time: "2021-10-12 11:24:28" - ha_session_pickup_status: "enable" - ha_session_pickup_delay: "disable" - ha_override_status: "disable" + ha_group: "0" + ha_health: "OK" + ha_master_unit_index: "0" ha_master_unit_name: "FW" - ha_slave_unit_name: "FW" ha_master_unit_serial: "FGXXXXXXXXXXXXXX" - ha_slave_unit_serial: "FGXXXXXXXXXXXXXX" - ha_master_unit_index: "0" + ha_mode: "HA A-P" + ha_override_status: "disable" + ha_session_pickup_delay: "disable" + ha_session_pickup_status: "enable" ha_slave_unit_index: "1" + ha_slave_unit_name: "FW" + ha_slave_unit_serial: "FGXXXXXXXXXXXXXX" + model: "FortiGate" diff --git a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_7.0_unhealthy.raw b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_7.0_unhealthy.raw new file mode 100644 index 0000000000..23bfd534c8 --- /dev/null +++ b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_7.0_unhealthy.raw @@ -0,0 +1,40 @@ +HA Health Status: +WARNING: FGT40FYYYYYYYYYY has mondev down; +Model: FortiGate-40F +Mode: HA A-P +Group: 172 +Debug: 0 +Cluster Uptime: 63 days 22:15:42 +Cluster state change time: 2024-02-11 15:25:27 +Primary selected using: +<2024/02/11 15:25:27> FGT40FXXXXXXXXXX is selected as the primary because the value 0 of link-failure + pingsvr-failure is less than peer member FGT40FYYYYYYYYYY. +ses_pickup: enable, ses_pickup_delay=disable +override: enable +Configuration Status: +FGT40FXXXXXXXXXX(updated 0 seconds ago): in-sync +FGT40FYYYYYYYYYY(updated 0 seconds ago): in-sync +System Usage stats: +FGT40FXXXXXXXXXX(updated 0 seconds ago): +sessions=768, average-cpu-user/nice/system/idle=0%/0%/0%/99%, memory=35% +FGT40FYYYYYYYYYY(updated 0 seconds ago): +sessions=634, average-cpu-user/nice/system/idle=0%/0%/0%/100%, memory=31% +HBDEV stats: +FGT40FXXXXXXXXXX(updated 0 seconds ago): +lan2: physical/1000auto, up, rx-bytes/packets/dropped/errors=9997131732/27616386/0/0, tx=10080077920/27616652/0/0 +lan3: physical/1000auto, up, rx-bytes/packets/dropped/errors=11772621099/36693306/0/0, tx=26151306122/60128423/0/0 +FGT40FYYYYYYYYYY(updated 0 seconds ago): +lan2: physical/1000auto, up, rx-bytes/packets/dropped/errors=10080077920/27616652/0/0, tx=9997131732/27616386/0/0 +lan3: physical/1000auto, up, rx-bytes/packets/dropped/errors=26151777728/60128423/0/0, tx=11771044717/36693306/0/0 +MONDEV stats: +FGT40FXXXXXXXXXX(updated 0 seconds ago): +lan1: physical/100auto, up, rx-bytes/packets/dropped/errors=535463275509/3388288017/0/0, tx=3023591767050/4114831127/0/0 +wan: physical/100auto, up, rx-bytes/packets/dropped/errors=3314385262333/4439875482/0/0, tx=768352772861/3445252569/0/0 +FGT40FYYYYYYYYYY(updated 0 seconds ago): +lan1: physical/00, down, rx-bytes/packets/dropped/errors=0/0/0/0, tx=0/0/0/0 +wan: physical/100auto, up, rx-bytes/packets/dropped/errors=15792718293/245544650/0/0, tx=0/0/0/0 +Primary : FGT-fw-a, FGT40FXXXXXXXXXX, HA cluster index = 1 +Secondary : FGT-fw-b, FGT40FYYYYYYYYYY, HA cluster index = 0 +number of vcluster: 1 +vcluster 1: work 169.254.0.2 +Primary: FGT40FXXXXXXXXXX, HA operating index = 0 +Secondary: FGT40FYYYYYYYYYY, HA operating index = 1 diff --git a/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_7.0_unhealthy.yml b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_7.0_unhealthy.yml new file mode 100644 index 0000000000..c0c2527872 --- /dev/null +++ b/tests/fortinet/get_system_ha_status/fortinet_get_system_ha_status_7.0_unhealthy.yml @@ -0,0 +1,17 @@ +--- +parsed_sample: + - cluster_state_changed_time: "2024-02-11 15:25:27" + cluster_uptime: "63 days 22:15:42" + ha_group: "172" + ha_health: "WARNING: FGT40FYYYYYYYYYY has mondev down" + ha_master_unit_index: "1" + ha_master_unit_name: "FGT-fw-a" + ha_master_unit_serial: "FGT40FXXXXXXXXXX" + ha_mode: "HA A-P" + ha_override_status: "enable" + ha_session_pickup_delay: "disable" + ha_session_pickup_status: "enable" + ha_slave_unit_index: "0" + ha_slave_unit_name: "FGT-fw-b" + ha_slave_unit_serial: "FGT40FYYYYYYYYYY" + model: "FortiGate-40F"