Add SNMP trap for memory usage on FortiProxies
This information is also available in the FortiProxy 7.6 Administration Guide: |
Both free memory usage and freeable memory of FortiProxy devices can be monitored through the Simple Network Management Protocol (SNMP).
SNMP object identifier (OID) entries are available in Fortinet MIB files to show the percentage of free memory usage and freeable memory in an SNMP manager:
-
1.3.6.1.4.1.12356.101.4.1.36 .fgSysFreeMemUsage
-
1.3.6.1.4.1.12356.101.4.1.37 .fgSysFreeableMemUsage
The following commands are available to configure memory thresholds to trigger SNMP traps:
config system snmp sysinfo set trap-free-memory-threshold <integer> set trap-freeable-memory-threshold <integer> end
set trap-free-memory-threshold <integer> |
Use an integer from 1 to 100 (default 5) to identify what percentage of free memory usage will trigger an SNMP trap. SNMP traps are sent when the free memory is lower than the specified threshold. For example, the free memory threshold is set to 5, and SNMP traps are sent when free memory is lower than 5%. |
set trap-freeable-memory-threshold <integer> |
Use an integer from 1 to 100 (default 60) to identify what percentage of freeable memory will trigger an SNMP trap. SNMP traps are sent when the freeable memory is higher than the specified threshold. For example, the freeable memory threshold is set to 60, and SNMP traps are sent when freeable memory is higher than 60%. |
Example
In this example, the SNMP agent is configured to monitor FortiProxy memory and send traps. The trap-free-memory-threshold
is set to 10
, and the trap-freeable-memory-threshold
is set to 50
. SNMP traps are triggered for both thresholds because:
-
The free memory on the FortiProxy is 9%, which is lower than the threshold of 10.
-
The freeable memory on the FortiProxy is 56%, which is higher than the threshold of 50.
This example describes how to use the new commands to configure SNMP agents. It does not describe how to fully configure SNMP. For information about configuring SNMP, see the FortiProxy 7.6 Administration Guide: |
To configure SNMP for monitoring memory usage on FortiProxies:
-
Configure the SNMP agent to monitor FortiProxy memory usage and freeable memory.
In this example, the
trap-free-memory-threshold
is set to10
, and thetrap-freeable-memory-threshold
is set to50
.config system snmp sysinfo set status enable set status enable set description "FPX" set contact-info "FPXQA" set location "Burnaby" set trap-free-memory-threshold 10 set trap-freeable-memory-threshold 50 end
-
Verify that the SNMP manager can successfully query and receive a response on the current memory status of the FortiProxy.
In the following example, the free memory on the FortiProxy is reported as 9%, and the freeable memory on the FortiProxy is reported as 56%.
$ snmpwalk -v2c -c test123 10.4.62.222 1.3.6.1.4.1.12356.101.4.1.36 FORTINET-CORE-MIB::fortinet.101.4.1.36.0 = Gauge32: 9 $ snmpwalk -v2c -c test123 10.4.62.222 1.3.6.1.4.1.12356.101.4.1.37 FORTINET-CORE-MIB::fortinet.101.4.1.37.0 = Gauge32: 56
-
Use the SNMP manager to monitor memory usage on the FortiProxy.
Following is an example of the SNMP trap messages sent when thresholds are surpassed for freeable memory and free memory usage on FortiProxies:
Nov 6 14:58:51 localhost snmptrapd[81079]: 2024-11-06 14:58:51 _gateway [UDP: [10.4.62.222]:162->[10.4.62.181]:162]:#012DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (7854230) 21:49:02.30#011SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.12356.100.1.3.0.102#011SNMPv2-SMI::enterprises.12356.100.1.1.1.0 = STRING: "FPXVULTM24000121"#011SNMPv2-MIB::sysName.0 = STRING: FPX222#011SNMPv2-SMI::enterprises.12356.100.1.3.1.1 = STRING: "freeable memory percentage is too high" Nov 6 13:59:13 localhost snmptrapd[81079]: 2024-11-06 13:59:13 _gateway [UDP: [10.4.62.222]:162->[10.4.62.181]:162]:#012DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (7496379) 20:49:23.79#011SNMPv2-MIB::snmpTrapOID.0 = OID: SNMPv2-SMI::enterprises.12356.100.1.3.0.102#011SNMPv2-SMI::enterprises.12356.100.1.1.1.0 = STRING: "FPXVULTM24000121"#011SNMPv2-MIB::sysName.0 = STRING: FPX222#011SNMPv2-SMI::enterprises.12356.100.1.3.1.1 = STRING: "free memory percentage is too low"