Package com.sun.management.snmp.manager

Examples of com.sun.management.snmp.manager.SnmpPeer


          session = new SnmpSession("Set V" + version + " session");

          // Create an SnmpPeer object for representing the entity
          // to communicate with.
          //
          final SnmpPeer agent = new SnmpPeer(remoteHost, port);

          // Specify the read and write community to be used
          //
          final SnmpParameters params = new SnmpParameters(
                  community,
                  community);

          // Specify the protocol version
          //
          switch (version) {
            case 1:
              params.setProtocolVersion(SnmpDefinitions.snmpVersionOne);
              break;
            case 2:
              params.setProtocolVersion(SnmpDefinitions.snmpVersionTwo);
              break;
            default:
              break;
          }

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

          // Set the default peer (agent) to a SnmpSession
          //
          session.setDefaultPeer(agent);
          break;
View Full Code Here


          session.snmpOptions.setPduFixedOnError(false);

          // Create an SnmpPeer object for representing the entity
          // to communicate with.
          //
          final SnmpPeer agent = new SnmpPeer(remoteHost, port);

          // Specify the read and write community to be used
          //
          final SnmpParameters params = new SnmpParameters(
                  community,
                  community);

          // Specify the protocol version
          //
          switch (version) {
            case 1:
              params.setProtocolVersion(SnmpDefinitions.snmpVersionOne);
              break;
            case 2:
              params.setProtocolVersion(SnmpDefinitions.snmpVersionTwo);
              break;
          }

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

          // Set the default peer (agent) to a SnmpSession
          //
          session.setDefaultPeer(agent);
          break;
View Full Code Here

    @Test(enabled=false,dataProvider = "listAttributes")
    public void checkAttribute(String attributeName) {

        // get the SNMP peer agent
        SnmpPeer agent = this.getSnmpV2Peer(this.getSnmpPort());
        assertNotNull(agent);

        // Create parameters to associate to the entity to communicate
        // with.
        // When creating the parameter object, you can specify the read
        // and write community to be used when querying the agent.

        final SnmpParameters params =
                new SnmpParameters();

        // Set to the allowed the community string
        params.setRdCommunity("NasuTekDS@NasuTekDS");

        // The newly created parameter must be associated to the agent.
        //
        agent.setParams(params);

        // Build the session. A session creates, controls and
        // manages one or more requests.
        //
        try {
View Full Code Here

            //

            // Create a SnmpPeer object for representing the entity to
            // communicate with.
            //
            final SnmpPeer agent =
                    new SnmpPeer(host, this.getSnmpPort());

            // Create parameters to associate to the entity to communicate
            // with.
            // When creating the parameter object, you can specify the read
            // and write community to be used when querying the agent.
            //
            final SnmpParameters params =
                    new SnmpParameters();
            params.setRdCommunity(community);

            // The newly created parameter must be associated to the agent.
            //
            agent.setParams(params);

            // Build the session. A session creates, controls and
            // manages one or more requests.
            //
            final SnmpSession session =
View Full Code Here

    try
    {
      String host = InetAddress.getLocalHost().getCanonicalHostName();
      SnmpOidTableSupport oidTable = new DIRECTORY_SERVER_MIBOidTable();
      SnmpOid.setSnmpOidTable(oidTable);
      return new SnmpPeer(host, port);
    }
    catch (Exception ex)
    {
      return null;
    }
View Full Code Here

TOP

Related Classes of com.sun.management.snmp.manager.SnmpPeer

Copyright © 2018 www.massapicom. 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.