SNMP remote PING example

The example shows how to use the z/OS UNIX snmp get command to perform a remote ping to an IPv4 remote host:
       snmp -h mvs1 -c mvs150 get ibmMvsRemPingResponseTime.2048.5.1.4.9.37.33.175
where:
      host_name = mvs1
 
      community_name  = mvs150
 
      mib_variable  = ibmMvsRemPingResponseTime.2048.5.1.4.9.37.33.175  where:
 
               packet size     = 2048 bytes
               time-out        = 5 seconds
               ip_address      = 1. (IP address type is ipv4)
                                 4. (IP address length is 4 for ipv4)
                                 9.37.33.175 (IPv4 address)
The expected response is as follows:
    1.3.6.1.4.1.2.6.19.2.2.1.2.1.5.2048.5.1.4.9.37.33.175=33

The variable value in the previous example is a positive value (33) indicating a successful response. The variable number, when positive, is the round-trip response time, in milliseconds, from the SNMP agent host system to the requested destination IP address. The following example shows how to use the z/OS UNIX snmp get command to perform a remote ping to IPv6 remote host 2001:0DB8::1 :

snmp -h mvs1 -c mvs150 get ibmMvsRemPingResponseTime.2048.5.2.16.32.1.13.184.0.0.0.0.0.0.0.0.0.0.0.1

where:

     host_name = mvs1
     community_name  = mvs150
     mib_variable  = ibmMvsRemPingResponseTime.2048.5.2.16.32.1.13.184.0.0.0.0.0.0.0.0.0.0.0.1 where:
                        packet size     = 2048 bytes
                        time-out        = 5 seconds
                    	 ip_address      = 2. (IP address type is ipv6)
                               			     16. (IP address length)
                                          32.1.13.184.0.0.0.0.0.0.0.0.0.0.0.1 (IP address)

The expected response is as follows:

     1.3.6.1.4.1.2.6.19.2.2.1.2.1.5.2048.5.2.16.254.192.0.0.0.0.0.0.0.0.0.0.0.0.0.1 = 33

The variable value can be a negative integer indicating that a failure has occurred. A negative integer is a result of the SNMP agent or TCP/IP subagent detecting either an internal error, an incorrect MIB instance format, an ICMP echo request timeout, an incorrect packet size value, an incorrect timeout value or an incorrect destination IP address. See Table 1 for a description of what the variable value can represent.

Table 1. SNMP Get command responses for variable value
Returned value Description Condition Valid input
>0 (milliseconds) Round-Trip Response Time Success N/A
-1 Internal error Failure N/A
-2 ICMP echo request timed out Failure N/A
-3 Destination was IPv6 but subagent stack not IPv6 enabled Failure N/A
-4 Incorrect packet size Failure 0, 16–4096 (bytes)
-5 Incorrect timeout Failure 0, 3–15 (seconds)
-6 Unknown destination IP address Failure IP address types of 1, 2, or 4; IP address lengths of 4, 16, or 20; fully-qualified IP address.
-7 Incorrect MIB instance format Failure Packet size.timeout.IP address type.length.address
Note: The packet size and the timeout in the mib_variable value part of the snmp get command can have a value of 0, which indicates that the default values are 256 bytes and 10 seconds, respectively.