Discussion:
snmpset type error
Marc Martinez
2003-11-07 09:14:31 UTC
Permalink
scalar_int.c
http://net-snmp.sourceforge.net/tutorial-5/agent/scalar__int_8c-example.html
<http://net-snmp.sourceforge.net/tutorial-5/agent/scalar__int_8c-example.htm
l>

When i try to use this sample on my snmp-agent i have somws errors....what
i doing wrong ???!!???
(SunOs 5.8 with net-snmp 5.1.pre3 (same probleme with version 5.0.9))


Starting agent...with
snmpd -f -L -Ddlmod,steAlrInt,example_steAlrInt,example_steAlrInt

dlmod: register mib
dlmod: dlmod_path: /products/net-snmp/lib/snmp/dlmod
dlmod: dlmod_create_module
dlmod: dlmod_create_module
dlmod: dlmod_load_module steAlrInt: /products/net-snmp/lib/steAlrInt.so
example_steAlrInt: Initalizing example scalar int. Default value = 42
example_steAlrInt: Done initalizing example scalar int
NET-SNMP version 5.1.pre3



When i get the value...
snmpget loclahost MY-MIB::steAlrInt.0
MY-MIB::steAlrInt.0 = INTEGER: 42

When i try to set the value
snmpset -c private MY-MIB::steAlrInt.0 i 12
Error in packet.
Reason: (badValue) The value given has the wrong type or length.
Failed object: MIY-MIB::steAlrInt.0

Or
snmpset -c private MY-MIB::steAlrInt.0=12
MY-MIB::steAlrInt.0=12: Needs type and value


snmptranslate -Tp MY-MIB::steAlrInt
+-- -RW- Integer32 steAlrInt(3)
Robert Story
2003-11-07 22:31:07 UTC
Permalink
On Fri, 7 Nov 2003 12:13:50 +0100 Marc wrote:
MM> When i get the value...
MM> snmpget loclahost MY-MIB::steAlrInt.0
MM> MY-MIB::steAlrInt.0 = INTEGER: 42
MM>
MM> When i try to set the value
MM> snmpset -c private MY-MIB::steAlrInt.0 i 12
MM> Error in packet.
MM> Reason: (badValue) The value given has the wrong type or length.
MM> Failed object: MIY-MIB::steAlrInt.0

This is setting off all sorts of little bells in my head, but for the life of
me, I can't remember what the problem was. BUt I swear I've seend a patch
or fix for it lately. I've been throught the bugs, patches, coders and uses
archives, but cant find it.

Have you tried the latest cvs?

MM> snmpset -c private MY-MIB::steAlrInt.0=12
MM> MY-MIB::steAlrInt.0=12: Needs type and value

I'm pretty sure this syntax is bogus, and I'm not sure why it's in the
tutorial.
--
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>

You are lost in a twisty maze of little standards, all different.
Marc Martinez
2003-11-10 06:45:07 UTC
Permalink
I have tried on net-snmp 5.1.pre3
Compiled with
./configure --prefix=/products/net-snmp --without-root-access
--with-sys-contact="***@sterci.com" --enable-shared


-----Message d'origine-----
De : Robert Story [mailto:***@freesnmp.com]
Envoyé : samedi, 8. novembre 2003 01:30
À : Marc Martinez
Cc : net-snmp-users
Objet : Re: snmpset type error

On Fri, 7 Nov 2003 12:13:50 +0100 Marc wrote:
MM> When i get the value...
MM> snmpget loclahost MY-MIB::steAlrInt.0
MM> MY-MIB::steAlrInt.0 = INTEGER: 42
MM>
MM> When i try to set the value
MM> snmpset -c private MY-MIB::steAlrInt.0 i 12
MM> Error in packet.
MM> Reason: (badValue) The value given has the wrong type or length.
MM> Failed object: MIY-MIB::steAlrInt.0

This is setting off all sorts of little bells in my head, but for the life
of
me, I can't remember what the problem was. BUt I swear I've seend a patch
or fix for it lately. I've been throught the bugs, patches, coders and uses
archives, but cant find it.

Have you tried the latest cvs?

MM> snmpset -c private MY-MIB::steAlrInt.0=12
MM> MY-MIB::steAlrInt.0=12: Needs type and value

I'm pretty sure this syntax is bogus, and I'm not sure why it's in the
tutorial.
--
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>

You are lost in a twisty maze of little standards, all different.
Loading...