To issue an SNMP request from NetView®, use the SNMP command. The SNMP command provides SNMP manager function with the NetView program to query SNMP agents for network management information.
The NetView SNMP command uses the SNMP Query Engine to issue SNMP requests to agents and to process SNMP responses returned by agents. The SNMP command supports issuance of SNMPv1 requests.
The SNMP command does not support the use of IPv6 addresses.
Getting MIB Variables:
>>-SNMP--+-Get------+--host_name--community_name----------------> '- GETNext ' .----------. V | >----var_name-+------------------------------------------------><
Setting the MIB Variables:
.-----------------. V | >>-SNMP Set--host_name--community_name----var_name--value-+----><
Finding an ASN.1 Variable Name:
>>-SNMP MIBvname--asn.1 name-----------------------------------><
Forwarding Traps:
>>-SNMP TRAPson--net_mask--net_desired-------------------------><
Stop Forwarding Traps:
>>-SNMP TRAPSOFf--filter_id------------------------------------><
Pinging a Node:
>>-SNMP PING--host_name----------------------------------------><
All MIB variables that are defined as part of a sequence represent variables that can have more than one occurrence. These variables require an instance identifier appended to the end of the variable name to identify which occurrence of the variable is being requested.
When you request traps using the SNMP TRAPSON command, it returns a request number or filter_id, which the SNMP Query Engine associates with the TRAPSON request. To stop receiving traps, specify this filter_id in the TRAPSOFF request.
Return code | Description |
---|---|
1 | Error from DSIGET, cannot continue |
2 | Incorrect function specified |
3 | Missing SNMP function |
4 | Not enough parameters |
5 | Missing variable name |
6 | Missing variable value |
7 | Missing or incorrect host name |
8 | Missing community name |
9 | SNMPIUCV not active |
10 | Error from DSIMQS |
11 | Incorrect net_mask⁄desired network |
12 | Missing⁄Incorrect trap filter_id |
1001+ | Command successful — all return codes above 1000 |
hostname - anyhost
IP address - 129.34.222.72
community name - public
variable name - sysDescr.0
asn.1 variable name - 1.3.6.1.2.1.1.1.0
variable name - sysObjectID.0
asn.1 variable name - 1.3.6.1.2.1.1.2.0
variable name - sysUpTime.0
asn.1 variable name - 1.3.6.1.2.1.1.3.0
snmp get 129.34.222.72 public 1.3.6.1.2.1.1.1.0
snmp get 129.34.222.72 public sysDescr.0
snmp get anyhost public 1.3.6.1.2.1.1.1.0
snmp get anyhost public sysDescr.0
snmp get anyhost public sysObjectID.0
snmp get anyhost public sysUpTime.0
snmp get anyhost public sysDescr.0 sysObjectID.0 sysUpTime.0
SNM050I SNMP Request 1001 from NETOP accepted, sent to Query Engine
SNM040I SNMP Request 1001 from NETOP Returned the following response:
SNM042I Variable name: 1.3.6.1.2.1.1.1.0
SNM043I Variable value type: 9
SNM044I Variable value: AIX 2.2.1 SNMP Agent Version 1.0
SNM042I Variable name: 1.3.6.1.2.1.1.2.0
SNM043I Variable value type: 3
SNM044I Variable value: 1.3.6.1.4.1.2.1.1
SNM042I Variable name: 1.3.6.1.2.1.1.3.0
SNM043I Variable value type: 8
SNM044I Variable value: 98800
SNM049I SNMP Request 1001 end of response
hostname - anyhost
IP address - 129.34.222.72
community name - public
variable name - ifAdminStatus (in ifTable)
asn.1 variable name - 1.3.6.1.2.1.2.2.1.7
snmp getnext 129.34.222.72 public 1.3.6.1.2.1.2.2.1.7.0
snmp getnext 129.34.222.72 public ifAdminStatus.0
snmp getnext anyhost public 1.3.6.1.2.1.2.2.1.7.0
snmp getnext anyhost public ifAdminStatus.0
SNM040I SNMP Request 1001 from NETOP Returned the following response:
SNM042I Variable name: 1.3.6.1.2.1.2.2.1.7.1
SNM043I Variable value type: 1
SNM044I Variable value: 1
SNM049I SNMP Request 1001 end of response
In this example, the first instance of the variable has a status of 1 or greater (ends in 7.1).
snmp getnext 129.34.222.72 public 1.3.6.1.2.1.2.2.1.7.1
snmp getnext 129.34.222.72 public ifAdminStatus.1
snmp getnext anyhost public 1.3.6.1.2.1.2.2.1.7.1
snmp getnext anyhost public ifAdminStatus.1
SNM040I SNMP Request 1002 from NETOP Returned the following response:
SNM042I Variable name: 1.3.6.1.2.1.2.2.1.7.2
SNM043I Variable value type: 1
SNM044I Variable value: 1
SNM049I SNMP Request 1002 end of response
In this example, the second instance of the variable has a status of 1 or greater (ends in 7.2).
snmp getnext 129.34.222.72 public 1.3.6.1.2.1.2.2.1.7.2
snmp getnext 129.34.222.72 public ifAdminStatus.2
snmp getnext anyhost public 1.3.6.1.2.1.2.2.1.7.2
snmp getnext anyhost public ifAdminStatus.2
SNM040I SNMP Request 1003 from NETOP Returned the following response:
SNM042I Variable name: 1.3.6.1.2.1.2.2.1.8.1
SNM043I Variable value type: 1
SNM044I Variable value: 1
SNM049I SNMP Request 1003 end of response
hostname - anyhost
IP address - 129.34.222.72
community name - publicw
variable name - ifAdminStatus
asn.1 variable name - 1.3.6.1.2.1.2.2.1.7.1
(instance 1)
snmp set 129.34.222.72 publicw 1.3.6.1.2.1.2.2.1.7.1 3
snmp set 129.34.222.72 publicw IfAdminStatus.1 3
snmp set anyhost publicw 1.3.6.1.2.1.2.2.1.7.1 3
snmp set anyhost publicw ifAdminStatus.1 3
SNM050I SNMP Request 1001 from NETOP accepted, sent to Query Engine
SNM040I SNMP Request 1001 from NETOP Returned the following response:
SNM042I Variable name: 1.3.6.1.2.1.2.7.1
SNM043I Variable value type: 1
SNM044I Variable value: 3
SNM049I SNMP Request 1001 end of response
The SNMP TRAPSON command permits the specification of a filtering condition that enables the Query Engine to perform filtering. The SNMP TRAPSON command assigns a unique request number to each filter (also called a filter_id) and returns this number in a message and in the return code. This filter_id is the argument to an SNMP TRAPSOFF command, which is used to stop receiving traps that pass this filter.
IP address - 129.34.222.72
net mask - 255.255.255.255
snmp trapson
snmp trapson 255.255.255.255 129.34.222.72
The first command receives all traps (the default is a mask of 0 and a required network of 0). The second command receives traps only from the specific host 129.34.222.72.
SNM050I SNMP Request 1001 from NETOP accepted, sent to Query Engine
The
number returned in the message (1001 in the previous example) is used
as the filter_id. This filter_id is
displayed in the header message of traps passed by this filter. The filter_id is
used in the TRAPSOFF command to turn the filter off.SNM040I SNMP Request 1001 from NETOP Returned the following response:
SNM045I Major error code: 0
SNM046I Minor error code: 0
SNM047I Error index: 0
SNM048I Error text: no error
SNM049I SNMP Request 1001 end of response
SNM030I SNMP request 1001 received following trap:
SNM031I Agent Address: 129.34.222.34
SNM032I Generic trap type: 4
SNM033I Specific trap type: 0
SNM034I Time stamp: 472600
SNM035I Enterprise Object ID: 1.3.6.1.4.1.2.1.1
SNM039I SNMP request 1001 End of trap data
AUTH MSGRECVR=YES
However, only one operator
receives the message. The message also goes to the log file, so you
can always browse the log file to see trap data. Additionally, you
can assign trap messages to go to a specific operator using the NetView ASSIGN operator command.In the response to the SNMP TRAPSON request, not all lines need to be present, but the first line is always message SNM040I, and the last line is always message SNM049I.
For the multiline trap message, not all lines need to be present, but the first line is always message SNM030I, and the last line is always message SNM039I.
Additional messages (SNM036I—SNM038I) could be present if the trap has additional data.
If a variable value is too long, message SNM038 might not fit on an 80-character line. If this happens, the value is split and multiple SNM038 messages are displayed.
The SNMP trap data always displays the variable name in ASN.1 notation. You can use SNMP MIBVNAME to obtain the textual name for the variable.
A trap always shows the agent address in the form of an IP address in dotted decimal notation.
You can issue multiple TRAPSON requests, with either the same or a different filter. If a trap passes multiple filters, the trap is sent to the NetView program multiple times. However, in the NetView program, the header and trailer lines (messages SNM030I and SNM039I) of the duplicate trap are different, because they contain the filter_id (request number) by which the trap was forwarded. Different types of traps from different hosts can have the same filter_id, if these traps pass the same trap filter.
The SNMP Query Engine can forward only those traps that it receives. Each agent has a trap destination table, which lists all the hosts that receive that agent’s traps. The host name of your system must be in the trap destination table of all agents from which you want to receive traps.
snmp trapsoff 1001
SNM050I SNMP Request 1001 from NETOP accepted, sent to Query Engine
SNM040I SNMP Request 1002 from NETOP Returned the following response:
SNM045I Major error code: 0
SNM046I Minor error code: 0
SNM047I Error index: 0
SNM048I Error text: no error
SNM049I SNMP Request 1002 end of response
Only one filter_id for each SNMP TRAPSOFF command can be passed. Extraneous arguments are ignored.
SNM030I SNMP request 1001 received following trap:
SNM031I Agent Address: 129.34.222.34
SNM032I Generic trap type: 2
SNM033I Specific trap type: 0
SNM034I Time stamp: 472600
SNM035I Enterprise Object ID: 1.3.6.1.4.1.2.1.1
SNM036I Variable name: 1.3.6.1.2.1.2.2.1.1
SNM037I Variable value type: 1
SNM038I Variable value: 2
SNM039I SNMP request 1001 End of trap data
snmp mibvname 1.3.6.1.2.1.2.2.1.1
SNM050I SNMP Request 1002 from NETOP accepted, sent to Query Engine
SNM040I SNMP Request 1002 from NETOP Returned the following response:
SNM042I Variable name: 1.3.6.1.2.1.2.2.1.1
SNM043I Variable value type: 9
SNM044I Variable value: ifIndex
SNM049I SNMP Request 1002 end of response
Only one ASN.1 variable name can be passed for each SNMP MIBVNAME command. Additional parameters are ignored.
nodename - anynode
IP address - 129.34.222.72
SNMP PING ANYNODE
SNMP PING 129.34.222.72
SNM050I SNMP Request 1001 from NETOP accepted, sent to Query Engine
SNM040I SNMP Request 1001 from NETOP Returned the following response:
SNM042I Variable name: 1.3.6.1.4.1.2.2.1.3.2.129.34.222.72
SNM043I Variable value type: 1
SNM044I Variable value: 26
SNM049I SNMP Request 1001 end of response
The Query Engine issues one PING (an ICMP echo on a raw socket) and returns the value in milliseconds in an IBM-defined SNMP variable minRTT. Because only one PING is issued, this is also the average and the maximum response time.
If the PING does not respond, the Query Engine tries again twice, once after one second and again after two seconds (Query Engine default retry mechanism). If a response is not received after all retries have been exhausted, a variable value of -1 is returned to indicate that a reply was not received.
The 129.34.222.72 in the example for the SNMP PING command represents an instance of the IBM® variable minRTT.
Only one node name can be passed for each SNMP PING command.
SNMP uses ICMP Echo to send a PING command to the remote host. No SNMP PDU exchange with the remote host occurs. Therefore, a successful SNMP PING indicates only that the remote host is active and reachable. It does not indicate that the SNMP agent at the remote host is active, or that the SNMP manager can send requests to the SNMP agent if it is active.
SNM045I Major error code: n
SNM046I Minor error code: y
SNM047I Error index: z
SNM048I Error text: message text
For information about the variable ibmMvsRPingResponseTime, which enables you to send remote PING commands, see SNMP remote PING.
For a list of variables supported by the z/OS Communications Server IP agent, see Management Information Base (MIB) objects.