I was taking a look on the source code, and, besides the functions
provided by the UCM snmp library, I don't see any other code to send
traps. 
In fact, I'm still trying to understand how this library and the
snmp_core.cc and snmp_agent.cc modules work together.

To send a trap is something, in theory, trivial. Open a dgram socket,
and send the info to the trapsink. 
The point is not that, the point is all the details surronding that:

MIB:
 Needs to be defined in the MIB the traps sent.

TRAPS:
 Needs to be defined wich traps be sent. (When special errors happen?
when MIB updated? )

CONFIGURATION:
If SQUID uses its own snmp agent, then is needed to add a confguation
line to set the trapsink destianation for the traps sent.


And of course, all the time I was talking about SNMPv1 only ;-) 


-----Original Message-----
From: Henrik Nordstrom [mailto:[EMAIL PROTECTED] 
Sent: domingo, 10 de julio de 2005 6:35
To: Henrik Nordstrom
Cc: Lombao, Cesar; squid-dev@squid-cache.org
Subject: Re: About SQUID and SNMP TRAPS , and snmp in general

On Sat, 9 Jul 2005, Henrik Nordstrom wrote:

> There is two approaches, either resurrect the now deleted trap snmp 
> code in the old simplminded snmp library used (and distributed) by 
> Squid, or do it more proper and replace the SNMP agent glue in Squid 
> with a new one using the more up to date net-snmp library API 
> <url:http://net-snmp.sourceforge.net/>,
> making Squid a SMUX or AgentX sub-agent to an existing system SNMP 
> agent supporting either method.

A quick inspection of the net-snmp agent API indicates it is not
immediately suitable to be called from inside Squid. This due to a
design heavily centered around select() semantics and fd_set processing.

It may be possible to build glue around, but I have doubts in how the
library uses the fd_set:s. Any library having static/local fd_set
instances is not useable from Squid (filedescriptor limitation problem).

So for now I think it would be better to simply resurrect/reimplement
the TRAP PDU sending code. Since we are only looking at sending traps
there is not much danger or maintenance headache.

Regards
Henrik

Reply via email to