On Thu, Apr 26, 2018 at 10:00 PM, Bill Fenner <fen...@gmail.com> wrote:
> On Thu, Apr 26, 2018 at 10:02 AM, Bart Van Assche <bvanass...@acm.org>
> wrote:
>
>> On 04/26/18 04:57, Bill Fenner wrote:
>>
>>> A new feature went into 5.8 that conflicts a little with using an agentx
>>> subagent. I mentioned this here:
>>> https://sourceforge.net/p/net-snmp/mailman/message/36270409/
>>> You can replicate it by configuring a normal snmpd as an agentx master,
>>> and then running:
>>>
>>>
>>> $ sudo snmpd -C -f -Le -x /var/run/agentx/master -X
>>> *unknown snmp version 193*
>>> NET-SNMP version 5.8.pre2 AgentX subagent connected
>>> NET-SNMP version 5.8.pre2
>>>
>>> The "unknown snmp version" message may just be noise, but may cause
>>> traps from AgentX subagents to not be delivered depending on the net-snmp
>>> library configuration (in my configuration it's fine. I haven't actually
>>> tried a standard configuration).
>>>
>>> (The context is that the library now tries to suppress converting traps
>>> from v1 to v2 or vice versa if there is no trap sink of the right type,
>>> but, it does not know how to treat agentx sessions so doesn't count them -
>>> so if there's only an agentx session open it may not send *any* traps since
>>> it "knows" there are no v1 or v2 trap sessions open)
>>>
>>
>> Hello Bill,
>>
>> Which commit are you referring to? Three regression tests that passed in
>> the past and that send a trap over an AgentX session fail on some test
>> setups.
>>
>
> The commit in question is f770e0f7493204f184c468a7c4dba31f0cd6fc5d . I
> think it'll cause traps sent from a subagent to fail if you have
> snmpNotifyTable included, meaning that traps get sent via callback, and
> will work otherwise.
>
It's plausible that a workaround as simple as
*--- a/agent/mibgroup/agentx/subagent.c*
*+++ b/agent/mibgroup/agentx/subagent.c*
@@ -901,8 +901,11 @@ subagent_open_master_session(void)
*/
main_session->securityModel = SNMP_DEFAULT_SECMODEL;
+ /*
+ * We lie about being SNMPv3, because ...
+ */
if (add_trap_session(main_session, AGENTX_MSG_NOTIFY, 1,
- AGENTX_VERSION_1)) {
+ SNMP_VERSION_3)) {
DEBUGMSGTL(("agentx/subagent", " trap session registered OK\n"));
} else {
DEBUGMSGTL(("agentx/subagent",
would work. (I picked V3 because you can't disable it, unlike v2c.) I
also didn't feel like writing the rest of the comment :-)
Bill
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders