Troubleshooting Tip: General troubleshooting guide for SNMP issues
Description
Â
This article provides a go-to point for troubleshooting all SNMP issues that may occur with polling information from FortiGate, sorted by issue type. This article does not focus on SNMP traps.
Â
Scope
Â
FortiGate.
Â
Solution
Â
General setup guide (make sure setup is performed correctly before taking any other troubleshooting steps):Â Technical Tip: How to Configure FortiGate SNMP Agent for Monitoring.
Â
No reply to SNMP (at all, or only on one interface/VDOM/unit):
Check if SNMP access is enabled on the interface where the request is received.
Check if the IP of the polling server is added to the trusted hosts (as well as in the admin user's trusted hosts, if trusted hosts are used): Troubleshooting Tip: Troubleshooting SNMP query failure from the SNMP manager to the firewall.
Check that the SNMP agent is enabled and configured.
Check the community name for special characters. See Troubleshooting Tip: SNMP connection failed due to special character.
Ensure any local-in policies are configured correctly.
Check routing and confirm the that the SNMP server is reachable. If, based on routing, the server is reachable via an interface that is different than the incoming one, the asymmetric routing can lead to additional issues in case of the return traffic (SNMP reply sourced with IP of the outgoing interface)
Check if the SNMP request is reaching the expected interface/vlan/vdom (diagnose sniffer packet any "port 161" 4 0).
Check if the community is matched (diagnose debug app snmpd -1 / diagnose debug enable).
If the traffic is crossing more than one VDOM, make sure the SNMP is configured for multi-VDOM, and policies exist.
In HA mode: check if HA-direct is enabled:
Check for a community mismatch when SNMP is only set up to send traps: Technical Tip: SNMP failed to specific host when host set to trap only.
Check the debug flow and session list. Traffic is allowed, and a new session is allocated. If the SNMP debug shows a mismatch for the host IP, add the SNMP host IP to the SNMP settings.
Â
Debug flow example:
Â
2024-11-13 13:24:14 id=20085 trace_id=20 func=resolve_ip_tuple_fast line=5950 msg="Find an existing session, id-11edd8e0, original direction"
2024-11-13 13:24:17 id=20085 trace_id=21 func=print_pkt_detail line=5864 msg="vd-root:0 received a packet(proto=17, 192.168.11.123:55398->10.246.16.1:161) tun_id=4.2.55.66 from CNVtoGSC. "
2024-11-13 13:24:17 id=20085 trace_id=21 func=resolve_ip_tuple_fast line=5950 msg="Find an existing session, id-11edd8e0, original direction"Â
Only some OIDs are not working or return unexpected values:
Make sure the most recent MIBs are used in the monitoring tool:
Check that the output matches the output from specific diagnostic commands.
If all of the above are matched, make sure to have the latest FortiOS version available and then open a support case to investigate.
Â
SNMPD crashes (depending on the type):
The crashlog can be seen in 'diagnose debug crashlog read'.
Signal 6: make sure all interface indexes are unique. Check as described here: Technical Tip: Watchdog Timeout / Application Crash snmpd (signal 6) abort.
Signal 11 can be manually triggered by a user or by FortiOS. When triggered by FortiOS, this is only a match of conserve mode most of the time.
For the other cases, contact TAC support for help with troubleshooting. Collect SNMP debug output (from diagnose debug crash logd -1 and diagnose debug enable while reproducing the crash).
Â
Troubleshooting actions on FortiGate (after all the above fail):
Gracefully restart snmpd:
Â
diagnose test application snmpd 99Â
Debugging (if enabled) will display the following:
diagnose test application snmpd 99
snmpd: received debug test signal
restarting snmp daemon
snmpd: creating community=fortinet
snmpd: community: fortinet mask:Â Â Â Â Â Â 9e9ff9f37f
snmpd: creating community=FortiManager
snmpd: community: FortiManager mask: 7fffffffffffffff
snmpd: set mac_host_timeout as 300Alternatively, forcefully restart snmpd using one of the 2 CLI command methods outlined below:
Â
CLI Method 1:
Â
diagnose sys process pidof snmpd
diagnose sys kill 11 <pid#>
diagnose sys process pidof snmpd <- This command will return the process ID of the snmpd process(es) in use.Â
CLI Method 2:
Â
fnsysctl killall snmpdÂ
See Technical Tip: Find and restart/kill a process on a FortiGate by the process ID (PID) via pidof. The result will be seen as snmpd showing another process number, and the crashlog will show 'signal 11' sent by the user to snmpd.
Check the packet capture to ensure packets are seen/received by FortiGate.
Check the debug flow for the SNMP request to determine if it is passed or blocked.
Check if the SNMP port is used/open on FortiGate:Â diagnose sys udpsock | grep 161.
See Technical Tip: SNMP process is not listening.Check the output of snmpd -1 debug: if the request is not blocked by the interface or other security checks, the output will provide the reason for failure.
Â
Note:Â SNMP queries only work on the management (root) VDOM or dedicated management interfaces.
Â
config system interface
  edit <mgmt-iface>
    set vdom root
    set allowaccess snmp
endÂ
Related articles:
