{"id":2977,"date":"2016-02-24T19:24:56","date_gmt":"2016-02-24T19:24:56","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=2977"},"modified":"2016-02-24T19:24:56","modified_gmt":"2016-02-24T19:24:56","slug":"checking-server-utilization","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2016\/02\/24\/checking-server-utilization\/","title":{"rendered":"Checking Server Utilization"},"content":{"rendered":"<p>Shell Scrip for Checking Server Utilization<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#!\/bin\/bash\n    date;\n    echo &quot;uptime:&quot;\n    uptime\n    echo &quot;Currently connected:&quot;\n    w\n    echo &quot;--------------------&quot;\n    echo &quot;Last logins:&quot;\n    last -a |head -3\n    echo &quot;--------------------&quot;\n    echo &quot;Disk and memory usage:&quot;\n    df -h | xargs | awk &#039;{print &quot;Free\/total disk: &quot; $11 &quot; \/ &quot; $9}&#039;\n    free -m | xargs | awk &#039;{print &quot;Free\/total memory: &quot; $17 &quot; \/ &quot; $8 &quot; MB&quot;}&#039;\n    echo &quot;--------------------&quot;\n    start_log=`head -1 \/var\/log\/messages |cut -c 1-12`\n    oom=`grep -ci kill \/var\/log\/messages`\n    echo -n &quot;OOM errors since $start_log :&quot; $oom\n    echo &quot;&quot;\n    echo &quot;--------------------&quot;\n    echo &quot;Utilization and most expensive processes:&quot;\n    top -b |head -3\n    echo\n\ttop -b |head -10 |tail -4\n    echo &quot;--------------------&quot;\n    echo &quot;Open TCP ports:&quot;\n    nmap -p- -T4 127.0.0.1\n    echo &quot;--------------------&quot;\n    echo &quot;Current connections:&quot;\n    ss -s\n    echo &quot;--------------------&quot;\n    echo &quot;processes:&quot;\n    ps auxf --width=200\n    echo &quot;--------------------&quot;\n    echo &quot;vmstat:&quot;\n    vmstat 1 5\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Shell Scrip for Checking Server Utilization #!\/bin\/bash date; echo &quot;uptime:&quot; uptime echo &quot;Currently connected:&quot; w echo &quot;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&quot; echo &quot;Last logins:&quot; last -a |head -3 echo &quot;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;&quot; echo &quot;Disk and memory usage:&quot; df -h | xargs | awk &#039;{print &quot;Free\/total disk: &quot; $11 &quot; \/ &quot; $9}&#039; free -m | xargs | awk &#039;{print &quot;Free\/total memory: &#8230; <a title=\"Checking Server Utilization\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2016\/02\/24\/checking-server-utilization\/\" aria-label=\"Read more about Checking Server Utilization\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[],"class_list":["post-2977","post","type-post","status-publish","format-standard","hentry","category-shell-scripts"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2977","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=2977"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2977\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=2977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=2977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=2977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}