[Date Prev] [Date Next] | [Thread Prev] [Thread Next] | [Date Index] [Thread Index] |
[snips-users] hostmon-osclient.freebsd memory parsing
|
I have a box with a fairly large memory model. I noted free memory was always decoding to 0. I noted a bit of run-on for digits between avm and fre memory. A patch is included below. I put a limit to the numbers of digits that were to be included in avm and fre memory and allowed for possibility that there may not be a space between them. Tim Peiffer %vmstat procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad6 md0 in sy cs us sy id 0 0 0 10044344252 290 0 0 0 288 0 0 0 270 900 46 12 1 87 Jun 2 15:54 2002 diff -cl hostmon-client.freebsd.orig hostmon-client.freebsd Page 1 *** hostmon-client.freebsd.orig Sun Jun 2 15:51:48 2002 --- hostmon-client.freebsd Sun Jun 2 15:52:24 2002 *************** *** 282,288 **** # and the space before avm can get lost. Hence taking 2 fields # for each process... ### procs # avm # fre # flt # re # pi # po # disks # cs # us # sy # id ###### ! if (/^(..){3}\s*(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)(\s+\d+)+\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s*$/) { printf "MemFree %d MB\n", int($3 / 1000); # convert KB to MB print "PageFlt $4 pgflts\n"; --- 282,288 ---- # and the space before avm can get lost. Hence taking 2 fields # for each process... ### procs # avm # fre # flt # re # pi # po # disks # cs # us # sy # id ###### ! if (/^(..){3}\s*(\d{1,5)\s*(\d{1,6})\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)(\s+\d+)+\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s*$/) { printf "MemFree %d MB\n", int($3 / 1000); # convert KB to MB print "PageFlt $4 pgflts\n"; |