Check fortios-memory-usage¶
Overview¶
Monitors memory utilization on FortiGate appliances running FortiOS via the REST API. First checks against the globally configured memory-use-threshold on the appliance, then falls back to command-line thresholds if no global configuration exists. Alerts when memory usage exceeds the configured thresholds.
Important Notes:
FortiGate appliances running FortiOS with REST API access
The globally configured
memory-use-threshold-greentakes precedence over--warning, andmemory-use-threshold-redtakes precedence over--critical
Data Collection:
Queries the FortiOS REST API endpoint
/api/v2/monitor/system/resource/usage?resource=mem&interval=1-minfor the current memory usageQueries
/api/v2/cmdb/system/globalto read the appliance’s globally configuredmemory-use-threshold-green(warning) andmemory-use-threshold-red(critical); if present, these values override--warningand--criticalAuthentication uses a single API token (Token-based authentication)
Fact Sheet¶
Fact |
Value |
|---|---|
Check Plugin Download |
https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/fortios-memory-usage |
Nagios/Icinga Check Name |
|
Check Interval Recommendation |
Every minute |
Can be called without parameters |
No ( |
Runs on |
Cross-platform |
Compiled for Windows |
No |
Help¶
usage: fortios-memory-usage [-h] [-V] [--always-ok] [-c CRIT] -H HOSTNAME
[--insecure] [--no-proxy] --password PASSWORD
[--timeout TIMEOUT] [-w WARN]
Monitors memory utilization on FortiGate appliances running FortiOS via the
REST API. First checks against the globally configured memory-use-threshold on
the appliance, then falls back to command-line thresholds if no global
configuration exists. Alerts when memory usage exceeds the configured
thresholds.
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
--always-ok Always returns OK.
-c, --critical CRIT CRIT threshold for memory usage in percent. The plugin
first checks against the globally configured `memory-
use-threshold-red` on the appliance; this value is
only used if no global threshold exists. Default: 88
-H, --hostname HOSTNAME
FortiOS-based appliance address, optionally including
port. Example: `--hostname 192.168.1.1:443`.
--insecure This option explicitly allows insecure SSL
connections.
--no-proxy Do not use a proxy.
--password PASSWORD FortiOS REST API single-use access token.
--timeout TIMEOUT Network timeout in seconds. Default: 3 (seconds)
-w, --warning WARN WARN threshold for memory usage in percent. The plugin
first checks against the globally configured `memory-
use-threshold-green` on the appliance; this value is
only used if no global threshold exists. Default: 82
Usage Examples¶
./fortios-memory-usage --hostname fortigate-cluster.linuxfabrik.io --password mypass --warning=50 --critical=70
Output:
1%
States¶
OK if memory usage is below the warning threshold.
WARN if memory usage exceeds the warning threshold (appliance’s
memory-use-threshold-greenor--warning, default: 82%).CRIT if memory usage exceeds the critical threshold (appliance’s
memory-use-threshold-redor--critical, default: 88%).--always-oksuppresses all alerts and always returns OK.
Perfdata / Metrics¶
Name |
Type |
Description |
|---|---|---|
usage_percent |
Percentage |
Current memory usage of the FortiGate appliance. |
Credits, License¶
Authors: Linuxfabrik GmbH, Zurich
License: The Unlicense, see LICENSE file.