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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users