LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   snmp (ucd-snmp, net-snmp) (http://www.linuxquestions.org/questions/linux-software-2/snmp-ucd-snmp-net-snmp-35392/)

markus1982 11-13-2002 06:09 PM

snmp (ucd-snmp, net-snmp)
 
On some old server I used:
UCD-snmp version: 4.2.5

On a new server installed is NET-SNMP version: 5.0.1 ... now the snmpget part works, just everything EXCEPT snmpset where I always end up with a strange message ...



UCD-snmp version: 4.2.5 version:
snmpget -v 1 xxx.xxx.xxx.xxx mypublic value

NET-SNMP version: 5.0.1 version:
snmpget -v 1 xxx.xxx.xxx.xxx -c mypublic value



This part works fine ... also the snmpwalk part just not snmpset, I end up with "No community name specified.". Now what do I need to specify as community name in that case?


UCD-snmp version: 4.2.5 version:
snmpset -v 1 xxx.xxx.xxx.xxx passwordstring value i yyyy

?? NET-SNMP version: 5.0.1 version ??


Quote:

UCD-snmp version: 4.2.5 version help
Usage: snmpset [options...] <hostname> {<community>} [<objectID> <type> <value> ...]

UCD-snmp version: 4.2.5
-h this help message.
-H Display configuration file directives understood.
-V display version number.
-v 1|2c|3 specifies snmp version to use.
SNMP Version 1 or 2c specific
-c <c> set the community name (v1 or v2c)
SNMP Version 3 specific
-Z <B,T> set the destination engine boots/time for v3 requests.
-e <E> security engine ID (e.g., 800000020109840301).
-E <E> context engine ID (e.g., 800000020109840301).
-n <N> context name (e.g., bridge1).
-u <U> security name (e.g., bert).
-l <L> security level (noAuthNoPriv|authNoPriv|authPriv).
-a <A> authentication protocol (MD5|SHA)
-A <P> authentication protocol pass phrase.
-x <X> privacy protocol (DES).
-X <P> privacy protocol pass phrase
General communication options
-p <P> use port P instead of the default port.
-T <LAYER> use LAYER for the network layer.
(UDP or TCP).
-t <T> set the request timeout to T.
-r <R> set the number of retries to R.
Debugging
-d dump input/output packets.
-D all | <TOKEN[,TOKEN,...]> turn on debugging output for the specified TOKENs.
General options
-m all | <MIBS> use MIBS list instead of the default mib list.
-M <MIBDIRS> use MIBDIRS as the location to look for mibs.
-P <MIBOPTS> Toggle various defaults controlling mib parsing:
MIBOPTS values:
u: allow the usage of underlines in mib symbols.
c: disallow the usage of "--" to terminate comments.
d: save the descriptions of the mib objects.
e: Disable mib errors of MIB symbols conflicts
w: Enable mib warnings of MIB symbols conflicts
W: Enable detailed warnings of MIB symbols conflicts
R: Replace MIB symbols from latest module
-O <OUTOPTS> Toggle various defaults controlling output display:
OUTOPTS values:
n: Print oids numerically.
e: Print enums numerically.
E: Escape quotes in string indices.
X: Extended index format
b: Dont break oid indexes down.
q: Quick print for easier parsing.
f: Print full oids on output.
s: Print only last symbolic element of oid.
S: Print MIB module-id plus last element.
t: Print timeticks unparsed as numeric integers.
v: Print Print values only (not OID = value).
T: Print human-readable text along with hex strings.
-I <INOPTS> Toggle various defaults controlling input parsing:
INOPTS values:
R: Do random access to oid labels.
r: Don't check values for range/type legality.
b: Do best/regex matching to find a MIB node.
type - one of i, u, t, a, o, s, x, d, b, n
i: INTEGER, u: unsigned INTEGER, t: TIMETICKS, a: IPADDRESS
o: OBJID, s: STRING, x: HEX STRING, d: DECIMAL STRING, b: BITS
U: unsigned int64, I: signed int64, F: float, D: double

Quote:

NET-SNMP version: 5.0.1 version help
USAGE: snmpset [OPTIONS] AGENT OID TYPE VALUE [OID TYPE VALUE]...

Version: 5.0.1
Web: http://www.net-snmp.org/
Email: net-snmp-coders@lists.sourceforge.net

OPTIONS:
-h, --help display this help message
-H display configuration file directives understood
-v 1|2c|3 specifies SNMP version to use
-V, --version display package version number
SNMP Version 1 or 2c specific
-c COMMUNITY set the community string
SNMP Version 3 specific
-a PROTOCOL set authentication protocol (MD5|SHA)
-A PASSPHRASE set authentication protocol pass phrase
-e ENGINE-ID set security engine ID (e.g. 800000020109840301)
-E ENGINE-ID set context engine ID (e.g. 800000020109840301)
-l LEVEL set security level (noAuthNoPriv|authNoPriv|authPriv)
-n CONTEXT set context name (e.g. bridge1)
-u USER-NAME set security name (e.g. bert)
-x PROTOCOL set privacy protocol (DES)
-X PASSPHRASE set privacy protocol pass phrase
-Z BOOTS,TIME set destination engine boots/time
General communication options
-r RETRIES set the number of retries
-t TIMEOUT set the request timeout (in seconds)
Debugging
-d dump input/output packets in hexadecimal
-D TOKEN[,...] turn on debugging output for the specified TOKENs
(ALL gives extremely verbose debugging output)
General options
-m MIB[:...] load given list of MIBs (ALL loads everything)
-M DIR[:...] look in given list of directories for MIBs
-P MIBOPTS Toggle various defaults controlling MIB parsing:
u: allow the use of underlines in MIB symbols
c: disallow the use of "--" to terminate comments
d: save the DESCRIPTIONs of the MIB objects
e: disable errors when MIB symbols conflict
w: enable warnings when MIB symbols conflict
W: enable detailed warnings when MIB symbols conflict
R: replace MIB symbols from latest module
-O OUTOPTS Toggle various defaults controlling output display:
b: do not break OID indexes down
e: print enums numerically
E: escape quotes in string indices
f: print full OIDs on output
n: print OIDs numerically
q: quick print for easier parsing
Q: quick print with equal-signs
s: print only last symbolic element of OID
S: print MIB module-id plus last element
t: print timeticks unparsed as numeric integers
T: print human-readable text along with hex strings
u: print OIDs using UCD-style prefix suppression
v: print values only (not OID = value)
X: extended index format
-I INOPTS Toggle various defaults controlling input parsing:
b: do best/regex matching to find a MIB node
r: do not check values for range/type legality
R: do random access to OID labels
u: top-level OIDs must have '.' prefix (UCD-style)

TYPE: one of i, u, t, a, o, s, x, d, b, n
i: INTEGER, u: unsigned INTEGER, t: TIMETICKS, a: IPADDRESS
o: OBJID, s: STRING, x: HEX STRING, d: DECIMAL STRING, b: BITS
U: unsigned int64, I: signed int64, F: float, D: double

Found some information on http://www.david-guerrero.com/papers/snmp/ but I'm not sure if the access-list is the problem... seems like the router configuration should be reviewed ...

markus1982 11-21-2002 11:45 AM

I have been wrong that it's a password string, it's the COMMUNITY name. So:

UCD-snmp version: 4.2.5 version:
snmpset -v 1 xxx.xxx.xxx.xxx community_name value i yyyy

you just would need to use
snmpset -c community_name -v 1 xxx.xxx.xxx.xxx value i yyyy


All times are GMT -5. The time now is 03:32 PM.