snmp authtrap [ 0 | 1 ]
snmp community [ add | delete ro | rw ]
snmp contact [ contact ]
snmp init [ 1 ]
snmp location [ location ]
snmp traphost [ add | delete hostname | ipaddress ]
snmp traps [ on | off | reset | delete ]
snmp traps trapname[.parameter value | on | off | reset delete]
It is recommended that all snmp commands be added to the end of the /etc/rc file. The last snmp command in the /etc/rc file should be:
snmp init 1
This will initialize the SNMP daemon with the values set using the snmp command and it will send out a coldStart trap as described below.
authtrap [ 0 | 1 ]
Enable or disable SNMP agent authentication failure
traps. To enable authentication traps specify 1. To
disable authentication traps specify 0. Traps are sent
to all hosts specified with the traphost option.
community [ add|delete ro|rw community ] Add or delete communities with the specified access control type. Specify ro for a read-only community and rw for a read-write community. For example, to add the read-only community private use the following command:
snmp community add ro private
Currently the SNMP SetRequest PDU is not supported, so all read-write communities will default to read-only. The default community for the filer SNMP agent is public and its access mode is ro. Up to a maximum of 8 communities are supported.
contact [ contact ]
Used to set the contact name returned by the SNMP agent
as the System.sysContact.0 MIB-II variable.
init [ 1 ]
With an option of 1 this initializes the snmp daemon
with values previously set by the snmp command. It
also sends a coldStart trap to any hosts previously
specified by the traphost option. The command:
snmp init 1
should be the last snmp command in the filer's /etc/rc file.
On a query init will return the value 0 if the SNMP daemon has not yet been initialized. Otherwise it will return the value 1.
location [ location ]
Used to set the location name returned by the SNMP
agent as the System.sysLocation.0 MIB-II variable.
traphost
[ add | delete hostname | ipaddress ]
To add or delete SNMP managers who will be the recipient of the filer's Trap PDU's. Specify the word add or delete as appropriate followed by the host name or IP address. If a host name is specified, it must exist in the /etc/hosts file. For example, to add the host alpha use the following command:
snmp traphost add alpha
No traps will be sent unless at least one trap host is specified. Up to a maximum of 8 trap hosts are supported.
On a query the traphost option will return a list of registered trap hosts followed by their IP addresses. If a host name cannot be found in /etc/hosts for a previously registered IP address, its name will default to a string representation of its IP address.
traps on | off | reset | delete
turns all traps on or off, or resets or deletes them
traps
trapname[.parameter value | on | off | reset | delete]
affects a specified trap. It assigns a parameter and value, or turns it on or off, or resets or deletes it.
You can trap on any MIB variable, but to do so you need a trap data parser function at the traphost application or a management script to interpret the TRAP name, OID value fields, and so on.
snmp contact 'Network Manager' snmp location 'Bldg 2. Lab 3a' snmp community add ro private snmp traphost add snmp-mgr1 snmp traphost add snmp-mgr2 snmp init 1