Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Junos] SNMP Remote Ping Operation on Junos

0

0

Article ID: KB26596 KB Last Updated: 30 Aug 2021Version: 5.0
Summary:
This article provides information about the SNMP remote operation on Junos.
Symptoms:
RFC 2925 defines the MIBs for performing remote ping, traceroute, and lookup operations on a remote host. Currently, Junos supports two SNMP remote operations: ping and traceroute.
Solution:
To use the SNMP remote operation, an SNMP community should be configured with authentication read-write on Junos.
  1. Set the SNMP view:
    root# show snmp 
    view remote-vie {
        oid 1.3.6.1.2.1.80 include;             # pingMIB
        oid 1.3.6.1.4.1.2636.3.7 include;       # jnxPingMIB
        oid 1.3.6.1.2.1.81 include;             # traceRouteMIB
        oid 1.3.6.1.4.1.2636.3.8 include;       # jnxTraceRouteMIB
    }
    
  2. Set the SNMP community:
    community ping {
        view remote-vie;
        authorization read-write;
    }     
    
These parameters must be set, before SNMP ping is enabled:
  • pingCtlRowStatus - oid:.1.3.6.1.2.1.80.1.2.1.23
  • pingCtlOwnerIndex - oid:.1.3.6.1.2.1.80.1.2.1.1 --- not accessible
  • pingCtlTestName - oid:.1.3.6.1.2.1.80.1.2.1.2 --- not accessible
  • pingCtlTargetAddressType - oid:.1.3.6.1.2.1.80.1.2.1.3
  • pingCtlTargetAddress - oid:.1.3.6.1.2.1.80.1.2.1.4

Notice pingCtlOwnerIndex and pingCtlTestName cannot be accessed.  To reference the pingCtlTargetAddress variable of a row in pingCtlTable, in which pingCtlOwnerIndex and pingCtlTestName are test, use this object identifier:
pingMIB.pingObjects.pingCtlTable.pingCtlEntry.pingCtlTargetAddress."test"."test"  
 =   .1.3.6.1.2.1.80.1.2.1.8.4.116.101.115.116.4.116.101.115.116
The first test string represents pingCtlOwnerIndex (translated to UTF8 as 4.116.101.115.116), 4 means string length, 116.101.115.116 means test. The secondary test string represents pingCtlTestName.


To enable remote ping on the SNMP manager, perform this procedure:
  1. set pingCtlRowStatus to create-and-wait:
    [root@lab-svr-2 ~]# snmpset -v 1 -c ping -d 172.27.103.32 .1.3.6.1.2.1.
    80.1.2.1.23.4.116.101.115.116.4.116.101.115.116 i 5
    pingCtlRowStatus known values:
    1 --- active
    2 --- not in service
    3 --- not ready
    4 --- create and go
    5 --- create and wait
    6 --- destroy 
    
  2. set pingCtlTargetAddressType to IPv4:
    [root@lab-svr-2 ~]# snmpset -v 1 -c ping -d 172.27.103.32 .1.3.6.1.2.1.80.1.2.1
    .3.4.116.101.115.116.4.116.101.115.116 i 1
    pingCtlTargetAddressType known values:
    1 --- ipv4
    2 --- ipv6
    3 --- ipv4z
    4 --- ipv6z
    16--- dns
    
  3. set pingCtlTargetAddress to target the IPv4 address(172.27.103.1) tag that is represented by Hex:
    [root@lab-svr-2 ~]# snmpset -v 1 -c ping -d 172.27.103.32 .1.3.6.1.2.1.80.1.2.
    1.4.4.116.101.115.116.4.116.101.115.116 x "AC 1B 67 01"
    
  4. [option]set pingCtlFrequency (oid:.1.3.6.1.2.1.80.1.2.1.10); the number of seconds to wait before repeating a ping test, as defined by the value of the various objects in the corresponding row. A value of 0 for this object implies that the test as defined by the corresponding entry will not be repeated:
    [root@lab-svr-2 ~]# snmpset -v 1 -c ping -d 172.27.103.32 .1.3.6.1.2.1.80.1.2.1.10
    .4.116.101.115.116.4.116.101.115.116 u 1
    
  5. [option]set pingCtlProbeCount (oid:.1.3.6.1.2.1.80.1.2.1.7); the number of probes used to calculate average, maximum, and minimum value:
    [root@lab-svr-2 ~]# snmpset -v 1 -c ping -d 172.27.103.32 .1.3.6.1.2.1.80.1.2.1.7
    .4.116.101.115.116.4.116.101.115.116 i 5
    
  6. Set pingCtlRowStatus to active:
    [root@lab-svr-2 ~]# snmpset -v 1 -c ping -d 172.27.103.32 .1.3.6.1.2.1.80.1.2.1.
    23.4.116.101.115.116.4.116.101.115.116 i 1
    
  7. Set pingCtlAdminStatus (oid:.1.3.6.1.2.1.80.1.2.1.8) to enable to start remote ping:
    [root@lab-svr-2 ~]# snmpset -v 1 -c ping -d 172.27.103.32 .1.3.6.1.2.1.80.
    1.2.1.8.4.116.101.115.116.4.116.101.115.116 i 1
    pingCtlAdminStatus known values:
    1 --- enable
    2 --- disable
    
  8. Stop the remote ping:
    [root@lab-svr-2 ~]# snmpset -v 1 -c ping -d 172.27.103.32 
    .1.3.6.1.2.1.80.1.2.1.8.4.116.101.115.116.4.116.101.115.116 i 2
    

The above operation is similar to the following actions:
  • Telnet to 172.27.103.32.
  • ping inet 172.27.103.1 count 5 interval 1

Sample remote ping test result:
Note: enable service rpm to active snmp remote ping: set services rpm.
root# run show snmp mib walk .1.3.6.1.2.1.80.1    
pingMaxConcurrentRequests.0 = 100
pingCtlTargetAddressType.4.116.101.115.116.4.116.101.115.116 = 1 
-> Protocol Type : IPv4
pingCtlTargetAddress.4.116.101.115.116.4.116.101.115.116 = ac 1b 67 01  
-> Target IP Address : 172.27.103.1
pingCtlDataSize.4.116.101.115.116.4.116.101.115.116 = 0
pingCtlTimeOut.4.116.101.115.116.4.116.101.115.116 = 3
pingCtlProbeCount.4.116.101.115.116.4.116.101.115.116 = 5               
-> Number of probe : 5
pingCtlAdminStatus.4.116.101.115.116.4.116.101.115.116 = 1
pingCtlDataFill.4.116.101.115.116.4.116.101.115.116 = 00 
pingCtlFrequency.4.116.101.115.116.4.116.101.115.116 = 1                
-> How often to send ping packet : 1 sec
pingCtlMaxRows.4.116.101.115.116.4.116.101.115.116 = 50
pingCtlStorageType.4.116.101.115.116.4.116.101.115.116 = 2
pingCtlTrapGeneration.4.116.101.115.116.4.116.101.115.116 = 00 
pingCtlTrapProbeFailureFilter.4.116.101.115.116.4.116.101.115.116 = 0
pingCtlTrapTestFailureFilter.4.116.101.115.116.4.116.101.115.116 = 0
pingCtlType.4.116.101.115.116.4.116.101.115.116 = pingIcmpEcho          
-> Probe Type
pingCtlDescr.4.116.101.115.116.4.116.101.115.116 = 00 
pingCtlSourceAddressType.4.116.101.115.116.4.116.101.115.116 = 1
pingCtlSourceAddress.4.116.101.115.116.4.116.101.115.116
pingCtlIfIndex.4.116.101.115.116.4.116.101.115.116 = 0
pingCtlByPassRouteTable.4.116.101.115.116.4.116.101.115.116 = 2
pingCtlDSField.4.116.101.115.116.4.116.101.115.116 = 0
pingCtlRowStatus.4.116.101.115.116.4.116.101.115.116 = 1
pingResultsOperStatus.4.116.101.115.116.4.116.101.115.116 = 1
pingResultsIpTargetAddressType.4.116.101.115.116.4.116.101.115.116 = 0
pingResultsIpTargetAddress.4.116.101.115.116.4.116.101.115.116
pingResultsMinRtt.4.116.101.115.116.4.116.101.115.116 = 2               
-> Minimum Round Trip Time
pingResultsMaxRtt.4.116.101.115.116.4.116.101.115.116 = 4               
-> Maximum Round Trip Time
pingResultsAverageRtt.4.116.101.115.116.4.116.101.115.116 = 3           
-> Average Round Trip Time
pingResultsProbeResponses.4.116.101.115.116.4.116.101.115.116 = 5
pingResultsSentProbes.4.116.101.115.116.4.116.101.115.116 = 5
pingResultsRttSumOfSquares.4.116.101.115.116.4.116.101.115.116 = 99
pingResultsLastGoodProbe.4.116.101.115.116.4.116.101.115.116 = 07 dc 0c 19  03 18 30 00  2b 00 00 
pingProbeHistoryResponse.4.116.101.115.116.4.116.101.115.116.1 = 3
pingProbeHistoryResponse.4.116.101.115.116.4.116.101.115.116.2 = 3
pingProbeHistoryResponse.4.116.101.115.116.4.116.101.115.116.3 = 2
pingProbeHistoryResponse.4.116.101.115.116.4.116.101.115.116.4 = 3      
-> 1st result of last 5 probes
pingProbeHistoryResponse.4.116.101.115.116.4.116.101.115.116.5 = 4      
-> 2nd result of last 5 probes
pingProbeHistoryResponse.4.116.101.115.116.4.116.101.115.116.6 = 3      
-> 3rd result of last 5 probes
pingProbeHistoryResponse.4.116.101.115.116.4.116.101.115.116.7 = 2      
-> 4th result of last 5 probes
pingProbeHistoryResponse.4.116.101.115.116.4.116.101.115.116.8 = 3      
-> 5th result of last 5 probes
pingProbeHistoryStatus.4.116.101.115.116.4.116.101.115.116.1 = 1
pingProbeHistoryStatus.4.116.101.115.116.4.116.101.115.116.2 = 1
pingProbeHistoryStatus.4.116.101.115.116.4.116.101.115.116.3 = 1
pingProbeHistoryStatus.4.116.101.115.116.4.116.101.115.116.4 = 1
pingProbeHistoryStatus.4.116.101.115.116.4.116.101.115.116.5 = 1
pingProbeHistoryStatus.4.116.101.115.116.4.116.101.115.116.6 = 1
pingProbeHistoryStatus.4.116.101.115.116.4.116.101.115.116.7 = 1
pingProbeHistoryStatus.4.116.101.115.116.4.116.101.115.116.8 = 1        
-> 1 = "received", 4 = "request Timeout"

Modification History:
2021-08-14: Added note to enable service rpm

Related Links

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search