Lua-statgrab: a libstatgrab binding
===================================

Functions and constants are implemented in Lua 'sg' module.

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

  sg_get_host_info() function in Lua: sg.get_host_info()
    /* return value: a table */,

  sg_get_disk_io_stats(&entries) function in Lua: sg.get_disk_io_stats()
    /* return value: a table with entries*table */,

  SG_ERROR_* constants in Lua: sg.ERROR.* ,
  SG_IFACE_* constants in Lua: sg.IFACE.* ,
  SG_PROCESS_* constants in Lua: sg.PROCESS.* .

sample: see test1.lua .


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

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

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

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

sample: see test2.lua .

