[SNMP4J] TRAP PDU handled by ProccesPDU and not by notify method in CommandProcessor class !!!!!!!!

wafae alami alami.ouafae at gmail.com
Tue May 19 17:18:33 CEST 2009


Hi frank ;

I'm using a Snmp4J agent to listen for some JMX notifications raised by an
MbeanServer the main goal of my application is to map those notifications to
SNMP Traps and send them to a remote manager , when receiving  the JMX
notification ,  the handleNotification method of the JMXNotificationSupport
class is well invoqued but :

  public void handleNotification(Notification notification, Object handback)
{
    System.out.println("---------- I 'm in notification Handler");
    MBeanNotificationInfo info = notificationInfos.get(handback);
    if (info != null) {
       System.out.println("----------- INFO IS NOT NULL");
       System.out.println("----------- notification.getUserData():
"+notification.getUserData());
       System.out.println("----------- info.getNotificationPayload:
"+info.getNotificationPayload(  notification.getUserData()));
       VariableBinding[] vbs =
info.getNotificationPayload(notification.getUserData());
        for(int i=0;i<vbs.length;i++){
          System.out.println("---------- vbs :"+vbs[i].getOid().toString());
        }
       notificationOriginator.notify(info.getContext(), (OID)handback, vbs);
       System.out.println("----------- AFTER notificationOriginator
notify");
    }
  }


The Result is :
----------- I 'm in notification Handler
----------- INFO IS NOT NULL
----------- notification.getUserData(): null
----------- info.getNotificationPayload:
[Lorg.snmp4j.smi.VariableBinding;@1fae1cd
---------- vbs :1.3.6.1.4.1.637.71.6.6.1.0
---------- vbs :1.3.6.1.4.1.637.71.6.6.2.0
---------- vbs :1.3.6.1.4.1.637.71.6.6.3.0
---------- vbs :1.3.6.1.4.1.637.71.6.6.4.0
---------- vbs :1.3.6.1.4.1.637.71.6.6.7.0
---------- vbs :1.3.6.1.4.1.637.71.6.6.5.0
---------- vbs :1.3.6.1.4.1.637.71.6.6.6.0
---------- vbs :1.3.6.1.4.1.637.71.6.6.8.0

The CommandProcessor is called also , and the ProcessPDU method is invoqued
instead of the notify one , !!
obviously there is no handler for the TRAP PDU and the following message  is
displayed :

INFO: No PDU handler found for request
CommandResponderEvent[transportMapping=org.snmp4j.transport.DefaultUdpTransportMapping at 1c2cbeepeerAddress
=155.132.215.56/60413, processed=true, pdu=[TRAP[requestID=189,
errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.3.0 = 2:55:01.34;
1.3.6.1.6.3.1.1.4.1.0 = 1.3.6.1.4.1.637.71.6.1.2; 1.3.6.1.4.1.637.71.6.6.1.0
= 464 days, 17:39:07.12; 1.3.6.1.4.1.637.71.6.6.2.0 = 16;
1.3.6.1.4.1.637.71.6.6.3.0 = 0; 1.3.6.1.4.1.637.71.6.6.4.0 = Restarting
failed autoStart instance; 1.3.6.1.4.1.637.71.6.6.5.0 = mcad7p38;
1.3.6.1.4.1.637.71.6.6.6.0 = MySqlCluster__mysql_mcad7p38;
1.3.6.1.4.1.637.71.6.6.7.0 = MySql; 1.3.6.1.4.1.637.71.6.6.8.0 = 6;
1.3.6.1.4.1.2162.10.3.1.3.3 = 2009/05/19 14:39:50: Code 16 (Notif) Comp =
'MySql', Inst = 'MySqlCluster__mysql_mcad7p38', on host mcad7p38: Restarting
failed autoStart instance]]], securityName=public, securityModel=2,
securityLevel=1]



Best Regards
Ouafae ,



More information about the SNMP4J mailing list