Fortinet white logo
Fortinet white logo

CLI Reference

config hosts

config hosts

Description: Configure SNMP hosts settings.

config hosts

edit <name>

set *host-ip {ipv4-address}

set host-type [any | query | trap]

unset

next

show

abort

end

delete <name>

purge

show

end

show

end

Parameter Description Type Size Default
host-ip IPv4 address of the SNMP manager (host) in x.x.x.x/24 format. IPv4 address - none
host-type Whether the SNMP manager sends SNMP queries, or receives SNMP traps, or both. option - none
Option Description
any Any type.
query SNMP queries only.
trap SNMP traps only.

Sample command:

FX201E5919000057 (snmp) # show
config snmp
    config sysinfo
        set status enable
        set description this is a test comment
        set contact-info +15082558567
        set location
    end
    config community
        edit comm1
            set name 1
            set status enable
            set hosts host1
            set query-v1-status enable
            set query-v1-port 161
            set query-v2c-status disable
            set query-v2c-port 161
            set trap-v1-status disable
            set trap-v1-lport 162
            set trap-v1-rport 162
            set trap-v2c-status disable
            set trap-v2c-lport 162
            set trap-v2c-rport 162
            set events data-exhausted fgt-backup-mode-switch
        next
    end
    config user
        edit user1
            set name user1
            set status enable
            set notify-hosts host1
            set trap-status enable
            set trap-lport 162
            set trap-rport 162
            set queries disable
            set query-port 161
            set events data-exhausted fgt-backup-mode-switch low-signal-strength
            set security-level auth-priv
            set auth-proto sha1
            set auth-pwd ******
            set priv-proto aes
            set priv-pwd ******
        next
    end
    config hosts
        edit host1
            set host-ip 192.168.1.100/24
            set host-type any
        next
    end
end

config hosts

config hosts

Description: Configure SNMP hosts settings.

config hosts

edit <name>

set *host-ip {ipv4-address}

set host-type [any | query | trap]

unset

next

show

abort

end

delete <name>

purge

show

end

show

end

Parameter Description Type Size Default
host-ip IPv4 address of the SNMP manager (host) in x.x.x.x/24 format. IPv4 address - none
host-type Whether the SNMP manager sends SNMP queries, or receives SNMP traps, or both. option - none
Option Description
any Any type.
query SNMP queries only.
trap SNMP traps only.

Sample command:

FX201E5919000057 (snmp) # show
config snmp
    config sysinfo
        set status enable
        set description this is a test comment
        set contact-info +15082558567
        set location
    end
    config community
        edit comm1
            set name 1
            set status enable
            set hosts host1
            set query-v1-status enable
            set query-v1-port 161
            set query-v2c-status disable
            set query-v2c-port 161
            set trap-v1-status disable
            set trap-v1-lport 162
            set trap-v1-rport 162
            set trap-v2c-status disable
            set trap-v2c-lport 162
            set trap-v2c-rport 162
            set events data-exhausted fgt-backup-mode-switch
        next
    end
    config user
        edit user1
            set name user1
            set status enable
            set notify-hosts host1
            set trap-status enable
            set trap-lport 162
            set trap-rport 162
            set queries disable
            set query-port 161
            set events data-exhausted fgt-backup-mode-switch low-signal-strength
            set security-level auth-priv
            set auth-proto sha1
            set auth-pwd ******
            set priv-proto aes
            set priv-pwd ******
        next
    end
    config hosts
        edit host1
            set host-ip 192.168.1.100/24
            set host-type any
        next
    end
end