On Thu, Sep 01, 2011 at 10:24:43PM -0400, Doug Manley wrote:
> Has anyone made snmpd perform remote pings recently via "snmpset"?

I'm not that much for numeric OID's, but I have this 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 I call like this

./snmpping localhost ipv4 130.226.1.2

and it works

/Niels

-- 
Niels Baggesen - @home - Ã…rhus - Denmark - [email protected]
The purpose of computing is insight, not numbers   ---   R W Hamming

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to