add primary interface info

This commit is contained in:
Doug MacEachern 2007-04-06 13:54:42 +00:00
parent 873849d4aa
commit 4a9e360914
1 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,7 @@
package org.hyperic.sigar.cmd;
import org.hyperic.sigar.NetInterfaceConfig;
import org.hyperic.sigar.SigarException;
/**
@ -38,6 +39,19 @@ public class NetInfo extends SigarCommandBase {
}
public void output(String[] args) throws SigarException {
NetInterfaceConfig config = this.sigar.getNetInterfaceConfig(null);
println("primary interface....." +
config.getName());
println("primary ip address...." +
config.getAddress());
println("primary mac address..." +
config.getHwaddr());
println("primary netmask......." +
config.getNetmask());
org.hyperic.sigar.NetInfo info =
this.sigar.getNetInfo();