how to redirect vmstat -p output

how to redirect vmstat -p output

Post by lguo.. » Sat, 14 Jan 2006 05:58:04



Hi all,

I need to redirect "vmstat -p" output to a file, but could not figure
out how to. Without the argument "-p", the output redirect works. I
tried:

vmstat -p 5 > vmstat-p.out

But nothing is written to the file.

Any helps would be appreciated.

Limin.

 
 
 

how to redirect vmstat -p output

Post by Thommy M » Sat, 14 Jan 2006 06:13:13


Works OK for me. On x86 Nevada_27 that is. What's your config?

 
 
 

how to redirect vmstat -p output

Post by lguo.. » Sat, 14 Jan 2006 06:19:11


Oops, sorry, Solaris8 on Sunfire 6800.

> Works OK for me. On x86 Nevada_27 that is. What's your config?

 
 
 

how to redirect vmstat -p output

Post by Darren Dunha » Sat, 14 Jan 2006 06:20:34



> Hi all,
> I need to redirect "vmstat -p" output to a file, but could not figure
> out how to. Without the argument "-p", the output redirect works. I
> tried:
> vmstat -p 5 > vmstat-p.out
> But nothing is written to the file.

I can't reproduce your issue.

$ vmstat -p 5 > vmstat-p.out &
[1] 1854
$ tail -f vmstat-p.out
     memory           page          executable      anonymous      filesystem
   swap  free  re  mf  fr  de  sr  epi  epo  epf  api  apo  apf  fpi  fpo  fpf
 12840792 4976872 38 113 1  0   0    0    0    0    0    0    0  151    1    1
 12144136 3977608 1 14  0   0   0    0    0    0    0    0    0    0    0    0
 12144040 3977536 0 0   0   0   0    0    0    0    0    0    0    0    0    0
 12144040 3977536 0 0   0   0   0    0    0    0    0    0    0    0    0    0
^C

--

Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >

 
 
 

how to redirect vmstat -p output

Post by Dave Uhrin » Sat, 14 Jan 2006 06:23:41



> I need to redirect "vmstat -p" output to a file, but could not figure
> out how to. Without the argument "-p", the output redirect works. I
> tried:

> vmstat -p 5 > vmstat-p.out

> But nothing is written to the file.

Because you have redirected only STDERR.

Quote:> Any helps would be appreciated.

[~]$ vmstat -p 5 > vmstat-p.out 2>&1
^C
[~]$ cat vmstat-p.out
     memory           page          executable      anonymous      filesystem
   swap  free  re  mf  fr  de  sr  epi  epo  epf  api  apo  apf  fpi  fpo  fpf
 1361344 593192 0   7   2   0   0    0    0    0    0    0    0    0    2    2
 1333728 562696 2   5   0   0   0    0    0    0    0    0    0    6    0    0
[~]$
 
 
 

how to redirect vmstat -p output

Post by lguo.. » Sat, 14 Jan 2006 06:33:38


Thank you all for quick response. I should have tried this on another
solaris machine before I posted it here in the group. I apologize for
it.

vmstat -p 5 > vmstat-p.out &  did not have any problems on another
three Solaris 8 boxes I just tried.

The machine where I had trouble with using older Solaris8 update, it
must be a bug causing the problem. here is the output of /etc/release
on the troubled box:
                        Solaris 8 7/01 s28s_u5wos_08 SPARC
           Copyright 2001 Sun Microsystems, Inc.  All Rights Reserved.
                             Assembled 06 June 2001

The other three machines are all using Solaris 8 2/04.

Again, thank you for your helps.

Limin.

 
 
 

1. vmstat | sed WORKS vmstat | logger WORKS vmstat | sed | logger FAILS

I am using FreeBSD 3.3.  The following two pipes work fine:

vmstat -w 5 | logger -p local0.info
vmstat -w 5 | sed -e /procs/d -e /fre/d

But don't work when combined into:

vmstat -w 5 | sed -e /procs/d -e /fre/d | logger -p local0.info

I don't understand why.  Any suggestions?

2. Finding one's IP address.

3. vmstat | sed WORKS vmstat | logger WORKS vmstat | sed | logger FAILS - NEED HELP

4. HELP PPPD AND GATEWAY

5. vmstat output: buffers - what are they?

6. Netscape 4.51 --> Bus error !!!

7. vmstat output ?

8. resource for ifup-eth script?

9. vmstat output

10. <<State change>> in vmstat output

11. Q: HP-UX vmstat output

12. Decrypting vmstat output

13. help w/ vmstat PO, SR, and idle output interpretation requested