Examples of SnmpUsmPeer


Examples of com.sun.management.snmp.manager.usm.SnmpUsmPeer

          final SnmpEngine engine = session.getEngine();

          // Create an SnmpUsmPeer object for representing the entity
          // to communicate with
          //
          final SnmpUsmPeer agentV3 = new SnmpUsmPeer(engine, remoteHost, port);

          // Create USM parameters for the principal defaultuser (user used when
          // requests are sent: the defaultUser is a template and for this
          // reason we cannot find it under the user mib (not created as a user)
          //
          final SnmpUsmParameters paramsV3 = new SnmpUsmParameters(
                  engine,
                  user);

          // Set the security level authentication but without privacy
          //
          paramsV3.setSecurityLevel(securityLevel);

          // Set the context name
          //
          if (community.compareTo("null") != 0) {
            paramsV3.setContextName(community.getBytes());
          }

          // Set the contextEngineId discovered by the peer upon
          // its creation
          //
          paramsV3.setContextEngineId(agentV3.getEngineId().getBytes());

          // Associate the parameters with the agent
          //
          agentV3.setTimeout(timeOut);
          agentV3.setMaxTries(maxRetries);
          agentV3.setParams(paramsV3);

          if (securityLevel != SnmpDefinitions.noAuthNoPriv) {
            // Discover timeliness of creation and boot
            //
            try {
              agentV3.processUsmTimelinessDiscovery();
            } catch (SnmpStatusException e) {
              if (connectStatus.compareTo("SnmpStatusException") == 0) {
                System.out.println(
                        "connect() of SNMPGet catched as expected a " +
                        "SNMP status exception: " + e.getMessage() + "\"");
View Full Code Here

Examples of com.sun.management.snmp.manager.usm.SnmpUsmPeer

          final SnmpEngine engine = session.getEngine();

          // Create an SnmpUsmPeer object for representing the entity
          // to communicate with
          //
          final SnmpUsmPeer agentV3 = new SnmpUsmPeer(engine, remoteHost, port);

          // Create USM parameters for the principal defaultuser (user used when
          // requests are sent: the defaultuser is a template and for this
          // reason we cannot find it under the user mib (not created as a user)
          //
          final SnmpUsmParameters paramsV3 = new SnmpUsmParameters(
                  engine,
                  user);

          // Set the security level authentication but without privacy
          //
          paramsV3.setSecurityLevel(securityLevel);

          // Set the context name
          //
          if (community.compareTo("null") != 0) {
            paramsV3.setContextName(community.getBytes());
          }

          // Set the contextEngineId discovered by the peer upon
          // its creation
          //
          paramsV3.setContextEngineId(agentV3.getEngineId().getBytes());

          // Associate the parameters with the agent
          //
          agentV3.setTimeout(timeOut);
          agentV3.setMaxTries(maxRetries);
          agentV3.setParams(paramsV3);

          // Discover timeliness of creation and boot
          //
         try {
            agentV3.processUsmTimelinessDiscovery();
         } catch (SnmpStatusException e) {
           if (connectStatus.compareTo("SnmpStatusException") == 0) {
             System.out.println(
                     "connect() of SNMPSet catched as expected a " +
                     "SNMP status exception: " + e.getMessage() + "\"");
View Full Code Here

Examples of com.sun.management.snmp.manager.usm.SnmpUsmPeer

      SnmpOidTableSupport oidTable = new DIRECTORY_SERVER_MIBOidTable();
      SnmpOid.setSnmpOidTable(oidTable);

      SnmpSession session = new SnmpSession("SyncManagerV3 session");
      SnmpEngine engine = session.getEngine();
      return new SnmpUsmPeer(engine, host, port);
    }
    catch (Exception ex)
    {
      return null;
    }
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.