lua-statgrab: a libstatgrab binding
===================================

(1) in case 'require("libstatgrab")':

  <libstatgrab> -> package.loaded["libstagrab"].

implemented functions and constants:
  ex.: sg_get_host_info() function in Lua: <libstagrab>.get_host_info()
    /* return value: a table */,

  ex.: sg_get_disk_io_stats(&entries) function in Lua: <libstatgrab>.get_disk_io_stats()
    /* return value: a table with entries*table */,

  SG_ERROR_* constants in Lua: <libstatgrab>.ERROR.* ,
  SG_IFACE_* constants in Lua: <libstatgrab>.IFACE.* ,
  SG_PROCESS_* constants in Lua: <libstatgrab>.PROCESS.* .

sample: see test1.lua .


(2) in case 'require("statgrab")':

  <statgrab> -> package.loaded["statgrab"].

plus functions:
  <statgrab>.startup() to intialize libstatgrab ,
  assert-versioned functions ex.: <libstatgrab>.get_host_info() -> <statgrab>.host_info() .

  :match( pattern [,field] ) for "entries" functions' result:
  ex.: <statgrab>.network_io_stats_diff():match('^eth0') // default field = 'interface_name',
       <statgrab>.process_stats():match('daemon','proctitle')

  :gmatch( pattern [,field] ) for "entries" functions' result, iterating for matching pattern:
  ex.: <statgrab>.network_io_stats_diff():gmatch('^et') ,
       <statgrab>.process_stats():gmatch('daemon','proctitle')

sample: see test2.lua .
