SNMPSET(1)
π SNMPSET(1) π
okay so bestie, welcome to SNMPSET from the Net-SNMP fam β this is the one that writes, not just reads. buckle up π
β¨ NAME β¨
snmpset β talks to a network entity using SNMP SET requests π«Ά
πΈ SYNOPSIS πΈ
snmpset [COMMON OPTIONS] AGENT OID TYPE VALUE [OID TYPE VALUE]...
π¦ DESCRIPTION π¦
so snmpset is an SNMP application that uses the SNMP SET request to actually set information on a network entity. like, you're not just peeking anymore, you're changing stuff. main character energy fr π
you gotta give it one or more object identifiers (OIDs) as arguments on the command line β that's non-negotiable. and every single object identifier has to come with a type and a value to be set, like a little trio walking in together. each variable name is written in the format that's spelled out in variables(5).
the TYPE is one single character, and here's the whole squad π:
iβ INTEGERuβ UNSIGNEDsβ STRINGxβ HEX STRINGdβ DECIMAL STRINGnβ NULLOBJoβ OBJIDtβ TIMETICKSaβ IPADDRESSbβ BITS
most of these will use the obvious corresponding ASN.1 type, no surprises. but listen β s, x, d and b are all different ways of specifying an OCTET STRING value, and the u unsigned type is also what handles Gauge32 values. iykyk π
now, if you have the proper MIB file loaded, you can, in most cases, replace the type with an = sign instead. for an object of type OCTET STRING it'll assume a string, just like the s type notation does. for other types it'll do "The Right Thing". iconic behavior honestly.
for example:
snmpset -c private -v 1 test-hub system.sysContact.0 s
dpz@noc.rutgers.edu ip.ipforwarding.0 = 2
this will set the variables sysContact.0 and ipForwarding.0:
system.sysContact.0 = STRING: "dpz@noc.rutgers.edu"
ip.ipForwarding.0 = INTEGER: not-forwarding(2)
and if the network entity has an error processing the request packet, an error packet will be returned and a message will be shown β which helps you pinpoint exactly in what way the request was malformed. not me getting a lil error message to tell me what i did wrong π so helpful tho.
π OPTIONS π
snmpset takes the common options described in the snmpcmd(1) manual page. go read that one, bestie, it's the shared lore β¨
β οΈ heads up: snmpset REQUIRES an argument specifying the agent to query, and at least one set of OID/type/value arguments, exactly as described in there. no agent, no set. periodt.
π SEE ALSO π
and that's the whole thing, babe π§ from Net-SNMP, version V5.9.5.2, dated 19 Jun 2003 β yeah she's an elder but she still ate π go set some OIDs, you got this ππ¦
π¦ where this page comes from
- alpine 3.23: net-snmp-doc 5.9.5.2-r0 Β· Net-SNMP
- alpine 3.24: net-snmp-doc 5.9.5.2-r0 Β· Net-SNMP
- arch rolling: net-snmp 5.9.5.2-2 Β· BSD
- fedora 44: net-snmp-utils 1:5.9.5.2-4.fc44 Β· MIT-CMU AND BSD-3-Clause AND MIT
- nixos 26.05: net-snmp 5.9.5.2
- nixpkgs unstable: net-snmp 5.9.5.2
- ubuntu stonking: snmp 5.9.5.2+dfsg-2.1ubuntu5
- Copyright 1988, 1989 by Carnegie Mellon University
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms