티스토리 뷰

System Story/CentOS 5,6

vmstat 시 time 값 표시

helperchoi 2013. 11. 10. 20:46
[root@TEST01 ~]# 
[root@TEST01 ~]# 
[root@TEST01 ~]# vmstat 1 | while read imsi; do echo $(date) $imsi; done
Thu Nov 7 14:56:15 KST 2013 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
Thu Nov 7 14:56:15 KST 2013 r b swpd free buff cache si so bi bo in cs us sy id wa st
Thu Nov 7 14:56:15 KST 2013 1 0 96 76144 59940 208752 0 0 2 12 31 40 0 4 96 0 0
Thu Nov 7 14:56:16 KST 2013 0 0 96 76020 59948 208808 0 0 60 0 1031 74 0 2 95 3 0
Thu Nov 7 14:56:17 KST 2013 0 0 96 76020 59948 208808 0 0 0 0 1005 30 0 1 99 0 0
Thu Nov 7 14:56:18 KST 2013 0 0 96 76020 59948 208808 0 0 0 0 929 64 0 10 90 0 0

[root@TEST01 ~]# 
[root@TEST01 ~]# vmstat 1 | while read imsi; do echo $(date) $imsi; done | tee -a vmstat.`date +'%Y%m%d'`.log | awk '{print $4, $7, $10, $21}'
14:56:24 procs -----io---- 
14:56:24 r free id
14:56:24 2 75616 96
14:56:25 0 75440 90
14:56:26 0 75440 99
14:56:27 0 75440 100

[root@TEST01 ~]# 
[root@TEST01 ~]# vmstat 1 | while read imsi; do echo $(date +'%Y%m%d%H%M%S') $imsi; done
20131107145634 procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
20131107145634 r b swpd free buff cache si so bi bo in cs us sy id wa st
20131107145634 1 0 96 75960 59964 208836 0 0 2 12 31 40 0 4 96 0 0
20131107145635 0 0 96 75960 59964 208836 0 0 0 0 990 47 0 2 98 0 0
20131107145636 0 0 96 75960 59964 208836 0 0 0 0 1024 44 1 0 99 0 0

[root@TEST01 ~]# 
반응형
반응형
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday