I got it. I just need to de-initialize the stock handler first like this:

oid tMib2SysDescrOid[] { 1,3,6,1,2,1,1,1 };
unregister_mib(tMib2SysDescrOid, OID_LENGTH(tMib2SysDescrOid));

Then I register my own :) Excellent!

r. Janne

On Tue, 25 Jan 2022 at 23:49, Janne Paalijarvi <jpaal...@gmail.com> wrote:
>
> Hello,
>
> I'm trying to server sysDescr / 1.3.6.1.2.1.1.1 from my .so agent but
> instead of my own string I get some kind of stock string:
>
> user@ESLD:~$ snmpget -Cf -Oa -v2c -c thecommunity 127.0.0.1 1.3.6.1.2.1.1.1.0
> iso.3.6.1.2.1.1.1.0 = STRING: "Linux ESLD 4.15.0-163-generic
> #171-Ubuntu SMP Fri Nov 5 11:55:11 UTC 2021 x86_64"
>
> If I change my server things a bit in the code and confs:
> 1.3.6.1.2.1.1 => 1.3.7.1.2.1.1
>
> I can get the changed stuff:
> user@ESLD:~$ snmpget -Cf -Oa -v2c -c thecommunity 127.0.0.1 1.3.7.1.2.1.1.1.0
> iso.3.7.1.2.1.1.1.0 = STRING: "The System Desc String I Want"
>
> So my code is correct, NET-SNMP just overrides it. Can I stop this
> override somehow in a smart way?
>
> r. Mr. Janne Paalijarvi


_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to