Fortinet white logo
Fortinet white logo

CLI Reference

test

test

Use these commands to get cached information from various daemons and to send dummy SNMP traps for testing purposes.

Tab-complete is not supported for many of the last arguments for SNMP test traps, and so you must type the complete argument. For example, if you enter:

diagnose test trap cpu

then the command fails and returns an error (Command failed(-61)). Instead enter the complete argument:

diagnose test trap cpu-high

Syntax

diagnose test application authd [<level_int>]

diagnose test application cmdbsvr {1 | 2 | 3 | 4 | 5 | 6}

diagnose test application csfd [<level_int>]

diagnose test application dnscached {1 | 2 | 3}

diagnose test application forticron [<level_int>]

diagnose test application fortisandbox [[level_int>]

diagnose test application fortisandbox connectivity <fortisandbox_ipv4>

diagnose test application fortisandbox summary {hour | day | week}

diagnose test application geoip list country

diagnose test application geoip list ip <country-code_name>

diagnose test application geoip list ipv6 <country-code_name>

diagnose test application geoip query country <country-code_name>

diagnose test application geoip query ip {<host_ipv4> | <host_ipv6>}

diagnose test application ldapclient dump

diagnose test application mailserviced connection-duration [<seconds_int>]

diagnose test application mailserviced connection-imap-total [<limit_int>]

diagnose test application mailserviced connection-imap-user [<limit_int>]

diagnose test application mailserviced folder-msg-count-threshold {enable | disable | <limit_int>}

diagnose test application miglogd {1 | 2 | 3 | 4 | 5 | 6 | 7 | 99}

diagnose test application snmpd {1 | 2 | 3 | 4 | 99}

diagnose test application urlfilter {1 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 88 | 89 | 99 | 144}

diagnose test application waagent [<level_int>]

diagnose test trap ap-threshold

diagnose test trap av-threshold

diagnose test trap cpu-high

diagnose test trap ha-event {1 | 2 | 3} <ha-unit_ipv4> <reason_str>

diagnose test trap intf-ip-chg <interface_name>

diagnose test trap log-disk-full

diagnose test trap mail-disk-full

diagnose test trap mem-low

diagnose test trap mail-queue <queue_str>

diagnose test trap raid-event {1 | 2 | 3 | 4 | 5 | 6} <raid_str>

diagnose test trap sys-event {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}

diagnose test trap temp-high

diagnose test trap voltage-out-range

diagnose test trap test

Variable

Description

Default

<ha-unit_ipv4>

Enter the IP address of the FortiMail HA unit that you want to simulate a trap for.

This argument is valid if ha-event {1 | 2 | 3} is 2 or 3. Otherwise the command applies to the local unit, and therefore there is no remote IP address.

<raid_str>

Enter the name of the RAID device, such as raid0, that you want to simulate a trap for.

authd [<level_int>]

Select which level of authentication daemon information to display. If you omit the level, then the CLI outputs the current level:

authd test level is 3

0

cmdbsvr {1 | 2 | 3 | 4 | 5 | 6}

Select which configuration management database (CMDB) information to display:

  • 1. This menu

  • 2. Display device timer list

  • 3. Register all devices again

  • 4. Display device socket connection list

  • 5. Display syntax version list

  • 6. Display current login user

connection-duration [<seconds_int>]

Enter the IMAP connection timeout in seconds. If you omit the limit, the CLI outputs the current limit:

imap connection duration = 1800 (seconds)

1800

connection-imap-total [<limit_int>]

Enter the maximum number of total IMAP connections. If you omit the limit, the CLI outputs the current limit:

total imap connection limit = 2048

2048

connection-imap-user [<limit_int>]

Enter the maximum number of IMAP connections per user. If you omit the limit, the CLI outputs the current limit:

user+ip imap connection limit = 5

5

csfd [<level_int>]

Select which level of FortiGate Security Fabric information to display. If you omit the level, then the CLI outputs the current level:

csfd test level is 3

0

dnscached {1 | 2 | 3}

Select which DNS cache information to display or action to perform:

  • 1. This menu

  • 2. Display dns cache entry

  • 3. clean dns cache entry

folder-msg-count-threshold {enable | disable | <limit_int>}

Enable or disable the maximum number of counted email in IMAP folders.

When you enable the limit, the default maximum applies. If you want to apply a different maximum number, enter the custom limit.

100000

forticron [<level_int>]

Select which level of scheduled task information to display. If you omit the level, then the CLI resets the current level to 0 (nothing):

forticron test level is 0

0

ha-event {1 | 2 | 3}

Select the type of HA event to simulate a trap for:

  • 1-HA switch local

  • 2-HA switch remote

  • 3-HA shutdown

intf-ip-chg <interface_name>

Enter the name of the network interface, such as port1, that you want to simulate a trap for.

list ip <country-code_name>

Enter a country code such as CA for Canada to display all IPv4 addresses associated with that geographic region in the GeoIP database.

To get a list of available country codes, enter the command:

diagnose test application geoip list country

list ipv6 <country-code_name>

Enter a country code such as CA for Canada to display all IPv6 addresses associated with that geographic region in the GeoIP database.

To get a list of available country codes, enter the command:

diagnose test application geoip list country

mail-queue <queue_str>

Enter the name of a mail queue, such as dead, that you want to simulate a trap for.

miglogd {1 | 2 | 3 | 4 | 5 | 6 | 7 | 99}

Select which local log daemon information to display or action to perform:

  • 1. This menu

  • 2. Display all log list

  • 3. Display next rotate time

  • 4. Print log to console

  • 5. Do not print log to console

  • 6. Display miglogd_ctrl information

  • 7. Show remote queues

  • 99. Restart the miglogd daemon.

query country <country-code_name>

Enter a country code such as CA for Canada to display IP addresses associated with that geographic region.

To get a list of available country codes, enter the command:

diagnose test application geoip list country

query ip {<host_ipv4> | <host_ipv6>}

Enter an IPv4 or IPv6 address to display its associated geographic region in the GeoIP database.

raid-event {1 | 2 | 3 | 4 | 5 | 6}

Select the type of RAID event to simulate a trap for:

  • 1-DegradedArray

  • 2-SparesMissing

  • 3-RebuildStarted

  • 4-RebuildFinished

  • 5-Fail

  • 6-FailSpare

  • 7-SpareActive

snmpd {1 | 2 | 3 | 4 | 99}

Select which SNMP daemon information to display or action to perform:

  • 1: Display daemon process ID (PID)

  • 2: Display SNMP statistics

  • 3: Clear SNMP statistics

  • 4: Dump SNMP MIBs

  • 99: Restart daemon

sys-event {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}

Select the type of system event to simulate a trap for:

  • 1-System Shutdown

  • 2-System Rebooting

  • 3-System Reloading

  • 4-System Upgrading

  • 5-System GUI Upgrading

  • 6-System Log Disk Formatting

  • 7-System Mail Disk Formatting

  • 8-System AVDB Updating Success

  • 9-System AVDB Updating Network Error

  • 10-System AVDB Updating Failure

  • 0-System Checking Log/Spool Disk

urlfilter {1 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 88 | 89 | 99 | 144}

Select which URL filter daemon information to display or action to perform:

  • 1. This menu

  • 7. Toggle switch for dumping unrated packet

  • 10. Print debug values

  • 11. Clear Spam Filter cache

  • 12. Clear AV Query cache

  • 13. Toggle switch for dumping expired license packets

  • 14. Show running timers (except request timers)

  • 144. Show running timers (including request timers)

  • 15. Send INIT requests.

  • 17. Toggle fast INIT retry interval

  • 18. Generate those log entries that will go to Event log

  • 19. Display object counts

  • 88. Display FortiGuard server list

  • 89. Toggle antispam logging

  • 99. Restart the URL filter daemon.

waagent [<level_int>]

Select which level of Microsoft Azure agent information to display. If you omit the level, then the CLI outputs the current level:

waagent test level is 0

0

Example

FortiMail # diagnose test application geoip query ip 8.8.8.8

System Time:  2025-05-15 11:22:11 EDT (Uptime: 7d 0h 19m)
8.8.8.8                 US              United States

Related topics

autoupdate

debug

fips kat

log dummy-log

monitor

system file-system

test

test

Use these commands to get cached information from various daemons and to send dummy SNMP traps for testing purposes.

Tab-complete is not supported for many of the last arguments for SNMP test traps, and so you must type the complete argument. For example, if you enter:

diagnose test trap cpu

then the command fails and returns an error (Command failed(-61)). Instead enter the complete argument:

diagnose test trap cpu-high

Syntax

diagnose test application authd [<level_int>]

diagnose test application cmdbsvr {1 | 2 | 3 | 4 | 5 | 6}

diagnose test application csfd [<level_int>]

diagnose test application dnscached {1 | 2 | 3}

diagnose test application forticron [<level_int>]

diagnose test application fortisandbox [[level_int>]

diagnose test application fortisandbox connectivity <fortisandbox_ipv4>

diagnose test application fortisandbox summary {hour | day | week}

diagnose test application geoip list country

diagnose test application geoip list ip <country-code_name>

diagnose test application geoip list ipv6 <country-code_name>

diagnose test application geoip query country <country-code_name>

diagnose test application geoip query ip {<host_ipv4> | <host_ipv6>}

diagnose test application ldapclient dump

diagnose test application mailserviced connection-duration [<seconds_int>]

diagnose test application mailserviced connection-imap-total [<limit_int>]

diagnose test application mailserviced connection-imap-user [<limit_int>]

diagnose test application mailserviced folder-msg-count-threshold {enable | disable | <limit_int>}

diagnose test application miglogd {1 | 2 | 3 | 4 | 5 | 6 | 7 | 99}

diagnose test application snmpd {1 | 2 | 3 | 4 | 99}

diagnose test application urlfilter {1 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 88 | 89 | 99 | 144}

diagnose test application waagent [<level_int>]

diagnose test trap ap-threshold

diagnose test trap av-threshold

diagnose test trap cpu-high

diagnose test trap ha-event {1 | 2 | 3} <ha-unit_ipv4> <reason_str>

diagnose test trap intf-ip-chg <interface_name>

diagnose test trap log-disk-full

diagnose test trap mail-disk-full

diagnose test trap mem-low

diagnose test trap mail-queue <queue_str>

diagnose test trap raid-event {1 | 2 | 3 | 4 | 5 | 6} <raid_str>

diagnose test trap sys-event {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}

diagnose test trap temp-high

diagnose test trap voltage-out-range

diagnose test trap test

Variable

Description

Default

<ha-unit_ipv4>

Enter the IP address of the FortiMail HA unit that you want to simulate a trap for.

This argument is valid if ha-event {1 | 2 | 3} is 2 or 3. Otherwise the command applies to the local unit, and therefore there is no remote IP address.

<raid_str>

Enter the name of the RAID device, such as raid0, that you want to simulate a trap for.

authd [<level_int>]

Select which level of authentication daemon information to display. If you omit the level, then the CLI outputs the current level:

authd test level is 3

0

cmdbsvr {1 | 2 | 3 | 4 | 5 | 6}

Select which configuration management database (CMDB) information to display:

  • 1. This menu

  • 2. Display device timer list

  • 3. Register all devices again

  • 4. Display device socket connection list

  • 5. Display syntax version list

  • 6. Display current login user

connection-duration [<seconds_int>]

Enter the IMAP connection timeout in seconds. If you omit the limit, the CLI outputs the current limit:

imap connection duration = 1800 (seconds)

1800

connection-imap-total [<limit_int>]

Enter the maximum number of total IMAP connections. If you omit the limit, the CLI outputs the current limit:

total imap connection limit = 2048

2048

connection-imap-user [<limit_int>]

Enter the maximum number of IMAP connections per user. If you omit the limit, the CLI outputs the current limit:

user+ip imap connection limit = 5

5

csfd [<level_int>]

Select which level of FortiGate Security Fabric information to display. If you omit the level, then the CLI outputs the current level:

csfd test level is 3

0

dnscached {1 | 2 | 3}

Select which DNS cache information to display or action to perform:

  • 1. This menu

  • 2. Display dns cache entry

  • 3. clean dns cache entry

folder-msg-count-threshold {enable | disable | <limit_int>}

Enable or disable the maximum number of counted email in IMAP folders.

When you enable the limit, the default maximum applies. If you want to apply a different maximum number, enter the custom limit.

100000

forticron [<level_int>]

Select which level of scheduled task information to display. If you omit the level, then the CLI resets the current level to 0 (nothing):

forticron test level is 0

0

ha-event {1 | 2 | 3}

Select the type of HA event to simulate a trap for:

  • 1-HA switch local

  • 2-HA switch remote

  • 3-HA shutdown

intf-ip-chg <interface_name>

Enter the name of the network interface, such as port1, that you want to simulate a trap for.

list ip <country-code_name>

Enter a country code such as CA for Canada to display all IPv4 addresses associated with that geographic region in the GeoIP database.

To get a list of available country codes, enter the command:

diagnose test application geoip list country

list ipv6 <country-code_name>

Enter a country code such as CA for Canada to display all IPv6 addresses associated with that geographic region in the GeoIP database.

To get a list of available country codes, enter the command:

diagnose test application geoip list country

mail-queue <queue_str>

Enter the name of a mail queue, such as dead, that you want to simulate a trap for.

miglogd {1 | 2 | 3 | 4 | 5 | 6 | 7 | 99}

Select which local log daemon information to display or action to perform:

  • 1. This menu

  • 2. Display all log list

  • 3. Display next rotate time

  • 4. Print log to console

  • 5. Do not print log to console

  • 6. Display miglogd_ctrl information

  • 7. Show remote queues

  • 99. Restart the miglogd daemon.

query country <country-code_name>

Enter a country code such as CA for Canada to display IP addresses associated with that geographic region.

To get a list of available country codes, enter the command:

diagnose test application geoip list country

query ip {<host_ipv4> | <host_ipv6>}

Enter an IPv4 or IPv6 address to display its associated geographic region in the GeoIP database.

raid-event {1 | 2 | 3 | 4 | 5 | 6}

Select the type of RAID event to simulate a trap for:

  • 1-DegradedArray

  • 2-SparesMissing

  • 3-RebuildStarted

  • 4-RebuildFinished

  • 5-Fail

  • 6-FailSpare

  • 7-SpareActive

snmpd {1 | 2 | 3 | 4 | 99}

Select which SNMP daemon information to display or action to perform:

  • 1: Display daemon process ID (PID)

  • 2: Display SNMP statistics

  • 3: Clear SNMP statistics

  • 4: Dump SNMP MIBs

  • 99: Restart daemon

sys-event {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}

Select the type of system event to simulate a trap for:

  • 1-System Shutdown

  • 2-System Rebooting

  • 3-System Reloading

  • 4-System Upgrading

  • 5-System GUI Upgrading

  • 6-System Log Disk Formatting

  • 7-System Mail Disk Formatting

  • 8-System AVDB Updating Success

  • 9-System AVDB Updating Network Error

  • 10-System AVDB Updating Failure

  • 0-System Checking Log/Spool Disk

urlfilter {1 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 88 | 89 | 99 | 144}

Select which URL filter daemon information to display or action to perform:

  • 1. This menu

  • 7. Toggle switch for dumping unrated packet

  • 10. Print debug values

  • 11. Clear Spam Filter cache

  • 12. Clear AV Query cache

  • 13. Toggle switch for dumping expired license packets

  • 14. Show running timers (except request timers)

  • 144. Show running timers (including request timers)

  • 15. Send INIT requests.

  • 17. Toggle fast INIT retry interval

  • 18. Generate those log entries that will go to Event log

  • 19. Display object counts

  • 88. Display FortiGuard server list

  • 89. Toggle antispam logging

  • 99. Restart the URL filter daemon.

waagent [<level_int>]

Select which level of Microsoft Azure agent information to display. If you omit the level, then the CLI outputs the current level:

waagent test level is 0

0

Example

FortiMail # diagnose test application geoip query ip 8.8.8.8

System Time:  2025-05-15 11:22:11 EDT (Uptime: 7d 0h 19m)
8.8.8.8                 US              United States

Related topics

autoupdate

debug

fips kat

log dummy-log

monitor

system file-system