beostat and libbeostat

The beostat utility is both a command line program and a set of "C" language library functions. The command line, beostat, provides a text listing of the information from the /proc structure on each node. Following is example output from a single node.

============== Node: .0 (index 0) ==================
 
 *** /proc/cpuinfo *** Tue Sep 12 14:38:04 2006
num processors  : 2
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 5
model name      : AMD Opteron(tm) Processor 248
stepping        : 10
cpu MHz         : 2211.355
cache size      : 1024 KB
fdiv_bug        : no
hlt_bug         : no
sep_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
bogomips        : 4422.05
 
 *** /proc/meminfo *** Tue Sep 12 14:38:04 2006
        total:    used:    free:  shared: buffers:  cached:
Mem:  4216758272 18960384 4197797888        0        0        0
Swap:        0        0        0
MemTotal:   4117928 kB
MemFree:    4099412 kB
MemShared:        0 kB
Buffers:          0 kB
Cached:           0 kB
SwapTotal:        0 kB
SwapFree:         0 kB
 
 *** /proc/loadavg *** Tue Sep 12 14:38:04 2006
0.00 0.00 0.00 28/28 0
 
 *** /proc/net/dev *** Tue Sep 12 14:38:04 2006
Inter-|   Receive                                                |  Transmit
 face |bytes packets errs drop fifo frame compressed multicast | bytes packets errs drop fifo colls carrier compressed
  eth0:105630479    73832        0        0        0     0          0         0  5618030  35864        0        0        0     0       0          0
  eth1:       0        0        0        0        0     0          0         0        0     0        0        0        0     0       0          0
 
 *** /proc/stat ***
cpu0 0 0 115 203357             Tue Sep 12 14:38:04 2006
cpu1 4 0 125 203261             Tue Sep 12 14:38:04 2006
 
 *** statfs ("/") *** Tue Sep 12 14:38:04 2006
path:           /
f_type:         0x1021994
f_bsize:        4096
f_blocks:       514741
f_bfree:        500311
f_bavail:       500311
f_files:        514741
f_ffree:        514630
f_fsid:         000000 000000
f_namelen:      255

The beostat library, libbeostat, contains the "C" language functions listed below. You compile with the header files sys/bproc.h and sys/beostat.h, adding the linker commands -lbproc -lbeostat.

beostat-get-cpu-count
beostat-get-name 
beostat-get-time
beostat-get-cpuinfo-x86
beostat-get-meminfo
beostat-get-loadavg
beostat-get-net-dev
beostat-get-stat-cpu
beostat-get-MHz
beostat-get-statfs-p
beostat-get-last-multicast
beostat-set-last-multicast
beostat-get-cpu-percent
beostat-get-net-rate
beostat-get-disk-usage
beostat-count-idle-cpus
beostat-count-idle-cpus-on-node
beostat-get-avail-nodes-by-id
beostat-is-node-available