Examples of SnmpVarBind


Examples of com.sun.jmx.snmp.SnmpVarBind

        return result;
    }
 
    private void concatVector(SnmpMibRequest req, Vector source) {
        for(Enumeration e= source.elements(); e.hasMoreElements(); ) {
            SnmpVarBind var= (SnmpVarBind) e.nextElement();   
            // We need to duplicate the SnmpVarBind otherwise it is going
      // to be overloaded by the next get Next ...
            req.addVarBind(new SnmpVarBind(var.oid, var.value));
        }
    }
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

        }
    }

    private void concatVector(Vector target, Vector source) {
        for(Enumeration e= source.elements(); e.hasMoreElements(); ) {
            SnmpVarBind var= (SnmpVarBind) e.nextElement();   
            // We need to duplicate the SnmpVarBind otherwise it is going
      // to be overloaded by the next get Next ...
            target.addElement(new SnmpVarBind(var.oid, var.value));
        }
    }
View Full Code Here

Examples of com.sun.management.snmp.SnmpVarBind

      //
      final SnmpVarBindList list = new SnmpVarBindList("Get varbind list");

      // Write one specific OID
      //
      SnmpVarBind oid = new SnmpVarBind(oids);
      oid.setSnmpValue(new SnmpString("myValue"));
      list.addVarBind(oid);

      // Make the SNMP set request
      //
      System.out.println(
View Full Code Here

Examples of org.opennms.protocols.snmp.SnmpVarBind

      public SnmpVarBind make(String oid, Object value)
         throws MappingFailedException
      {
         Integer i = (Integer)value;
           
         return new SnmpVarBind(new SnmpObjectId(oid),
                                new SnmpInt32(i));
      }
View Full Code Here

Examples of org.opennms.protocols.snmp.SnmpVarBind

      public SnmpVarBind make(String oid, Object value)
         throws MappingFailedException
      {
         Long l = (Long)value;
           
         return new SnmpVarBind(new SnmpObjectId(oid),
                                new SnmpCounter64(l.longValue()));
      }
View Full Code Here

Examples of org.opennms.protocols.snmp.SnmpVarBind

      public SnmpVarBind make(String oid, Object value)
         throws MappingFailedException
      {
         String s = (String)value;
           
         return new SnmpVarBind(new SnmpObjectId(oid),
                                new SnmpOctetString(s.getBytes()));
      }
View Full Code Here

Examples of org.opennms.protocols.snmp.SnmpVarBind

         sbuf.append("\n");
      }
 
      for (int i = 0; i < pdu.getLength(); i++ )
      {
         SnmpVarBind vb = pdu.getVarBindAt(i);
        
         sbuf.append("Varbind[").append(i).append("] := ");
         sbuf.append(vb.getName().toString()).append(" --> ");
         sbuf.append(vb.getValue().toString()).append("\n");   
      }
      log.debug(sbuf.toString());
   } // snmpReceivedTrap
View Full Code Here

Examples of org.opennms.protocols.snmp.SnmpVarBind

      sbuf.append("\nCommunity string... ").append(community.toString());
      sbuf.append("\n");
 
      for (int i = 0; i < pdu.getLength(); i++ )
      {
         SnmpVarBind vb = pdu.getVarBindAt(i);
        
         sbuf.append("Varbind[").append(i).append("] := ");
         sbuf.append(vb.getName().toString()).append(" --> ");
         sbuf.append(vb.getValue().toString()).append("\n");     
      }
      log.debug(sbuf.toString());
   } // snmpReceivedTrap
View Full Code Here

Examples of org.opennms.protocols.snmp.SnmpVarBind

      int errorIndex = 0;

      //Process for each varibind in the request
      for (int i = 0; i < pduLength ; i++ )
      {
         SnmpVarBind vb = pdu.getVarBindAt(i);
         SnmpObjectId oid = vb.getName();
         if (getNext)
         {
            log.debug(
               "Should call getNextOid() to find out what is the next valid OID " +
               "instance in the supported MIB tree. Assign that OID to the VB List " +
               "and then proceed same as that of get request" );
         }
         vblist[i] = new SnmpVarBind(oid);
        
         log.debug("oid=" + oid.toString());
   
         log.debug("Should call the respective interface to retrieve current value for this OID" );
View Full Code Here

Examples of org.opennms.protocols.snmp.SnmpVarBind

      int k = pdu.getLength();
      SnmpVarBind[] vblist  = new SnmpVarBind[k];
    
      for (int i = 0; i < k ; i++ )
      {
         SnmpVarBind vb = pdu.getVarBindAt(i);
         vblist[i] = new SnmpVarBind(vb);
         SnmpObjectId oid = vb.getName();
        
         SnmpSyntax result = null;
         log.debug("Should call the respective interface to assign a value for this OID" );
         
         if (result != null)
         {
            errorStatus = SnmpPduPacket.ErrReadOnly;
            errorIndex = i + 1;
            log.debug("Error occured " + vb.getName().toString());
         }
        
         log.debug("Varbind[" + i + "] := " + vb.getName().toString());
         log.debug(" --> " + vb.getValue().toString());    
      }
    
      response = new SnmpPduRequest(SnmpPduPacket.RESPONSE, vblist);
      response.setErrorStatus(errorStatus);
      response.setErrorIndex(errorIndex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.