{"id":3448,"date":"2014-08-09T14:16:10","date_gmt":"2014-08-09T06:16:10","guid":{"rendered":"http:\/\/rmohan.com\/?p=3448"},"modified":"2014-08-09T15:09:49","modified_gmt":"2014-08-09T07:09:49","slug":"shell-to-get-the-process-usage-in-mb","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=3448","title":{"rendered":"shell to get the process usage in MB"},"content":{"rendered":"<p>#!\/bin\/bash<br \/>\nps -A -o pid,rss,command | grep nginx | grep -v grep | awk &#8216;{total+=$2}END{printf(&#8220;nginx=%dMb\\n&#8221;, total\/1024)}&#8217;<br \/>\nps -A -o pid,rss,command | grep php-fpm | grep -v grep | awk &#8216;{total+=$2}END{printf(&#8220;php-fpm=%dMb\\n&#8221;, total\/1024)}&#8217;<br \/>\nps -A -o pid,rss,command | grep mysqld | grep -v grep | awk &#8216;{total+=$2}END{printf(&#8220;mysql=%dMb\\n&#8221;, total\/1024)}&#8217;<br \/>\nps -A -o pid,rss,command | grep transmission-da | grep -v grep | awk &#8216;{total+=$2}END{printf(&#8220;transmission=%dMb\\n&#8221;, total\/1024)}&#8217;<br \/>\nps -A -o pid,rss,command | grep fail2ban | grep -v grep | awk &#8216;{total+=$2}END{printf(&#8220;fail2ban=%dMb\\n&#8221;, total\/1024)}&#8217;<br \/>\nps -A -o pid,rss,command | grep sshd | grep -v grep | awk &#8216;{total+=$2}END{printf(&#8220;sshd=%dMb\\n&#8221;, total\/1024)}&#8217;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/bash ps -A -o pid,rss,command | grep nginx | grep -v grep | awk &#8216;{total+=$2}END{printf(&#8220;nginx=%dMb\\n&#8221;, total\/1024)}&#8217; ps -A -o pid,rss,command | grep php-fpm | grep -v grep | awk &#8216;{total+=$2}END{printf(&#8220;php-fpm=%dMb\\n&#8221;, total\/1024)}&#8217; ps -A -o pid,rss,command | grep mysqld | grep -v grep | awk &#8216;{total+=$2}END{printf(&#8220;mysql=%dMb\\n&#8221;, total\/1024)}&#8217; ps -A -o pid,rss,command | grep transmission-da | grep [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3448"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3448"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3448\/revisions"}],"predecessor-version":[{"id":3449,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3448\/revisions\/3449"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}