On Sat, Sep 28, 2019 at 10:14 AM Thommandra Gowtham <trgowtham...@gmail.com>
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
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to