script for $vm_stat

2008-12-05 Thread pano . irk
Hi!
Help!  me  a script for vm_stat

$ vm_stat
Mach Virtual Memory Statistics: (page size of 4096 bytes)
Pages free:   248491.
Pages active: 345632.
Pages inactive:   306207.
Pages wired down: 146885.
Translation faults:  598998500.
Pages copy-on-write:42312589.
Pages zero filled: 293975670.
Pages reactivated: 64106.
Pageins:  243273.
Pageouts:  84934.
Object cache: 15930737 hits of 16092223 lookups (98% hit rate)

Like this:
$perl script.pl
Pages free:248491 Pages active: 345632 Pages inactive: 306207 Pages
wired down:146885 Translation faults: 598998500 Pages copy-on-write:
42312589 Pages zero filled: 64106 Pages reactivated:64106 Pageins:
243273 Pageouts: 84934 Object cache:15930737

I would like to use it in cacti graph:
href=http://content.screencast.com/users/tamias/folders/Jing/media/
7c7f2893-b6e9-4018-864c-f0fe63ce0aca/0210.png
It is built using 4 script, but it is expensive.
Need a single script, and that he had issued all the values at once.

Thank you in advance!

[EMAIL PROTECTED]



perl script for $vm_stat

2008-12-05 Thread sibtamias
Hi!
Help!  me  a script for vm_stat

$ vm_stat
Mach Virtual Memory Statistics: (page size of 4096 bytes)
Pages free:   248491.
Pages active: 345632.
Pages inactive:   306207.
Pages wired down: 146885.
Translation faults:  598998500.
Pages copy-on-write:42312589.
Pages zero filled: 293975670.
Pages reactivated: 64106.
Pageins:  243273.
Pageouts:  84934.
Object cache: 15930737 hits of 16092223 lookups (98% hit rate)

Like this:
$perl script.pl
Pages free:248491 Pages active: 345632 Pages inactive: 306207 Pages
wired down:146885 Translation faults: 598998500 Pages copy-on-write:
42312589 Pages zero filled: 64106 Pages reactivated:64106 Pageins:
243273 Pageouts: 84934 Object cache:15930737

I would like to use it in cacti graph:
href=http://content.screencast.com/users/tamias/folders/Jing/media/
7c7f2893-b6e9-4018-864c-f0fe63ce0aca/0210.png
It is built using 4 script, but it is expensive.
Need a single script, and that he had issued all the values at once.

Thank you in advance!



Re: script for $vm_stat

2008-12-05 Thread Gaurav Vaidya

Hi pano.irk,

On Dec 5, 2008, at 3:40 PM, [EMAIL PROTECTED] wrote:

$ vm_stat
[snip]

Like this:
$perl script.pl
Pages free:248491 Pages active: 345632 Pages inactive: 306207 Pages
wired down:146885 Translation faults: 598998500 Pages copy-on-write:
42312589 Pages zero filled: 64106 Pages reactivated:64106 Pageins:
243273 Pageouts: 84934 Object cache:15930737


You want:
vm_stat | perl -ne 'print $1:$2  if(/^\s*(.+)\s*:\s*(\d+).*$/)'

Although I'm not very sure why :-)

cheers,
Gaurav