Snmpset Download

0 views
Skip to first unread message

Vannessa Rataj

unread,
Aug 3, 2024, 4:12:53 PM8/3/24
to horncatchwortcam

I'm in need for some good help here. I need to change transport input from ssh to telnet on a router, since I'm unable to run ssh to it. The router is only running SNMPv3 and I'm unable to use the procedure in this document: -to-save-configurations-using-snmp/

The only host that I'm allowed to run snmp from is our prime infrastructer server on which I access the shell and I have snmp commands available. I'm able to do snmpget, snmpgetnext, snmpwalk, but when I try to do a snmpset I get some errors and the router will not accept the commands.

The snmpset command is used to actually modify information on the remote host. For each variable you want to set, you need to specify the OID to update, the data type and the value you want to set it to. The valid datatypes can be found at the end of the snmpset help output:

    % snmpset -h & tail -4 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
So, lets check, set, and check again the value of a variable using snmpget and snmpset:
    % snmpget -v 2c -c demopublic test.net-snmp.org ucdDemoPublicString.0enterprises.ucdavis.ucdDemoMIB.ucdDemoMIBObjects.ucdDemoPublic.ucdDemoPublicString.0 = "hi there"% snmpset -v 2c -c demopublic test.net-snmp.org ucdDemoPublicString.0 s "hello world"enterprises.ucdavis.ucdDemoMIB.ucdDemoMIBObjects.ucdDemoPublic.ucdDemoPublicString.0 = "hello world"% snmpget -v 2c -c demopublic test.net-snmp.org ucdDemoPublicString.0enterprises.ucdavis.ucdDemoMIB.ucdDemoMIBObjects.ucdDemoPublic.ucdDemoPublicString.0= "hello world"
As you can see, we successfully changed the value of the ucdDemoPublicString.0 object. Note that if you don't have write permission to the object, the errors will differ greatly between SNMPv1 and SNMPv2c:
    % snmpset -v 1 -c badcommunity test.net-snmp.org ucdDemoPublicString.0 s "hello"Error in packet.Reason: (noSuchName) There is no such variable name in this MIB.This name doesn't exist: ucdDemoPublicString.0% snmpset -v 2c -c badcommunity test.net-snmp.org ucdDemoPublicString.0 s "hello"Error in packet.Reason: notWritable
SNMPv1 did not have nearly as descriptive error codes, which SNMPv2c fixed. It's a good reason to use SNMPv2c in preference to SNMPv1. Even better, is to use SNMPv3 which has a much better security system and also uses the better error reporting. We'll talk extensively about SNMPv3 later.

While the syntax of the snmpset command is similar to that of thesnmpget command, the commands are quite different. The snmpget command merely reads the valueof the specified object ID, while the snmpset command writes the value specifiedto the object ID. Further, along with the value to be written tothe object ID, you must also specify the data type of the objectID in the snmpset command because SNMP objects support more than one datatype.

Note that if you try to execute this snmpset command using a publiccommunity, instead of private, it will not work. This is because the privatecommunity has write permission, but the public community does not. The reason codereturned by the command does not make this clear because it simply statesthat the object is not writable.

The snmpset application sends configuration components to an agent using the SNMP SET protocol operation. The configuration is a list of OIDs and values that make up the configuration that should be set.

Check if your snmpset it's able to reach the snmp server and send snmp packets, to do this, you can use tail -f /var/log/snmpd.log to monitor the connections and start the flow to watch the behaviour.
Other attention point is to check if your nifi has permissions to set/get values from MIB's (make sure you did the step 7).
And lastly is to check if your snmp$oid is valid.

And here's the template used:
template-kb-snmp.xml

when i execute snmpset command to my destination host i get 'Timeout' error, my destination host is configured to listen on port '1234' and is opend in firewall. also in my SET command i'lle be specifying destinatin host and port to be used.

when analized the reason for timeout(no response from destination), it is seen request sent is always having the destinatin host and the port as i expected to send them (which is correct) also source host ip is correct but source port is getting changed dynamically. i suspect this could be the reason for the error where those random ports are not opened in firewall.

Your initial question stated that you were trying to get the configuration from a monitoring server, but your response to petrus indicates that you want to copy the configuration to the server, and that's what your original example shows, so I assume that's what you're after.

2 - It looks like the TYPE values available with your version of snmpget don't match those in the Cisco doc (it says they use the HPOV version of snmpset). Try running 'snmpset' without any parameters and see what you get; if you're using Net-SNMP there should be a section near the bottom that specifies the TYPEs available.

Nokia are removing support for their CORBA interface making SNMP interface the only supported solution. As SNMP comes up with risk to lose traps due to packet loss, between the EMS and the probe server, nokia netact comes up with the solution to request the Netact via snmpset to retransmit the lost traps .

Currently the snmpset tools (which comes with the rules set) supports setting only 1 object at one execution, but for the nokia alarm re-transmit to function, the MTTrap probe needs to be capable of sending TCP/IP SNMPSET commands with at least two options.

Hello Arunkumar, thank you for submitting your idea to IBM with respect to SNMP integration which has been reviewed by IBM. Unfortunately, this idea doesn't align with our current product roadmap and will not be implemented at this time. The idea has therefore been moved to the Not under consideration state.

Please note that clients may continue to view, comment, upvote and subscribe to this idea and we may review and reconsider this decision if new information surfaces or there is additional client interest in the idea. If so, you will be notified accordingly.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages