Re: Agent+Sub-Agent

2021-09-17 Thread Magnus Fromreide
On Wed, Sep 08, 2021 at 02:17:14PM -0400, Bill Fenner wrote:
> On Fri, Sep 3, 2021 at 3:43 AM Feroz  wrote:
> 
> > My question is, is there a way to block an agent  from responding to
> > queries ( by timeout), till time the sub-agent connects to the agent.
> >
> 
> No, the master agent always lives under the impression that it knows
> everything.  You may be able to fake it out by giving it an unreachable
> proxy, something like "proxy udp:127.0.0.1:9 .1.3", and then having the
> agentx registration use a better priority so that it overrides the proxy
> config for each subtree that agentx registers.  However, this does use up
> snmp server resources trying to proxy each request to something that will
> not respond.
> 
> This is an interesting problem, especially if you have multiple
> sub-agents.  What if you had one sub-agent that serves IP-MIB, and a
> separate one that serves the system MIB?  Would you want to ignore requests
> until both subagents are connected?

Given that the system MIB contains sysORTable I have to say I find the
choise to put it in a subagent odd.

/MF


___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: Agent+Sub-Agent

2021-09-17 Thread Feroz
how about to have a flag, that will be set to TRUE
in handle_master_agentx_packet()  and check the flag in handle_snmp_packet()

*master_admin.c*
case AGENTX_MSG_PING:
asp->status = agentx_ping_response(session, pdu);
+subagent_connected = TRUE;
break;

*snmp_agent.c*
if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE) {
return 1;
}

+ if (!IS_AGENTX_VERSION(pdu->version) && subagent_connected == FALSE) {
+ return 1;
+  }

On Mon, Sep 13, 2021 at 11:37 AM Feroz  wrote:

> For my testing I added "proxy -v2c -c public udp:127.0.0.1:9 .1.3" in
> snmpd.conf file..
> Unfortunately I still get "No Such Instance currently exists at this OID",
> for some time, whenever I restart the sub-agent.
>
>
> On Wed, Sep 8, 2021 at 11:47 PM Bill Fenner  wrote:
>
>> On Fri, Sep 3, 2021 at 3:43 AM Feroz  wrote:
>>
>>> My question is, is there a way to block an agent  from responding to
>>> queries ( by timeout), till time the sub-agent connects to the agent.
>>>
>>
>> No, the master agent always lives under the impression that it knows
>> everything.  You may be able to fake it out by giving it an unreachable
>> proxy, something like "proxy udp:127.0.0.1:9 .1.3", and then having the
>> agentx registration use a better priority so that it overrides the proxy
>> config for each subtree that agentx registers.  However, this does use up
>> snmp server resources trying to proxy each request to something that will
>> not respond.
>>
>> This is an interesting problem, especially if you have multiple
>> sub-agents.  What if you had one sub-agent that serves IP-MIB, and a
>> separate one that serves the system MIB?  Would you want to ignore requests
>> until both subagents are connected?
>>
>>   Bill
>>
>>
>
> --
> Regards,
> Feroz Ahmed
>


-- 
Regards,
Feroz Ahmed
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: Agent+Sub-Agent

2021-09-13 Thread Feroz
For my testing I added "proxy -v2c -c public udp:127.0.0.1:9 .1.3" in
snmpd.conf file..
Unfortunately I still get "No Such Instance currently exists at this OID",
for some time, whenever I restart the sub-agent.


On Wed, Sep 8, 2021 at 11:47 PM Bill Fenner  wrote:

> On Fri, Sep 3, 2021 at 3:43 AM Feroz  wrote:
>
>> My question is, is there a way to block an agent  from responding to
>> queries ( by timeout), till time the sub-agent connects to the agent.
>>
>
> No, the master agent always lives under the impression that it knows
> everything.  You may be able to fake it out by giving it an unreachable
> proxy, something like "proxy udp:127.0.0.1:9 .1.3", and then having the
> agentx registration use a better priority so that it overrides the proxy
> config for each subtree that agentx registers.  However, this does use up
> snmp server resources trying to proxy each request to something that will
> not respond.
>
> This is an interesting problem, especially if you have multiple
> sub-agents.  What if you had one sub-agent that serves IP-MIB, and a
> separate one that serves the system MIB?  Would you want to ignore requests
> until both subagents are connected?
>
>   Bill
>
>

-- 
Regards,
Feroz Ahmed
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: Agent+Sub-Agent

2021-09-10 Thread Feroz
Hi Bill,
I have only one sub-agent running on the same box.
Let me test by adding the proxy configuration in snmpd.conf that you shared.
i.e:

"proxy udp:127.0.0.1:9 .1.3"

Thanks a lot for your response.

-Feroz

On Wed, 8 Sep, 2021, 11:47 pm Bill Fenner,  wrote:

> On Fri, Sep 3, 2021 at 3:43 AM Feroz  wrote:
>
>> My question is, is there a way to block an agent  from responding to
>> queries ( by timeout), till time the sub-agent connects to the agent.
>>
>
> No, the master agent always lives under the impression that it knows
> everything.  You may be able to fake it out by giving it an unreachable
> proxy, something like "proxy udp:127.0.0.1:9 .1.3", and then having the
> agentx registration use a better priority so that it overrides the proxy
> config for each subtree that agentx registers.  However, this does use up
> snmp server resources trying to proxy each request to something that will
> not respond.
>
> This is an interesting problem, especially if you have multiple
> sub-agents.  What if you had one sub-agent that serves IP-MIB, and a
> separate one that serves the system MIB?  Would you want to ignore requests
> until both subagents are connected?
>
>   Bill
>
>
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: Agent+Sub-Agent

2021-09-08 Thread Bill Fenner
On Fri, Sep 3, 2021 at 3:43 AM Feroz  wrote:

> My question is, is there a way to block an agent  from responding to
> queries ( by timeout), till time the sub-agent connects to the agent.
>

No, the master agent always lives under the impression that it knows
everything.  You may be able to fake it out by giving it an unreachable
proxy, something like "proxy udp:127.0.0.1:9 .1.3", and then having the
agentx registration use a better priority so that it overrides the proxy
config for each subtree that agentx registers.  However, this does use up
snmp server resources trying to proxy each request to something that will
not respond.

This is an interesting problem, especially if you have multiple
sub-agents.  What if you had one sub-agent that serves IP-MIB, and a
separate one that serves the system MIB?  Would you want to ignore requests
until both subagents are connected?

  Bill
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders