We used SIGAR library https://support.hyperic.com/display/SIGAR/Home