Requests or modifies values of Management Information Base (MIB) variables managed by a Simple Network Management Protocol (SNMP) agent.
snmpinfo [ -m get | next ] [ -v ] [ -c Community ] [ -d Level ] [ -h HostName ] [ -o ObjectsFile ] ... [ -t Tries ] Variable. Instance ...
snmpinfo -m set [ -v ] [ -c Community ] [ -d Level ] [ -h HostName ] [ -o ObjectsFile ] ... [ -t Tries ] Variable . Instance= Value ...
snmpinfo -m dump [ -v ] [ -c Community ] [ -d Level ] [ -h HostName ] [ -o ObjectsFile ] ... [ -t Tries ] [ Variable. Instance ] ...
The snmpinfo command requests or modifies values for one or more MIB variables for an SNMP agent. This command may only be issued by a user with root privileges or by a member of the system group.
If the you specify the get option, the snmpinfo command requests information about one or more MIB variables from an SNMP agent.
If you specify the next option, the snmpinfo command requests information from an SNMP agent about the instances following the specified instances. The next option makes it possible to obtain MIB values without knowledge of the instance qualifiers.
If you specify the set option, the snmpinfo command modifies values for one or more MIB variables for an SNMP agent. Only a few MIB variables are designated read-write. The agent that manages the MIB database may take various actions as a side effect of modifying MIB variables. For example, setting the ifAdminStatus MIB variable to 2 will normally shut down a network interface. The action taken is determined by the implementation of the SNMP agent that manages the database.
If you specify the dump option, the snmpinfo command can be used to traverse the entire MIB tree of a given agent. If a group is passed in as the Variable parameter, the snmpinfo command will traverse that specified path of the MIB tree.
The snmpinfo command has a debug facility that will dump debug information for transmitted and received packets. The facility is enabled with the -d flag.
|Value||Specifies the value to which the MIB Variable parameter is to be set. A value must be specified for each variable. If a value is not specified, the request packet will be invalid.|
|Variable||Specifies the name in text format or numeric format of a specific MIB variable as defined in the /etc/mib.defs file. If the option to the -m flag is next or dump, the Variable parameter may be specified as a MIB group.|
|Instance||Specifies the instance qualifier for the MIB Variable parameter. The Instance parameter is required if the option to the -m flag is get or set. The Instance parameter is optional if the option to the -m flag is next or dump.|
- There should be no blank spaces in the Variable.Instance parameter sequence.
- If the Instance parameter is not specified, do not place a . (dot) after the Variable parameter.
For further information, consult RFC 1213, which defines the Management Information Base (MIB) for network management, and RFC 1157, which defines the SNMP protocol for creating requests for MIB information and formatting responses.
|-c Community||Specifies the community name to be used to query the SNMP agent. If the -c flag is not specified, the default community name is public.|
|-d Level||Specifies the level of I/O debug information. The Level
value can be one of:
|-h HostName||Specifies the host name of the SNMP agent to be queried. If the -h flag is not specified, the default host name is the host name of the machine on which the user is currently logged in.|
|-m Option||Specifies the mode by which to access the MIB variables.
|-o ObjectsFile||Specifies the name of the objects definition file that defines the MIB objects the snmpinfo command can request. If the -o flag is not specified, the default objects definition file name is /etc/mib.defs. See the mosy command for information on creating this file. More than one ObjectsFile can be referenced with the restriction that files containing parent definitions be specified before files containing child definitions.|
|-t Tries||Specifies the number of times the snmpinfo command transmits the SNMP request to the SNMP agent before terminating with the message no SNMP response. If the -t flag is not specified, the default number of tries is 3.|
|-v||Specifies that the output from the snmpinfo command be displayed in verbose mode. If the -v flag is not specified, the information will not be displayed in verbose mode.|
snmpinfo -m get -v sysDescr.0 ifDescr.1
In this example, the -m get flag specifies that the snmpinfo command should retrieve the value of MIB variables ifDescr.1, (the interface description for the interface associated with the ifIndex.1), and sysDescr.0 (the system description of the local host).
snmpinfo -m next -v 220.127.116.11.18.104.22.168.22.214.171.124.154.1
In this example, the -m next flag specifies that the snmpinfo command should retrieve the information for the MIB variable ifAdEntIfIndex.126.96.36.199.
snmpinfo -m next -v -h giants system
In this example, the -m next flag specifies that the snmpinfo command should retrieve the information for the MIB variable following the system group, which is sysDescr.0; the -v flag indicates verbose mode; the -h flag indicates that the agent to be queried is giants; the group to retrieve information from is system.
snmpinfo -m set -v -h giants -c monitor -t 2 ifAdminStatus.1=2
In this example, the MIB ifAdminStatus variable is set to 2, or down, for the interface associated with ifIndex.1 on the host known as giants. The -c flag specifies the community for the host. The -t 2 flag specifies that the snmpinfo command will transmit the SNMP request to the SNMP agent 2 times before terminating if no response is received from the SNMP agent.
snmpinfo -m dump -v interfaces
In this example the interfaces group is dumped in verbose mode.
snmpinfo -m dump
|/etc/mib.defs||Defines the Management Information Base (MIB) variables the SNMP agent should recognize and handle.|
The mosy command.
Understanding the Simple Network Management Protocol (SNMP), Using the Management Information Base (MIB) Database, and Understanding the Management Information Base (MIB) in AIX 5L Version 5.1 Communications Programming Concepts.