DISMAN-PING-MIB

From Net-SNMP Wiki
Jump to: navigation, search

The DISMAN WG produced a MIB for performing remote pings from a remote device. This MIB was entitled the DISMAN-PING-MIB.

Net-SNMP Implementation Notes

These modules work, but:

- They are Linux only
- Rows must be created with rowStatus createAndWait before they are populated
- Agent must run as root
- Agent is blocked while tests run
- Data format for InetAddress objects is wrong. It is ASCII, not binary
  (making it easier to use from the command line, but ...)

Helpful Script

Niels Baggesen provided the following useful script:

 #!/bin/bash
 
 WHERE=$1
 KIND=$2
 WHAT=$3
 
 INX='"nba"."A"'
 CRED="-v2c -cpublic -r0"
 
 snmpset $CRED $WHERE \
         DISMAN-PING-MIB::pingCtlRowStatus.$INX = destroy \
 
 snmpset $CRED $WHERE \
 	DISMAN-PING-MIB::pingCtlRowStatus.$INX = createAndWait \
 
 snmpset $CRED $WHERE \
 	DISMAN-PING-MIB::pingCtlTargetAddressType.$INX = $KIND \
 	DISMAN-PING-MIB::pingCtlTargetAddress.$INX = $WHAT \
 	DISMAN-PING-MIB::pingCtlProbeCount.$INX = 10 \
 	DISMAN-PING-MIB::pingCtlAdminStatus.$INX = enabled
 
 snmpset $CRED $WHERE \
 	DISMAN-PING-MIB::pingCtlRowStatus.$INX = active \
 
 snmptable $CRED -Cb -Cw 120 $WHERE DISMAN-PING-MIB::pingCtlTable
 sleep 5
 snmptable $CRED -Cib -Cw 120 $WHERE DISMAN-PING-MIB::pingResultsTable
 snmptable $CRED -Cib -Cw 120 $WHERE DISMAN-PING-MIB::pingProbeHistoryTable

Which will let you call it like this:

 ./snmpping localhost ipv4 130.226.1.2