[SNMP4J] trap informations

abdel boutz1 at caramail.com
Wed Apr 6 14:43:49 CEST 2005


Hello all, I have to test but I don't manage to understand how I could make 
this is my code:
 CommandResponder trapPrinter = new CommandResponder() { 
          public synchronized void processPdu(CommandResponderEvent e) 
          {
               PDU command= e.getPDU();
               OID oid;      int compt;String val=null;
            
            if (command != null) 
            {
               System.out.println(command.toString());
            }
                            
            if (command instanceof PDUv1) 
            {
                PDUv1 pduv1 = (PDUv1)command;
                
                System.out.println("Enterprise" + pduv1.getEnterprise());
                System.out.println("agent-Address" + pduv1.getAgentAddress());
                System.out.println("time-stamp " + pduv1.getTimestamp());
                                            
                System.out.println("specificTrap : " + pduv1.getSpecificTrap());
                    switch(pduv1.getGenericTrap())
                    {                        
                        case 0: System.out.println("ColdStart : "); 
                                break;
                        case 1: System.out.println("WarnStart : "); 
                                break;
                        case 2: System.out.println("LinkDown : "); 
                                break;
                        case 3: System.out.println("LinkUp : "); 
                                break;
                        case 4: System.out.println("AuthentcationFailure : "); 
                                break;
                        case 6: System.out.println("EnterpriseSpecific : "); 
                                break;
                        default: System.out.println("Unknown Error : ");
                    }                
             }
              
         }
        };

I receives the trap but I would like to have it why (information) it sends a trap to me .
is this possible to have this information? I m sorry for my poor English.



More information about the SNMP4J mailing list