logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Masterson" <m.master...@computer.org>
Subject RE: Docs for SNMPTrapAppender?
Date Thu, 08 Jul 2004 17:31:20 GMT
Hello Brent,

No, there are no additional docs - you've already found everything.

However - and I hate to say this, 'cause I hate it myself when I'm tearing
my hair out over some such issue, and I get this sort of an answer - I don't
think either the appender, or its documentation, is your problem.

Before I get any further into that, however, let me at least confirm two
bugs/problems with the current documentation/examples - first, the JoeSNMP
library (at least, the version I have) doesn't support v2 traps.  It
pretends to - the API for them exists - and I have written the trap sender
as if this was the case, but in fact, if you configure the appender to use
Joe and tell it the trap version is "2", Joe will throw an exception,
without much of an explanation.  That's a problem with Joe, not the
appender, but I guess I should document it in the appender examples, to help
people avoid your sort of agony.

Of the sample implementations I provide with the appender, only the Wengsoft
trap sender handles SNMPv2c properly.

Second, none of the sample properties files excerpts includes an example of
setting the trap version parameter.  I'll try to get around to fixing that,
but in the meantime, scroll to the end of my reply.

Now, having said all that, I'm still going to be a jerk, and assert that
your real problem is your "Netview person".  Here's why:  SNMPv2u is a much
newer version of the protocol, and it's not a version that has even been
officially accepted as a standard, AFAIK.  There is a competing variant of
the protocol called SNMPv*, and trying to figure out the differences is only
interesting if you find it entertaining to read volumes and volumes of
archived Usenet flame wars.  Basically, the biggest difference between v2c
and v2u/v2* is that the newer variants attempt to plug the security holes in
v2c.

The Wengsoft library is fairly old - when it was written, neither SNMPv2u
nor SNMPv2* existed.  For that reason, it should be pretty obvious that
there's only one sort of v2 trap it can send - v2c.  And that's precisely
what it does - if you tell it to.

I've used the Wengsoft library with Netview and it works fine.  Netview can
be a little tricky to configure, depending on the version - I seem to recall
something about Netview converting v2 traps, internally, to v1 traps, but
I'm not sure about that.

Which brings me to my final point - why are you trying to do this?  Given
the apparent level of expertise of your "Netview person" and the amount of
grief the issue seems to be causing you, why not just send an SNMPv1 trap?
Pretty much anything you can imagine can handle that, even if the version is
so old that it's running on steam-power or whatever.

But, be that as it may, here is the full text of a configuration file that I
have personally used to successfully send SNMPv2c traps to Netview:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>

    <appender name="ERROR_LOG"
class="org.apache.log4j.ext.SNMPTrapAppender">
        <param name="ImplementationClassName"
value="org.apache.log4j.ext.WengsoftSNMPTrapSender"/>
        <param name="ManagementHost" value="127.0.0.1"/>
        <param name="ManagementHostTrapListenPort" value="162"/>
        <param name="EnterpriseOID" value="1.3.6.1.4.1.16095.0"/>
        <param name="LocalIPAddress" value="127.0.0.1"/>
        <param name="localTrapSendPort" value="161"/>
        <param name="GenericTrapType" value="6"/>
        <param name="SpecificTrapType" value="12345678"/>
        <param name="CommunityString" value="public"/>
        <param name="Threshold" value="DEBUG"/>
        <param name="ForwardStackTraceWithTrap" value="true"/>
        <param name="TrapVersion" value="2"/>
        <layout
class="org.apache.log4j.ext.SnmpDelimitedConversionPatternLayout">
            <param name="ValuePairDelim" value="/"/>
            <param name="VarDelim" value=";"/>
            <param name="ConversionPattern"
value="%p;1.3.6.1.4.1.16095.100.1/%m;1.3.6.1.4.1.16095.100.2/%C{1};1.3.6.1.4
.1.16095.100.3"/>
        </layout>
    </appender>

    <appender name="DEBUG_LOG" class="org.apache.log4j.FileAppender">
        <param name="File" value="/etc/snmp_debug.log"/>
        <param name="Threshold" value="DEBUG"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d,%p,[%t],[%c],%m%n"/>
        </layout>
    </appender>

    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
        <param name="Target" value="System.out"/>
        <param name="Threshold" value="DEBUG"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d,%p,[%t],[%c],%m%n"/>
        </layout>
    </appender>

    <category name="org" additivity="true">
        <priority value="debug"/>
        <appender-ref ref="DEBUG_LOG"/>
    </category>

    <root>
        <priority value="debug"/>
        <appender-ref ref="STDOUT"/>
        <appender-ref ref="ERROR_LOG"/>
    </root>

</log4j:configuration>

If you only use the properties-file format, and aren't sure how to translate
the XML variant into what you need, let me know and I'll send another
example.

Cheers,
Mark
-----Original Message-----
From:
log4j-user-return-13129-mark_masterson=compuserve.com@logging.apache.org
[mailto:log4j-user-return-13129-mark_masterson=compuserve.com@logging.apache
.org]On Behalf Of Schuhmacher, Bret
Sent: Thursday, July 08, 2004 7:32 AM
To: log4j-user@jakarta.apache.org
Subject: Docs for SNMPTrapAppender?


I'm having a difficult time sending v2c traps via SNMPTrapAppender from
http://www.m2technologies.net/.  Let me restate that - my IBM NetView
person tells me that the v2 traps I'm sending are getting kicked out of
NetView because they're not v2c (I have to assume they're v2u, but I'm a
total SNMP neophyte :-( ).

I've tried both JoeSNMP and WengSoft and I cannot get a v2c trap
built/sent.  Is it possible to send v2c using this trap appender and
either JoeSNMP or WengSoft?  Can anyone point me to more documentation
than I found with the SNMPTrapAppender?  I'm pretty sure it's a
configuration issue on my end...  A working properties file configured
for v2c would be excellent!

Thanks! :-)

Bret
--
Bret A. Schuhmacher                             voice:  423.837.7563
Sr. Architect, Aspect Professional Services     eMail:
Bret.Schuhmacher@Aspect.com
Aspect Communications


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message