Java如何获取系统cpu、内存、硬盘信息
1 概述
前段时间摸索在Java中怎么获取系统信息包括cpu、内存、硬盘信息等,刚开始使用Java自带的包进行获取,但这样获取的内存信息不够准确并且容易出现找不到相应包等错误,所以后面使用sigar插件进行获取。下面列举出了这两种方式获取系统信息的方式及代码。
2 使用Java自带包获取系统信息
2.1 使用Java自带包获取系统信息代码如下:
2.1.1 Bytes.java
public class Bytes {
public static String substring(String src, int start_idx, int end_idx){
byte[] b = src.getBytes();
String tgt = "";
for(int i=start_idx; i<=end_idx; i++){
tgt +=(char)b[i];
}
return tgt;
}
}
2.1.2 IMonitorService.java
public interface IMonitorService {
public MonitorInfoBean getMonitorInfoBean() throws Exception;
}
2.1.3 MonitorInfoBean.java
public class MonitorInfoBean {
private long totalMemory;
private long freeMemory;
private long maxMemory;
private String osName;
private long totalMemorySize;
private long freePhysicalMemorySize;
private long usedMemory;
private int totalThread;
private double cpuRatio; public long getFreeMemory() {
return freeMemory;
} public void setFreeMemory(long freeMemory) {
this.freeMemory = freeMemory;
} public long getFreePhysicalMemorySize() {
return freePhysicalMemorySize;
} public void setFreePhysicalMemorySize(long freePhysicalMemorySize) {
this.freePhysicalMemorySize = freePhysicalMemorySize;
} public long getMaxMemory() {
return maxMemory;
} public void setMaxMemory(long maxMemory) {
this.maxMemory = maxMemory;
} public String getOsName() {
return osName;
} public void setOsName(String osName) {
this.osName = osName;
} public long getTotalMemory() {
return totalMemory;
} public void setTotalMemory(long totalMemory) {
this.totalMemory = totalMemory;
} public long getTotalMemorySize() {
return totalMemorySize;
} public void setTotalMemorySize(long totalMemorySize) {
this.totalMemorySize = totalMemorySize;
} public int getTotalThread() {
return totalThread;
} public void setTotalThread(int totalThread) {
this.totalThread = totalThread;
} public long getUsedMemory() {
return usedMemory;
} public void setUsedMemory(long usedMemory) {
this.usedMemory = usedMemory;
} public double getCpuRatio() {
return cpuRatio;
} public void setCpuRatio(double cpuRatio) {
this.cpuRatio = cpuRatio;
}
}
2.1.4
import java.io.InputStreamReader;
import java.io.LineNumberReader; //import sun.management.ManagementFactory;
//import com.sun.management.OperatingSystemMXBean;
import java.io.*;
import java.lang.management.ManagementFactory;
import java.util.StringTokenizer; public class MonitorServiceImpl implements IMonitorService {
private static final int CPUTIME = 30;
private static final int PERCENT = 100;
private static final int FAULTLENGTH = 10;
private static final File versionFile = new File("/proc/version");
private static String linuxVersion = null; public MonitorInfoBean getMonitorInfoBean() throws Exception {
int kb = 1024;
long totalMemory = Runtime.getRuntime().totalMemory() / kb;
long freeMemory = Runtime.getRuntime().freeMemory() / kb;
long maxMemory = Runtime.getRuntime().maxMemory() / kb; // OperatingSystemMXBean osmxb = (OperatingSystemMXBean)
// ManagementFactory
// .getOperatingSystemMXBean();
// String osName = System.getProperty("os.name");
// long totalMemorySize = osmxb.getTotalPhysicalMemorySize() / kb;
// long freePhysicalMemorySize = osmxb.getFreePhysicalMemorySize() / kb;
// long usedMemory = (osmxb.getTotalPhysicalMemorySize() - osmxb
// .getFreePhysicalMemorySize()) / kb; ThreadGroup parentThread;
for (parentThread = Thread.currentThread().getThreadGroup(); parentThread.getParent() != null; parentThread = parentThread.getParent());
int totalThread = parentThread.activeCount();
double cpuRatio = 0; // if (osName.toLowerCase().startsWith("windows")) {
// cpuRatio = this.getCpuRatioForWindows();
// } else {
// cpuRatio = this.getCpuRateForLinux();
// } MonitorInfoBean infoBean = new MonitorInfoBean();
infoBean.setFreeMemory(freeMemory);
// infoBean.setFreePhysicalMemorySize(freePhysicalMemorySize);
infoBean.setMaxMemory(maxMemory);
// infoBean.setOsName(osName);
infoBean.setTotalMemory(totalMemory);
// infoBean.setTotalMemorySize(totalMemorySize);
infoBean.setTotalThread(totalThread);
// infoBean.setUsedMemory(usedMemory);
infoBean.setCpuRatio(cpuRatio);
return infoBean;
} private static double getCpuRateForLinux() {
InputStream is = null;
InputStreamReader isr = null;
BufferedReader brStat = null;
StringTokenizer tokenStat = null;
try { System.out.println("Get usage rate of CUP , linux version: " + linuxVersion); Process process = Runtime.getRuntime().exec("top -b -n 1");
is = process.getInputStream();
isr = new InputStreamReader(is);
brStat = new BufferedReader(isr); if (linuxVersion.equals("2.4")) {
brStat.readLine();
brStat.readLine();
brStat.readLine();
brStat.readLine();
tokenStat = new StringTokenizer(brStat.readLine());
tokenStat.nextToken();
tokenStat.nextToken(); String user = tokenStat.nextToken();
tokenStat.nextToken();
String system = tokenStat.nextToken();
tokenStat.nextToken();
String nice = tokenStat.nextToken();
System.out.println(user + " , " + system + " , " + nice);
user = user.substring(0, user.indexOf("%"));
system = system.substring(0, system.indexOf("%"));
nice = nice.substring(0, nice.indexOf("%"));
float userUsage = new Float(user).floatValue();
float systemUsage = new Float(system).floatValue();
float niceUsage = new Float(nice).floatValue();
return (userUsage + systemUsage + niceUsage) / 100;
} else {
brStat.readLine();
brStat.readLine();
tokenStat = new StringTokenizer(brStat.readLine());
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
tokenStat.nextToken();
String cpuUsage = tokenStat.nextToken();
System.out.println("CPU idle : " + cpuUsage);
Float usage = new Float(cpuUsage.substring(0, cpuUsage.indexOf("%")));
return (1 - usage.floatValue() / 100);
}
} catch (IOException ioe) {
System.out.println(ioe.getMessage());
freeResource(is, isr, brStat);
return 1;
} finally {
freeResource(is, isr, brStat);
}
} private static void freeResource(InputStream is, InputStreamReader isr, BufferedReader br) {
try {
if (is != null)
is.close();
if (isr != null)
isr.close();
if (br != null)
br.close();
} catch (IOException ioe) {
System.out.println(ioe.getMessage());
}
} private double getCpuRatioForWindows() {
try {
String procCmd = System.getenv("windir")
+ "\\system32\\wbem\\wmic.exe process get Caption,CommandLine,"
+ "KernelModeTime,ReadOperationCount,ThreadCount,UserModeTime,WriteOperationCount";
long[] c0 = readCpu(Runtime.getRuntime().exec(procCmd));
Thread.sleep(CPUTIME);
long[] c1 = readCpu(Runtime.getRuntime().exec(procCmd));
if (c0 != null && c1 != null) {
long idletime = c1[0] - c0[0];
long busytime = c1[1] - c0[1];
return Double.valueOf(
PERCENT * (busytime) / (busytime + idletime)).doubleValue();
} else {
return 0.0;
}
} catch (Exception ex) {
ex.printStackTrace();
return 0.0;
}
} private long[] readCpu(final Process proc) { long[] retn = new long[2];
try {
proc.getOutputStream().close();
InputStreamReader ir = new InputStreamReader(proc.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String line = input.readLine(); if (line == null || line.length() < FAULTLENGTH) {
return null;
} int capidx = line.indexOf("Caption");
int cmdidx = line.indexOf("CommandLine");
int rocidx = line.indexOf("ReadOperationCount");
int umtidx = line.indexOf("UserModeTime");
int kmtidx = line.indexOf("KernelModeTime");
int wocidx = line.indexOf("WriteOperationCount");
long idletime = 0;
long kneltime = 0;
long usertime = 0; while ((line = input.readLine()) != null) {
if (line.length() < wocidx) {
continue;
} String caption = Bytes.substring(line, capidx, cmdidx - 1) .trim();
String cmd = Bytes.substring(line, cmdidx, kmtidx - 1).trim();
if (cmd.indexOf("wmic.exe") >= 0) {
continue;
} // log.info("line="+line);
if (caption.equals("System Idle Process") || caption.equals("System")) {
idletime += Long.valueOf(
Bytes.substring(line, kmtidx, rocidx - 1).trim()).longValue();
idletime += Long.valueOf(
Bytes.substring(line, umtidx, wocidx - 1).trim()).longValue();
continue;
} kneltime += Long.valueOf(
Bytes.substring(line, kmtidx, rocidx - 1).trim()).longValue();
usertime += Long.valueOf(
Bytes.substring(line, umtidx, wocidx - 1).trim()).longValue();
}
retn[0] = idletime;
retn[1] = kneltime + usertime;
return retn;
} catch (Exception ex) {
ex.printStackTrace();
} finally {
try {
proc.getInputStream().close();
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
} public static void main(String[] args) throws Exception {
IMonitorService service = new MonitorServiceImpl();
MonitorInfoBean monitorInfo = service.getMonitorInfoBean();
System.out.println("cpu percent: " + monitorInfo.getCpuRatio());
System.out.println("can use memory: " + monitorInfo.getTotalMemory());
System.out.println("ideal memory: " + monitorInfo.getFreeMemory());
System.out.println("largest memory: " + monitorInfo.getMaxMemory());
System.out.println("all memory: " + monitorInfo.getTotalMemorySize() + "kb");
System.out.println("ideal memory: " + monitorInfo.getFreeMemory() + "kb");
System.out.println("used memory: " + monitorInfo.getUsedMemory() + "kb");
System.out.println("thread num: " + monitorInfo.getTotalThread() + "kb");
}
}
2.2 执行结果如下图所示:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM8AAACeCAIAAAAaMclaAAAgAElEQVR4nO2dd1iT1/v/Uzr8tLUT229bt6hV0IIiQ4KsBIKEsMIOG8RVUakD6kQUqlFkCEURQVD2ECJ7743svWTvvTOe3x/n53OlWUaraat5X1yXycn9nHMS3888r3MfBMQXX7wSAvwzPDTI/+P/ve2//++2xoY6/h//723//X+3Ufni6+0L8c+cwPl6L8V3G1+8E99t0Pj4+OPHj6lU6t+phEajVVZWRkZGRkRElJWVvbS2V41/N8R3G/Ts2TMEAkEmk/9OJY2NjTo6OjgcTkNDQ1NTs7q6+s3Gvxti4bbR0dH09PTw8PCoqKjS0lJQmJqaWlhYmJSUFB0dnZGRMT8/D8qzsrLq6+vB666urvj4eM7tsauHSqVWV1fHxsaGhYVlZGTMzMzAmxQUFJSWlj579gwcCZqamjj0k109WVlZ5eXlmZmZUVFRiYmJoHx6ejokJMTV1RWBQAQHB4eEhGRkZND3dmFhYWFhgZvf8dixY9LS0nV1dY2NjfLy8hYWFm82/t0Qo9tmZ2evX7+ura2to6Ojp6dnZ2cHypFIpJKS0rFjx2xtbXE43JMnT0A5BoNxdXUFr0NDQ4WEhDi3x66eiooKCwsLfX19PB6vqan58OFDGo0GPiIQCFgs1tHR0czMzMDAICgoiEM/2dWDwWC0tLQcHR2trKz27t0bFxcHQdDAwIChoSEGg0EgEAYGBoaGhlevXqXvbVhY2KNHj176I1IolDVr1nh5eYG3Dx48EBQU5GDTV41/Z8TotszMzJ9++ik4OHh4eLi3tzc0NBSUI5FIUVHRoaEhKpXq6uoqJia2uLgIvZbbmOuhUCja2trm5uZt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j/f19QWUGJlMFhcXd3V1raysTE5O3r17N5yz8vTp0wYGBqWlpRkZGdu2bXttt929e1dSUhLMJ5WTk+PSba+akR7imAvSyclp+/btYD4ECoVat26dj49PVFQUGo0+dOjQK7Xyjon1yFVQUJCysrKkpCRsIzs7O5hHTUlJoV8B/OLFiyARJL0oFMrdu3fV1dX37t2rqalJJBJBeX5+vpaWFg6Hs7GxCQwMVFZWBuUAsFZVVSUQCC4uLgQCgXO/2fVnamrq0KFD4HR27949UF5YWAgSzt+7dw8k0T116hQ4AwIRCAQ9PT3OLTKooaFBUlISnuocHBwMz6GamZnBYrG+vr4QBB09evTGjRtWVlZIJPLIkSPwver7Kf6oPF+8E99tfPFOfLfxxTvx3cYX78R3G1+8E99tfPFOfLfxxTvx3cYX78R3G1+8E99tfPFOfLfxxTvx3cYX78R3G1+8E99tfPFOfLfxxTvx3cYX78R3G1+8E99tfPFOfLfxxTvx3cYX78R3G1+8E99tfPFO/w+b+B2hEklUvQAAAABJRU5ErkJggg==" alt="" />
3 使用sigar获取系统信息
3.1 下载安装sigar-1.6.4.zip
使用java自带的包获取系统数据,容易找不到包,尤其是内存信息不够准确,所以选择使用sigar获取系统信息。
下载地址:http://sourceforge.net/projects/sigar/files/latest/download?source=files
解压压缩包,将lib下sigar.jar导入eclipse的CLASSPATH中,再将sigar-x86-winnt.dll存入Java的bin目录即可。
3.2 代码实现如下:
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Map;
import java.util.Properties;
import org.hyperic.sigar.CpuInfo;
import org.hyperic.sigar.CpuPerc;
import org.hyperic.sigar.FileSystem;
import org.hyperic.sigar.FileSystemUsage;
import org.hyperic.sigar.Mem;
import org.hyperic.sigar.NetFlags;
import org.hyperic.sigar.NetInterfaceConfig;
import org.hyperic.sigar.NetInterfaceStat;
import org.hyperic.sigar.OperatingSystem;
import org.hyperic.sigar.Sigar;
import org.hyperic.sigar.SigarException;
import org.hyperic.sigar.Swap;
import org.hyperic.sigar.Who; public class RuntimeTest {
public static void main(String[] args) {
try {
// System信息,从jvm获取
property();
System.out.println("----------------------------------");
// cpu信息
cpu();
System.out.println("----------------------------------");
// 内存信息
memory();
System.out.println("----------------------------------");
// 操作系统信息
os();
System.out.println("----------------------------------");
// 用户信息
who();
System.out.println("----------------------------------");
// 文件系统信息
file();
System.out.println("----------------------------------");
// 网络信息
net();
System.out.println("----------------------------------");
// 以太网信息
ethernet();
System.out.println("----------------------------------");
} catch (Exception e1) {
e1.printStackTrace();
}
} private static void property() throws UnknownHostException {
Runtime r = Runtime.getRuntime();
Properties props = System.getProperties();
InetAddress addr;
addr = InetAddress.getLocalHost();
String ip = addr.getHostAddress();
Map<String, String> map = System.getenv();
String userName = map.get("USERNAME");// 获取用户名
String computerName = map.get("COMPUTERNAME");// 获取计算机名
String userDomain = map.get("USERDOMAIN");// 获取计算机域名
System.out.println("用户名: " + userName);
System.out.println("计算机名: " + computerName);
System.out.println("计算机域名: " + userDomain);
System.out.println("本地ip地址: " + ip);
System.out.println("本地主机名: " + addr.getHostName());
System.out.println("JVM可以使用的总内存: " + r.totalMemory());
System.out.println("JVM可以使用的剩余内存: " + r.freeMemory());
System.out.println("JVM可以使用的处理器个数: " + r.availableProcessors());
System.out.println("Java的运行环境版本: " + props.getProperty("java.version"));
System.out.println("Java的运行环境供应商: " + props.getProperty("java.vendor"));
System.out.println("Java供应商的URL: " + props.getProperty("java.vendor.url"));
System.out.println("Java的安装路径: " + props.getProperty("java.home"));
System.out.println("Java的虚拟机规范版本: " + props.getProperty("java.vm.specification.version"));
System.out.println("Java的虚拟机规范供应商: " + props.getProperty("java.vm.specification.vendor"));
System.out.println("Java的虚拟机规范名称: " + props.getProperty("java.vm.specification.name"));
System.out.println("Java的虚拟机实现版本: " + props.getProperty("java.vm.version"));
System.out.println("Java的虚拟机实现供应商: " + props.getProperty("java.vm.vendor"));
System.out.println("Java的虚拟机实现名称: " + props.getProperty("java.vm.name"));
System.out.println("Java运行时环境规范版本: " + props.getProperty("java.specification.version"));
System.out.println("Java运行时环境规范供应商: " + props.getProperty("java.specification.vender"));
System.out.println("Java运行时环境规范名称: " + props.getProperty("java.specification.name"));
System.out.println("Java的类格式版本号: " + props.getProperty("java.class.version"));
System.out.println("Java的类路径: " + props.getProperty("java.class.path"));
System.out.println("加载库时搜索的路径列表: " + props.getProperty("java.library.path"));
System.out.println("默认的临时文件路径: " + props.getProperty("java.io.tmpdir"));
System.out.println("一个或多个扩展目录的路径: " + props.getProperty("java.ext.dirs"));
System.out.println("操作系统的名称: " + props.getProperty("os.name"));
System.out.println("操作系统的构架: " + props.getProperty("os.arch"));
System.out.println("操作系统的版本: " + props.getProperty("os.version"));
System.out.println("文件分隔符: " + props.getProperty("file.separator"));
System.out.println("路径分隔符: " + props.getProperty("path.separator"));
System.out.println("行分隔符: " + props.getProperty("line.separator"));
System.out.println("用户的账户名称: " + props.getProperty("user.name"));
System.out.println("用户的主目录: " + props.getProperty("user.home"));
System.out.println("用户的当前工作目录: " + props.getProperty("user.dir"));
} private static void memory() throws SigarException {
Sigar sigar = new Sigar();
Mem mem = sigar.getMem();
// 内存总量
System.out.println("内存总量: " + mem.getTotal() / 1024L + "K av");
// 当前内存使用量
System.out.println("当前内存使用量: " + mem.getUsed() / 1024L + "K used");
// 当前内存剩余量
System.out.println("当前内存剩余量: " + mem.getFree() / 1024L + "K free");
Swap swap = sigar.getSwap();
// 交换区总量
System.out.println("交换区总量: " + swap.getTotal() / 1024L + "K av");
// 当前交换区使用量
System.out.println("当前交换区使用量: " + swap.getUsed() / 1024L + "K used");
// 当前交换区剩余量
System.out.println("当前交换区剩余量: " + swap.getFree() / 1024L + "K free");
} private static void cpu() throws SigarException {
Sigar sigar = new Sigar();
CpuInfo infos[] = sigar.getCpuInfoList();
CpuPerc cpuList[] = null;
cpuList = sigar.getCpuPercList();
for (int i = 0; i < infos.length; i++) {// 不管是单块CPU还是多CPU都适用
CpuInfo info = infos[i];
System.out.println("第" + (i + 1) + "块CPU信息");
System.out.println("CPU的总量MHz: " + info.getMhz());// CPU的总量MHz
System.out.println("CPU生产商: " + info.getVendor());// 获得CPU的卖主,如:Intel
System.out.println("CPU类别: " + info.getModel());// 获得CPU的类别,如:Celeron
System.out.println("CPU缓存数量: " + info.getCacheSize());// 缓冲存储器数量
printCpuPerc(cpuList[i]);
}
} private static void printCpuPerc(CpuPerc cpu) {
System.out.println("CPU用户使用率: " + CpuPerc.format(cpu.getUser()));// 用户使用率
System.out.println("CPU系统使用率: " + CpuPerc.format(cpu.getSys()));// 系统使用率
System.out.println("CPU当前等待率: " + CpuPerc.format(cpu.getWait()));// 当前等待率
System.out.println("CPU当前错误率: " + CpuPerc.format(cpu.getNice()));//
System.out.println("CPU当前空闲率: " + CpuPerc.format(cpu.getIdle()));// 当前空闲率
System.out.println("CPU总的使用率: " + CpuPerc.format(cpu.getCombined()));// 总的使用率
} private static void os() {
OperatingSystem OS = OperatingSystem.getInstance();
// 操作系统内核类型如: 386、486、586等x86
System.out.println("操作系统: " + OS.getArch());
System.out.println("操作系统CpuEndian(): " + OS.getCpuEndian());//
System.out.println("操作系统DataModel(): " + OS.getDataModel());//
// 系统描述
System.out.println("操作系统的描述: " + OS.getDescription());
// 操作系统类型
// System.out.println("OS.getName(): " + OS.getName());
// System.out.println("OS.getPatchLevel(): " + OS.getPatchLevel());//
// 操作系统的卖主
System.out.println("操作系统的卖主: " + OS.getVendor());
// 卖主名称
System.out.println("操作系统的卖主名: " + OS.getVendorCodeName());
// 操作系统名称
System.out.println("操作系统名称: " + OS.getVendorName());
// 操作系统卖主类型
System.out.println("操作系统卖主类型: " + OS.getVendorVersion());
// 操作系统的版本号
System.out.println("操作系统的版本号: " + OS.getVersion());
} private static void who() throws SigarException {
Sigar sigar = new Sigar();
Who who[] = sigar.getWhoList();
if (who != null && who.length > 0) {
for (int i = 0; i < who.length; i++) {
// System.out.println("当前系统进程表中的用户名" + String.valueOf(i));
Who _who = who[i];
System.out.println("用户控制台: " + _who.getDevice());
System.out.println("用户host: " + _who.getHost());
// System.out.println("getTime(): " + _who.getTime());
// 当前系统进程表中的用户名
System.out.println("当前系统进程表中的用户名: " + _who.getUser());
}
}
} private static void file() throws Exception {
Sigar sigar = new Sigar();
FileSystem fslist[] = sigar.getFileSystemList();
for (int i = 0; i < fslist.length; i++) {
System.out.println("分区的盘符名称" + i);
FileSystem fs = fslist[i];
// 分区的盘符名称
System.out.println("盘符名称: " + fs.getDevName());
// 分区的盘符名称
System.out.println("盘符路径: " + fs.getDirName());
System.out.println("盘符标志: " + fs.getFlags());//
// 文件系统类型,比如 FAT32、NTFS
System.out.println("盘符类型: " + fs.getSysTypeName());
// 文件系统类型名,比如本地硬盘、光驱、网络文件系统等
System.out.println("盘符类型名: " + fs.getTypeName());
// 文件系统类型
System.out.println("盘符文件系统类型: " + fs.getType());
FileSystemUsage usage = null;
usage = sigar.getFileSystemUsage(fs.getDirName());
switch (fs.getType()) {
case 0: // TYPE_UNKNOWN :未知
break;
case 1: // TYPE_NONE
break;
case 2: // TYPE_LOCAL_DISK : 本地硬盘
// 文件系统总大小
System.out.println(fs.getDevName() + "总大小: " + usage.getTotal() + "KB");
// 文件系统剩余大小
System.out.println(fs.getDevName() + "剩余大小: " + usage.getFree() + "KB");
// 文件系统可用大小
System.out.println(fs.getDevName() + "可用大小: " + usage.getAvail() + "KB");
// 文件系统已经使用量
System.out.println(fs.getDevName() + "已经使用量: " + usage.getUsed() + "KB");
double usePercent = usage.getUsePercent() * 100D;
// 文件系统资源的利用率
System.out.println(fs.getDevName() + "资源的利用率: " + usePercent + "%");
break;
case 3:// TYPE_NETWORK :网络
break;
case 4:// TYPE_RAM_DISK :闪存
break;
case 5:// TYPE_CDROM :光驱
break;
case 6:// TYPE_SWAP :页面交换
break;
}
System.out.println(fs.getDevName() + "读出: " + usage.getDiskReads());
System.out.println(fs.getDevName() + "写入: " + usage.getDiskWrites());
}
return;
} private static void net() throws Exception {
Sigar sigar = new Sigar();
String ifNames[] = sigar.getNetInterfaceList();
for (int i = 0; i < ifNames.length; i++) {
String name = ifNames[i];
NetInterfaceConfig ifconfig = sigar.getNetInterfaceConfig(name);
System.out.println("网络设备名: " + name);// 网络设备名
System.out.println("IP地址: " + ifconfig.getAddress());// IP地址
System.out.println("子网掩码: " + ifconfig.getNetmask());// 子网掩码
if ((ifconfig.getFlags() & 1L) <= 0L) {
System.out.println("!IFF_UP...skipping getNetInterfaceStat");
continue;
}
NetInterfaceStat ifstat = sigar.getNetInterfaceStat(name);
System.out.println(name + "接收的总包裹数:" + ifstat.getRxPackets());// 接收的总包裹数
System.out.println(name + "发送的总包裹数:" + ifstat.getTxPackets());// 发送的总包裹数
System.out.println(name + "接收到的总字节数:" + ifstat.getRxBytes());// 接收到的总字节数
System.out.println(name + "发送的总字节数:" + ifstat.getTxBytes());// 发送的总字节数
System.out.println(name + "接收到的错误包数:" + ifstat.getRxErrors());// 接收到的错误包数
System.out.println(name + "发送数据包时的错误数:" + ifstat.getTxErrors());// 发送数据包时的错误数
System.out.println(name + "接收时丢弃的包数:" + ifstat.getRxDropped());// 接收时丢弃的包数
System.out.println(name + "发送时丢弃的包数:" + ifstat.getTxDropped());// 发送时丢弃的包数
}
} private static void ethernet() throws SigarException {
Sigar sigar = null;
sigar = new Sigar();
String[] ifaces = sigar.getNetInterfaceList();
for (int i = 0; i < ifaces.length; i++) {
NetInterfaceConfig cfg = sigar.getNetInterfaceConfig(ifaces[i]);
if (NetFlags.LOOPBACK_ADDRESS.equals(cfg.getAddress()) || (cfg.getFlags() & NetFlags.IFF_LOOPBACK) != 0
|| NetFlags.NULL_HWADDR.equals(cfg.getHwaddr())) {
continue;
}
System.out.println(cfg.getName() + "IP地址:" + cfg.getAddress());// IP地址
System.out.println(cfg.getName() + "网关广播地址:" + cfg.getBroadcast());// 网关广播地址
System.out.println(cfg.getName() + "网卡MAC地址:" + cfg.getHwaddr());// 网卡MAC地址
System.out.println(cfg.getName() + "子网掩码:" + cfg.getNetmask());// 子网掩码
System.out.println(cfg.getName() + "网卡描述信息:" + cfg.getDescription());// 网卡描述信息
System.out.println(cfg.getName() + "网卡类型" + cfg.getType());//
}
}
}
原创文章欢迎转载,转载时请注明出处。
作者推荐文章:
》Eclipse中部署Hadoop2.3.0并直接在Eclipse中提交mapreduce任务
》Java如何获取系统信息(包括操作系统、jvm、cpu、内存、硬盘、网络等)
Java如何获取系统cpu、内存、硬盘信息的更多相关文章
- Windows 性能监视器的基本指标(CPU,内存,硬盘参数)
转载:http://kms.lenovots.com/kb/article.php?id=7045 Windows 性能监视器的基本指标(CPU,内存,硬盘参数) 作为一个系统工程师来说,要看懂监控的 ...
- java中获取系统属性以及环境变量
java中获取系统属性以及环境变量 System.getEnv()和System.getProperties()的差别 从概念上讲,系统属性 和环境变量 都是名称与值之间的映射.两种机制都能用来将用户 ...
- VPS性能测试:CPU内存,硬盘IO读写,带宽速度,UnixBench和压力测试
现在便宜的VPS主机越来越多了,一些美国的VPS主机甚至给出1美元一月的VPS,堪比虚拟主机还要便宜,巨大的价格优势吸引不少人购买和使用,而近些年来国内的主机商也开始意识到便宜的VPS对草根站长的诱惑 ...
- Windows 性能监视器的基本指标说明(CPU,内存,硬盘参数)
[转]Windows 性能监视器的基本指标说明(CPU,内存,硬盘参数) 作为一个系统工程师来说,要看懂监控的数据至关重要,关系着优化和分析出现的问题.我是在运维过程中要用到的.因此,今天给出Wind ...
- 主机性能监控之wmi 获取系统信息及内存性能信息
标 题: 主机性能监控之wmi 获取系统信息及内存性能信息作 者: itdef链 接: http://www.cnblogs.com/itdef/p/3990240.html 欢迎转帖 请保持文本完整 ...
- java后台获取和js拼接展示信息
java后台获取和js拼接展示信息: html页面代码: <div class="results-bd"> <table id="activityInf ...
- Windows系统CPU内存网络性能统计第一篇 内存
最近翻出以前做过的Windows系统性能统计程序,这个程序可以统计系统中的CPU使用情况,内存使用情况以及网络流量.现在将其整理一下(共有三篇),希望对大家有所帮助. 目录如下: 1.<Wind ...
- c++ 如何获取系统时间 - zjnig711的信息仓库 - 博客频道 - CSDN.NET
c++ 如何获取系统时间 - zjnig711的信息仓库 - 博客频道 - CSDN.NET c++ 如何获取系统时间 分类: C/C++ 2008-05-08 22:15 14115人阅读 评论(5 ...
- Java 如何获取系统时间
Java 如何获取系统时间 import java.text.SimpleDateFormat; import java.util.Date; public class Test { public s ...
随机推荐
- FZU 2140 Forever 0.5 (几何构造)
Forever 0.5 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit ...
- POJ 3904 Sky Code (容斥原理)
B - Sky Code Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit ...
- 安装qmake与环境变量解析
转自:http://www.kuqin.com/qtdocument/qmake-manual-2.html 安装qmake 当Qt被连编的时候,默认情况下qmake也会被连编. 这一部分解释如何手工 ...
- python基础——函数的参数
python基础——函数的参数 定义函数的时候,我们把参数的名字和位置确定下来,函数的接口定义就完成了.对于函数的调用者来说,只需要知道如何传递正确的参数,以及函数将返回什么样的值就够了,函数内部的复 ...
- Linus的redHat在root出现错误:-bash: addgroup: command not found
在root下无法完成添加用户组操作,如下: [root@host8 ~]# addgroup hadoop-bash: addgroup: command not found 这是的,root下竟然不 ...
- c++find函数用法
头文件 #include <algorithm> 函数实现 template<class InputIterator, class T> InputIterator find ...
- ViewPager左右滑动
布局: <android.support.v4.view.ViewPager android:id="@+id/viewpager_main" android:layout_ ...
- jpg图片转eps 用于LaTeX
好用的网上在线转,使用的sam2p 可以方便地将jpg或jpeg转为eps,pdf http://www.tlhiv.org/rast2vec/ windows下.jpg转.eps for latex ...
- sqldatasource控件设置where语句
按照学号查找显示信息,我现在也不知道各部分代表的含义,先记下来
- Java Web应用调优线程池
最简单的单线程 我们先从基础开始.无论使用哪种应用服务器或者框架(如Tomcat.Jetty等),他们都有类似的基础实现.Web服务的基础是套接字(socket),套接字负责监听端口,等待TCP连接, ...