Fortinet FortiOS SNMP v3 and Syslog
SNMPv3 with host restriction, per-interface SNMP access control, syslog to multiple collectors with severity filtering, and NTP - configured per VDOM where VDOMs are enabled.
What is it?
SNMP and syslog are how a FortiGate tells you what it is doing. SNMP is polled: the monitoring system asks for counters such as session count, CPU, memory and interface throughput. Syslog is pushed: the firewall sends events as they occur, including traffic logs, VPN negotiations, admin logins and configuration changes. FortiOS differs from most platforms in two ways that cause most of the setup problems. First, SNMP will not respond unless the interface's `allowaccess` list includes it, no matter how correct the SNMP configuration is. Second, where VDOMs are enabled, logging is configured per VDOM, so configuring it in root does nothing for traffic in another VDOM.
When to use
- ·Every FortiGate in production, configured at deployment time alongside the base config
- ·Capacity planning: session count and memory are the two counters that predict when a FortiGate needs replacing
- ·Security operations: traffic and UTM logs forwarded to a SIEM are usually the point of having the firewall at all
- ·Change auditing: FortiOS logs every configuration change with the admin account that made it
- ·HA monitoring: the ha-switch and ha-hb-failure traps tell you about a failover as it happens, rather than at the next poll
When NOT to use
- ·SNMPv1 or v2c anywhere reachable from untrusted networks - the community string is cleartext
- ·Forwarding `forward-traffic` logs at `information` severity from a busy edge firewall without checking the volume first. A FortiGate at scale can emit tens of thousands of events per second and overwhelm both the link and a licensed SIEM
- ·Disk logging on entry-level models with no SSD. Logging to flash wears it out; use remote logging only on those platforms
- ·Relying on syslog alone for FortiAnalyzer-style reporting. If you have FortiAnalyzer, use it - the native integration carries structured data that plain syslog loses
- ·Enabling every event filter on a device with limited CPU - log generation is not free
How it compares
Prerequisites
- →Management reachability to the NMS and the syslog collector, from the correct VDOM
- →NTP configured first - SNMPv3 authentication is time-sensitive and timestamps must be correct
- →Knowledge of whether VDOMs are enabled, since that changes where logging is configured
- →SNMPv3 credentials stored in a secrets manager, not in the repository
- →An estimate of log volume before enabling forward-traffic logging on a busy firewall
Config Generator
Leave as root unless VDOMs are enabled. Logging is configured per VDOM
SHA authentication. Never commit the real value
AES encryption. Use a different value from the auth password
SNMP must be allowed in this interface's allowaccess list or polls never arrive
FortiOS configures each collector as its own numbered block (syslogd, syslogd2...), not as a list
emergency, alert, critical, error, warning, notification, information, debug
FortiOS uses numeric timezone indexes. 04 is GMT/UTC. Run 'set timezone ?' to list them
Verification commands
get system snmp sysinfoConfirm the SNMP agent is enabled and show the system description
ExpectedStatus enable, with location and contact populated. If status is disable, nothing else in the SNMP configuration matters.
show system interface <mgmt_interface> | grep allowaccessConfirm the interface actually permits SNMP
Expected`snmp` present in the allowaccess list. This is the step most often missed - the SNMP configuration can be perfect and the device still will not answer a poll.
diagnose sniffer packet any 'udp port 161' 4Confirm poll packets are arriving at the firewall
ExpectedInbound packets from the NMS address. No packets means a routing or upstream filtering problem rather than a FortiOS configuration problem.
execute log displayShow recent log entries from local storage
ExpectedRecent events. If local logging is empty, the event filters are off or disk logging is disabled.
Debug commands
diagnose debug application snmpd -1\ndiagnose debug enableTrace SNMP agent processing, including authentication failures
WarningVerbose on a polled device. Always finish with `diagnose debug disable` and `diagnose debug reset` - leaving debug enabled measurably affects CPU.
diagnose sniffer packet any 'host 10.0.0.60 and port 514' 4Confirm syslog is actually leaving the firewall
WarningShows traffic only while running. On a busy firewall add a tighter filter, and stop it with Ctrl-C rather than leaving it running.
diagnose test application miglogd 6Show log daemon statistics including dropped messages
WarningThe daemon numbers vary by FortiOS version; confirm the right number for your release before relying on the output.
Common mistakes & fixes
Further learning
Recommended books to go deeper on this topic.
CCNP Enterprise Core ENCOR 350-401 Official Cert Guide
Brad Edgeworth et al. · Cisco Press · Network management: SNMP v1/v2c/v3, syslog levels, NTP, NetFlow