Cisco Remote ping OID related Q.

Ajay Chenampara <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Can anyone help out with this OID? I'm trying to set the remote destination IP address through this code, but it doesnt work.

$OID = "1.3.6.1.4.1.9.9.16.1.1.1.3";
my $IP1 = encode_hex($pA);
my $IP2 = encode_hex($ipB);
my $IP3 = encode_hex($ipC);
my $IP4 = encode_hex($ipD);
print "$ipA\n$ipB\n$ipC\n$ipD\n";
print "$IP1\n$IP2\n$IP3\n$IP4\n";
$vb = new SNMP::Varbind([$OID,'1000', "$IP1 $IP2 $IP3 $IP4",'OCTETSTR']);
$var = $session->set($vb);
print $var;
die("U\nU\nU\nU\nU\n")  unless ($var eq "0 but true" );

Ajay Chenampara <[email protected]> wrote: from the link http://net-snmp.sourceforge.net/docs/perl-SNMP-README.html
the canonical formats for snmp <vals> are as below:
but how do i set a "STRING" in that case ( to pass the tftp file name info for eg)

OBJECTID => dotted-decimal (e.g., .1.3.6.1.2.1.1.1)
       OCTETSTR => perl scalar containing octets,
              INTEGER => decimal signed integer (or enum),
       NETADDR => dotted-decimal,
       IPADDR => dotted-decimal,
       COUNTER => decimal unsigned integer,
       COUNTER64  => decimal unsigned integer,
       GAUGE,  => decimal unsigned integer,
       UINTEGER,  => decimal unsigned integer,
                            TICKS,  => decimal unsigned integer,
                            OPAQUE => perl scalar containing octets,
              NULL,  => perl scalar containing nothing,


"Brian A. Seklecki" <[email protected]>  wrote: On Mon, 2007-06-25 at 14:37 -0700, Ajay Chenampara wrote:
> Hi there,
> I know im overlooking something here and i hope someone here will be
> able to point it out...
> Im writing a script to download our s/w and router configs via tftp
> using snmp commands.


It helps to load the MIB "CISCO-CONFIG-COPY-MIB".  Note about this
script, it should poll() ccCopyEntryRowStatus.2 before read()/write(),
but this this is blind faith.

~BAS

--------


$ more signalIOSBackup.sh 
#!/usr/local/bin/bash

# $Id: signalIOSBackup.sh 209 2007-06-26 17:38:25Z seklecki $ 
# Brian A. Seklecki - Collaborative Fusion, Inc.

function usage() {
        echo "USAGE:"
        echo "  $0 [Destination IP/Hostname]"
}

if [ ! -n "${1}" ]; then
        echo "Destination Radware  Device Not Specified, BAILING!"
        usage;
        exit 1;
fi

# Options
COMMUNITY=foo

export MIBS=CISCO-CONFIG-COPY-MIB

SNMPSET="/usr/local/bin/snmpset"

SNMPOPT="-c ${COMMUNITY} -v2c "
SNMPSET="${SNMPSET} ${SNMPOPT}"

#FACILITY=pitbpa1

# Default New TFTP Destination Config
if [ -n "${2}" ]; then
        TFTP_DESTINATION="$2";
else 
        TFTP_DESTINATION=192.168.96.39;
fi

# first set it to CLI mode
$SNMPSET ${1} ccCopyProtocol.2 i 1 \
        ccCopySourceFileType.2 i 4   \
        ccCopyDestFileType.2 i 1 \
        ccCopyServerAddress.2 a "${TFTP_DESTINATION}" \
        ccCopyFileName.2 s "${1}.txt" \
        ccCopyEntryRowStatus.2 i 4

if [ $? -ne 0 ]; then
        echo "SNMP Signal to ${1} failed";
        exit 1;
fi

sleep 5;

$SNMPSET ${1} ccCopyEntryRowStatus.2 i 6


-------------------


        

---------------------------------
Got a little couch potato? 
 Check out fun summer activities for kids.-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users


 
---------------------------------
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.