Re: [netsnmp-coders] missing information in logmatch trap

Thommandra Gowtham <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <CA+XNQ=hGKJaL1t-ihV2JcXNGtR3M7Mc4biyREta1Z+nFbeCe5A@mail.gmail.com>
Thanks a lot Bill.

I will use the inbuf variable to send a trap(will use a dummy custom MIB
table) using sendv2_trap().

Thanks for the help.

Regards,
Gowtham

On Sun, Sep 29, 2019, 20:57 Bill Fenner <[email protected]> wrote:

> On Sat, Sep 28, 2019 at 10:14 AM Thommandra Gowtham <
> [email protected]> wrote:
>
>> Thank you Bill for your response.
>>
>> When you said that I have configured two separate features, can you
>> explain? How else can we get a logmatch trap by just one directive?
>>
>
> You currently can not. That is how I imagine the feature you're looking
> for would be implemented.  What you have now is: logmatch increments a
> counter when the log is seen, and disman sends you a trap when the counter
> changes.  It's the fact that the interface between those pieces is a
> counter that means that you can not get the actual message.
>
> For b), which part of the code has the actual string that is matched? I
>> can probably use it to raise a trap if needed.
>>
>
>
> https://github.com/net-snmp/net-snmp/blob/master/agent/mibgroup/ucd-snmp/logmatch.c#L291
> If you want to know just what part of the line matched the regexp, then
> you will have to pass in nmatch and pmatch arguments to regexec(),
> otherwise if you just want the whole line it's in "inbuf" at that point.
>
>   Bill
>
>

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.