본문 바로가기 메뉴 바로가기

blog.helperchoi.com

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

blog.helperchoi.com

검색하기 폼
  • 블로그 전체보기 (180)
    • System Story (145)
      • CentOS 5,6 (104)
      • CentOS 7 (15)
      • Ubuntu (4)
      • Suse Linux (0)
      • Windows (5)
      • Database (7)
      • Ansible (0)
      • Python3 (3)
      • Perl (0)
      • Go Language (0)
      • Project (1)
      • ETC (1)
      • Youtube - Tip4Linux (5)
    • Cloud Story (10)
      • Cloud Stack (6)
      • Open Stack (1)
      • Vmware vSphere (0)
      • KVM (0)
      • Xen Server (1)
      • Type2 Hypervisor (2)
    • Life Story (25)
      • 소소한 이야기 (8)
      • 담는 법 (3)
      • Review (8)
      • 꽁치네집 (5)
      • 6x6 (1)
  • 방명록

memory sum (1)
Shell - 특정 프로세스 수와 메모리 사용량 합을 구하고 엑셀용 RAW데이터로 활용

※ postgresql 프로세스 예시 #!/bin/bash #postgre_mem.sh MEMSUM=0 PROC_COUNT=`ps -ef | grep -v "grep" | grep "postgre" | wc -l` LIST_FILE=`ps -ef | grep -v "grep" | grep "postgre" | awk '{print $2}' | while read PID; do cat /proc/$PID/status | egrep 'VmRSS' | awk '{print $2'} ; done` for LIST in ${LIST_FILE}; do MEMSUM=`expr $MEMSUM + $LIST` done echo -e "PostgreSQL Process is ${PROC_COUNT} \t/ Memory i..

System Story/CentOS 5,6 2013. 11. 10. 20:43
이전 1 다음
이전 다음
반응형
공지사항
  • ::::::: 이 블로그는? :::::::
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory

티스토리툴바