netStat = sigar.getNetStat();
public NetStat getNetStat() throws SigarException {return _sigar.getNetStat();}
public NetStat getNetStat(byte[] address, long port) throws SigarException {return _sigar.getNetStat(address, port);}
public Map<String, String> getNetworkInfo() { Map<String, String> result = Maps.newHashMap(); try { result = toMap(sigar.getNetStat()); } catch (Exception e) { logger.warn("exception during getNetworkInfo", e); } logger.trace("getNetworkInfo: {}", result); return result; }
public Object doMonitor(Map<String, Object> params) throws Exception { return SigarFactory.getSigar().getNetStat(); }
netStat = sigar.getNetStat();
netStat = sigar.getNetStat();
netStat = sigar.getNetStat();
netStat = sigar.getNetStat();
netStat = sigar.getNetStat();
/** * called on each poll * * @throws SigarException * @throws MonitorConfigurationException */ void refresh() throws SigarException, MonitorConfigurationException { try { this.swap = this.sigar.getSwap(); this.memory = this.sigar.getMem(); this.cpu = this.sigar.getCpu(); this.cpuPerc = this.sigar.getCpuPerc(); if( !OperatingSystemType.getCurrentOsType().equals( OperatingSystemType.AIX ) ) { this.netstat = this.sigar.getNetStat(); this.tcp = this.sigar.getTcp(); } this.loadAvrg = new SigarLoadAverage( this.sigar ); } catch( Exception e ) { final String errorMsg = "Error retrieving data from the Sigar monitoring system"; log.error( errorMsg, e ); throw new MonitorConfigurationException( errorMsg, e ); } }
@Override public TcpData getTcpData() { TcpData data = new TcpData(); try { NetStat stat = sigar.getNetStat(); data.setTcpBound(stat.getTcpBound()); data.setTcpEstablished(stat.getTcpEstablished()); data.setTcpIdle(stat.getTcpIdle()); data.setTcpListen(stat.getTcpListen()); data.setTcpSynchronizedReceived(stat.getTcpSynRecv()); long inboundBytes = 0; long outboundBytes = 0; for(String netInterface : sigar.getNetInterfaceList()) { for(String mask : interfaceNames) { if(netInterface.matches(mask)) { inboundBytes += sigar.getNetInterfaceStat(netInterface).getRxBytes(); outboundBytes += sigar.getNetInterfaceStat(netInterface).getTxBytes(); } } } data.setTcpInboundTotal(inboundBytes); data.setTcpOutboundTotal(outboundBytes); logger.debug("getTcpData: {}", data); } catch (SigarException e) { logger.warn("Exception during getTcpData", e); } return data; }