Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[RFE] Support more SNMP value types for SET command #12

Open
Runekeon opened this issue Oct 8, 2019 · 3 comments
Open

[RFE] Support more SNMP value types for SET command #12

Runekeon opened this issue Oct 8, 2019 · 3 comments

Comments

@Runekeon
Copy link

Runekeon commented Oct 8, 2019

The net-snmp site shows

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

but the help for snmpset.py is missing x: HEX STRING, d: DECIMAL STRING, F: float, and D: double

Management parameters:
   <[mib-module::]object-name|oid type| = value> ...
              mib-module:           MIB name (e.g. SNMPv2-MIB)
              object-name:          MIB symbol (e.g. sysDescr.0) or OID
              type:                 MIB value type
                    i               integer
                    u               unsigned integer
                    s               string
                    n               NULL
                    o               ObjectIdentifier
                    t               TimeTicks
                    a               IP address
              =:                    use MIB for value type lookup
              value:                value to write

For my team we use sets of x type daily like this

$ snmpget -v2c -r1 -c <community string> udp6:2001:558:4033:59:4a1d:70ff:fe65:691d .1.3.6.1.2.1.69.1.3.7.0
SNMPv2-SMI::mib-2.69.1.3.7.0 = Hex-STRING: BA DB AD BA DB AD BA DB AD BA DB AD BA DB AD 00 
$ snmpset -v2c -r1 -c <community string> udp6:2001:558:4033:59:4a1d:70ff:fe65:691d .1.3.6.1.2.1.69.1.3.7.0 x "FE 80 CD 00 00 00 0C DE 12 57 00 00 21 1E 72 9C"
SNMPv2-SMI::mib-2.69.1.3.7.0 = Hex-STRING: FE 80 CD 00 00 00 0C DE 12 57 00 00 21 1E 72 9C 
$ snmpget -v2c -r1 -c <community string> udp6:2001:558:4033:59:4a1d:70ff:fe65:691d .1.3.6.1.2.1.69.1.3.7.0
SNMPv2-SMI::mib-2.69.1.3.7.0 = Hex-STRING: FE 80 CD 00 00 00 0C DE 12 57 00 00 21 1E 72 9C 
$ 

We use the others rarely but there can be cases for them.
Is there a reason the snmpclitools doesn't support the other types?

@etingof
Copy link
Owner

etingof commented Oct 8, 2019

I think these types have been overlooked at the implementation time. Your PR would be appreciated! ;-)

@etingof etingof changed the title snmpset.py doesn't support all the net-snmp data types. [RFE] Support more SNMP value types for SET command Oct 8, 2019
@Runekeon
Copy link
Author

Runekeon commented Oct 8, 2019

@etingof I will work on that, any suggestion would be appreciated.

@etingof
Copy link
Owner

etingof commented Oct 8, 2019

Would be great! If you share your ideas/problems in form of a PR, I will try to help out with the details if needed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants