* SUMMARY: mrtg - recording swap and mem. with vmstat
@ 1999-08-05 7:41 Dirk Bergl
0 siblings, 0 replies; only message in thread
From: Dirk Bergl @ 1999-08-05 7:41 UTC (permalink / raw)
To: tru64-unix-managers
Hi eveyone,
Thanks to the following for responding.......
"Frank Wortner" <frank@bondnet.com>
alan@nabeth.cxo.dec.com
"Alvarez, Cynthia" <Alvare2C@kochind.com>
"Balamuralikrishnan" <bsriniva@oakland.edu>
"Thomas.Meyer" <meyert@dla-marbach.de>
(Sorry if I left anyone out)
The original question was....
What is the best/easiest way to collect free memory and swap for use with
mrtg.
From the several different answers I recieved, there's a number of ways.
It comes down to individual choice...
A)
try "vmstat -s | sed -ne 4p" for free memory,
and the same for swap space: "swapon -s | sed -ne 16p"
------------------------------------------------------------------------
--------------------------------------------
B)
If you don't mind dealing in percentages rather than total MB...
/usr/sbin/swapon -s | awk '/Available/ { print $6 }' | sed -e 's/%)//'
If you want total physical memory use, then vmstat -P :
vmstat -P | awk '/Physical/ { print $7 }' | sed -e 's/M//'
If you want a percentage, just recover the total physical memory from the
boot message in /var/adm/messages and do the arithmetic:
awk 'BEGIN { MEM = 0 }
/physical memory/ { MEM = $9 }
END { print MEM }'
------------------------------------------------------------------------
--------------------------------------------
C)
Use TOP, a utility program, and grep the headings for the required data.
------------------------------------------------------------------------
--------------------------------------------
D)
Use Performance Manager Metrics Server as a source for MRTG
data.
pmgrd runs on port 1167 if set up and delivers a rich variety of data,
including memory and swap statistics.
------
Also, as I discovered, and as Alan pointed out, if you use vmstat with
MRTG, beware that sometimes vmstat's fields overrun, joining fields
togeather. To overcome this I used NF in the awk script, and then grabbed
the last 3 fields I was interested in via "(NR-1) (NR-2) (NR-3).
After initially using vmstat, I converted to using top for the stats,
although I'm still checking top to make sure it's stats are accurate.
pmgrd also looks like it might be worth investigating (Thanks for that
info. Thomas)
Thanks again for everyone's help.
Cheers,
Dirk.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-08-05 7:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-08-05 7:41 SUMMARY: mrtg - recording swap and mem. with vmstat Dirk Bergl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox