Package org.hyperic.sigar

Examples of org.hyperic.sigar.NetStat


        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();
        NetStat netstat;
       
        try {
            netstat = sigar.getNetStat();
        } catch (SigarNotImplementedException e) {
            return;
        } catch (SigarPermissionDeniedException e) {
            return;
        }

        traceln("");
        assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal());
        assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal());
        int[] states = netstat.getTcpStates();
        for (int i=0; i<NetFlags.TCP_UNKNOWN; i++) {
            assertGtEqZeroTrace(NetConnection.getStateString(i), states[i]);
        }
    }
View Full Code Here


        InetAddress address = InetAddress.getByName(addr);

        traceln("");
        traceln("using address=" + address + ":" + port);

        NetStat netstat;
        try {
            netstat = sigar.getNetStat(address.getAddress(), port);
        } catch (SigarNotImplementedException e) {
            return;
        } catch (SigarPermissionDeniedException e) {
            return;
        }

        assertGtEqZeroTrace("AllOutbound", netstat.getAllOutboundTotal());
        assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal());
        assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal());
        assertGtEqZeroTrace("AllInbound", netstat.getAllInboundTotal());
        int[] states = netstat.getTcpStates();
        for (int i=0; i<NetFlags.TCP_UNKNOWN; i++) {
            assertGtEqZeroTrace(NetConnection.getStateString(i), states[i]);
        }
    }
View Full Code Here

  }

  private List<DataEntity> buildTcpConnectionInfo() {
    ArrayList<DataEntity> entities = new ArrayList<DataEntity>();
    try {
      NetStat netStat = m_sigar.getNetStat();
      double tcpCon = netStat.getTcpEstablished();
      Map<String, Double> values = new HashMap<String, Double>();

      values.put(buildSystemId("establishedTcp"), tcpCon);
      entities.addAll(buildEntities(values, AVG_TYPE));
    } catch (Exception e) {
View Full Code Here

        InetAddress address = InetAddress.getByName(addr);

        traceln("");
        traceln("using address=" + address + ":" + port);

        NetStat netstat;
        try {
            netstat = sigar.getNetStat(address.getAddress(), port);
        } catch (SigarNotImplementedException e) {
            return;
        } catch (SigarPermissionDeniedException e) {
            return;
        }

        assertGtEqZeroTrace("AllOutbound", netstat.getAllOutboundTotal());
        assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal());
        assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal());
        assertGtEqZeroTrace("AllInbound", netstat.getAllInboundTotal());
        int[] states = netstat.getTcpStates();
        for (int i=0; i<NetFlags.TCP_UNKNOWN; i++) {
            assertGtEqZeroTrace(NetConnection.getStateString(i), states[i]);
        }
    }
View Full Code Here

        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();
        NetStat netstat;
       
        try {
            netstat = sigar.getNetStat();
        } catch (SigarNotImplementedException e) {
            return;
        } catch (SigarPermissionDeniedException e) {
            return;
        }

        traceln("");
        assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal());
        assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal());
        int[] states = netstat.getTcpStates();
        for (int i=0; i<NetFlags.TCP_UNKNOWN; i++) {
            assertGtEqZeroTrace(NetConnection.getStateString(i), states[i]);
        }
    }
View Full Code Here

        super(name);
    }

    public void testCreate() throws Exception {
        Sigar sigar = getSigar();
        NetStat netstat;
       
        try {
            netstat = sigar.getNetStat();
        } catch (SigarNotImplementedException e) {
            return;
        }

        traceln("");
        assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal());
        assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal());
        int[] states = netstat.getTcpStates();
        for (int i=0; i<NetFlags.TCP_UNKNOWN; i++) {
            assertGtEqZeroTrace(NetConnection.getStateString(i), states[i]);
        }
    }
View Full Code Here

        InetAddress address = InetAddress.getByName(addr);

        traceln("");
        traceln("using address=" + address + ":" + port);

        NetStat netstat;
        try {
            netstat = sigar.getNetStat(address.getAddress(), port);
        } catch (SigarNotImplementedException e) {
            return;
        }

        assertGtEqZeroTrace("AllOutbound", netstat.getAllOutboundTotal());
        assertGtEqZeroTrace("Outbound", netstat.getTcpOutboundTotal());
        assertGtEqZeroTrace("Inbound", netstat.getTcpInboundTotal());
        assertGtEqZeroTrace("AllInbound", netstat.getAllInboundTotal());
        int[] states = netstat.getTcpStates();
        for (int i=0; i<NetFlags.TCP_UNKNOWN; i++) {
            assertGtEqZeroTrace(NetConnection.getStateString(i), states[i]);
        }
    }
View Full Code Here

TOP

Related Classes of org.hyperic.sigar.NetStat

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.