title: Looking for kstat equivalents in Linux
body: <p>I have a program that collects various kstat information on our Solaris systems and, now that we've introduced Linux into our data center, I'd like to do the same for Linux.</p>
  
  <p>I'm having trouble, however, finding equivalents for many of the kstats.  I was wondering if there is a library or utility that mimics kstats for the Linux environment.  Even a partial implementation would be helpful.</p>
  
  <p>As of right now, I've been parsing files in /proc but finding the right information has been hit or miss.  For example, kstat has the following data:</p>
  
  <p>unix::vminfo
  swap_alloc
  swap_avail
  swap_free
  swap_resv</p>
  
  <p>In Linux, you have the entries "SwapTotal" and "SwapFree" but
  a) It appears that swap_free actually corresponds to "SwapTotal" and swap_avail corresponds to "SwapFree"
  b) I can't find values for swap_avail (Maybe SwapTotal minus SwapFree?) now swap_resv</p>
  
  <p>Any ideas?</p>