Fortinet FortiGate Check

Fortinet FortiGate Check

Certified
Enterprise Edition

Pre or post upgrade checks on a FortiGate

Runs health checks and reports ok or ko. A failing check never throws: it is listed in checksFailed. Only connection, authentication and permission errors fail the task. The output fields are the same as the Arista and Cisco check tasks.

PRE runs VERSION, DISK, HA, RESOURCES and LICENSE, and writes a snapshot (interfaces up, LLDP neighbours per port, IPv4 route count, session count, HA state and boot time). POST needs that snapshot and runs VERSION (the device rebooted since the snapshot), HA (members back and configuration checksums in sync), INTERFACES (up before, up now), LLDP (neighbours unchanged per port) and RESOURCES.

HA fails when a member is missing, when the configuration checksums are not in sync, or when the cluster upgrades in simultaneous mode (every member reboots at once). A cluster is upgraded through its primary: with the default uninterruptible mode the secondary units upgrade first, then a failover happens. Some releases do not support an uninterruptible upgrade: read the release notes. LICENSE needs a valid FortiCare entitlement, without which source: FORTIGUARD cannot download the image.

The version comparison is left to the flow: compare version with your target.

yaml
type: io.kestra.plugin.ee.fortinet.fortigate.Check

Pre-check a FortiGate before upgrading it

yaml
id: fortigate_pre_check
namespace: company.network

tasks:
  - id: pre_check
    type: io.kestra.plugin.ee.fortinet.fortigate.Check
    host: fgt1.example.com
    apiToken: "{{ secret('FORTIGATE_API_TOKEN') }}"
    phase: PRE

Post-check a FortiGate against the pre-check snapshot

yaml
id: fortigate_post_check
namespace: company.network

inputs:
  - id: snapshot
    type: URI

tasks:
  - id: post_check
    type: io.kestra.plugin.ee.fortinet.fortigate.Check
    host: fgt1.example.com
    apiToken: "{{ secret('FORTIGATE_API_TOKEN') }}"
    phase: POST
    snapshot: "{{ inputs.snapshot }}"
Installation

This Enterprise plugin requires an Enterprise image and access to the plugin registry. Install it with the following command:

kestractl plugins get io.kestra.plugin.ee:plugin-ee-fortinet --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

Properties
Possible Values
PREPOST

Phase

PRE before the upgrade (writes the snapshot), POST after it (compares with the snapshot).

API token

Key of a REST API administrator (execute api-user generate-key). It is sent in the Authorization: Bearer header only, never in the URL. Use {{ secret('FORTIGATE_API_TOKEN') }}. Set a trusthost on the API administrator to the egress range of your worker group. Configuration backup, restore and firmware upgrade need the super_admin profile, the other tasks work with a read profile (read-write for the tasks that change configuration).

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

CA certificate

PEM encoded CA certificate(s) used to validate the FortiGate certificate. When set, only this CA is trusted. When empty, the JVM trust store is used.

SubTypestring
Possible Values
VERSIONDISKHAINTERFACESLLDPRESOURCESLICENSE

Checks

Checks to run among VERSION, DISK, HA, INTERFACES, LLDP, RESOURCES and LICENSE. All the checks of the phase by default. Checks that do not apply to the phase are skipped.

Connect timeout

Maximum time to open the connection. Must be greater than zero. Defaults to 10 seconds.

Managed device

Name of the FortiGate in FortiManager. Only used with fortiManager.

Expected HA members

Number of members the HA check expects in the cluster. Defaults to the number of members in the snapshot for POST, and to 2 for PRE on a cluster.

FortiManager proxy

Reach the FortiGate through a FortiManager when the worker can only connect to the manager. Reads only: the call goes through exec /sys/proxy/json. Tasks that write (ApplyConfig, RestoreConfig, Reload) and GetConfig backups need a direct connection: on a managed FortiGate, change configuration with policy packages. Needs device.

Definitions
host*string

FortiManager host

Host name or IP address of the FortiManager management interface.

adomstring

ADOM

Administrative domain that holds the managed device. Defaults to root.

apiKeystring

API key

REST API key of a FortiManager API user (FortiManager 7.2.2 and later), sent in the Authorization header. Use {{ secret('FORTIMANAGER_API_KEY') }}.

caCertificatestring

CA certificate

PEM encoded CA certificate(s) used to validate the FortiManager certificate. When empty, the JVM trust store is used.

connectTimeoutstring

Connect timeout

Maximum time to open the connection. Must be greater than zero. Defaults to 10 seconds.

insecureSkipVerifybooleanstring

Skip TLS verification

Disables certificate and host name validation. Only for labs with self-signed certificates. Defaults to false.

passwordstring

Password

Administrator password. Use {{ secret('FORTIMANAGER_PASSWORD') }}.

portintegerstring

FortiManager port

HTTPS port. Defaults to 443.

requestTimeoutstring

Request timeout

Maximum time to wait for one answer. Must be greater than zero. Defaults to 60 seconds.

usernamestring

Username

Administrator name, used with password when no apiKey is set.

FortiGate host

Host name or IP address of the FortiGate management interface. Required unless fortiManager and device are set.

Skip TLS verification

Disables certificate and host name validation. Only for labs with self-signed certificates. Defaults to false.

Maximum CPU percent

The RESOURCES check fails above this CPU usage, from 1 to 100. Defaults to 80.

Maximum disk percent

The DISK check fails above this disk usage, from 1 to 100. Defaults to 85.

Maximum memory percent

The RESOURCES check fails above this memory usage, from 1 to 100. Defaults to 80.

FortiGate port

HTTPS port of the management interface. Defaults to 443.

Request timeout

Maximum time to wait for one answer. Must be greater than zero. Defaults to 60 seconds.

Snapshot

Internal storage URI of the snapshot written by the PRE check. Required for POST.

VDOM

VDOM the call applies to. Defaults to root. Global tables (system/...) ignore it.

Boot timestamp

Epoch seconds of the last boot, when the device reports it.

Checks failed

Failed checks with a message each.

Definitions
checkstring

Check name

Lower case name of the check that failed, for example ha.

messagestring

Message

What failed, with the offending values.

SubTypestring

Checks passed

Names of the checks that passed.

Model name

Hardware or VM model.

Formaturi

Snapshot

Internal storage URI of the snapshot. Only set for the PRE phase.

Status

ok when every check passed, ko otherwise.

Running version

FortiOS version currently running, for example 7.4.3.