Quantcast
Channel: VMware Communities : Popular Discussions - Hyperic User Forums
Viewing all articles
Browse latest Browse all 52618

How can I use Sigar in my Java project?

$
0
0
Hi!

I am a Java-Newbie, and I am playing around with my first program.

I want to get some hardware information, and in the newsgroups I was reprimand to Hyperic Sigar.

Now I tried some hours to get the needed information, but I didn't understand how Sigar works.

I tried:
---
import java.util.Map;

import org.hyperic.sigar.CpuInfo;
import org.hyperic.sigar.FileSystem;
import org.hyperic.sigar.Sigar;

public class SystemInfo {

     public static void main(String[] args) {

          System.out.println(Sigar.VERSION_STRING);

          System.out.println("**********");
          Map ci = new CpuInfo().toMap();
          System.out.println(ci.toString());

          System.out.println("**********");
          Map fs = new FileSystem().toMap();
          System.out.println(fs.toString());

          System.out.println("**********");
     }

}
---

But I get no Information:
---
1.2.0.0
**********
{Model=null, CacheSize=0, Mhz=0, Vendor=null}
**********
{Type=0, DirName=null, TypeName=null, DevName=null, SysTypeName=null, Flags=0}
**********
---

Please can anyone tell me how to use Sigar in my Java project?

Thanks & greetings,
Christian.

Viewing all articles
Browse latest Browse all 52618

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>