{"id":576,"date":"2011-01-28T00:30:38","date_gmt":"2011-12-30T21:51:50","guid":{"rendered":"http:\/\/kraftek.com\/blog\/stats-script-based-on-top-for-solaris\/"},"modified":"2011-01-28T00:30:38","modified_gmt":"2011-12-30T21:51:50","slug":"stats-script-based-on-top-for-solaris","status":"publish","type":"post","link":"\/blog\/index.php\/stats-script-based-on-top-for-solaris\/","title":{"rendered":"Stats script based on top for Solaris"},"content":{"rendered":"<p>you can do this<br \/>\n(date &#8220;+%d %m %H %M %S %Y&#8221;<br \/>\n\/usr\/local\/bin\/top -b | head -4) &gt;&gt; \/tmp\/top.txt<br \/>\nThen parse and collect:<br \/>\necho &#8220;date,time,loadavg1,loadavg5,loadavg10,processes,sleeping processes,on cpu,cpu idle,cpu user,cpu<br \/>\nkernel,cpu iowait,swap,memory,free mem,total swap,free swap&#8221;<br \/>\ncat \/tmp\/top.txt |nawk &#8216;ORS=NR%5?&#8221; &#8220;:&#8221;n&#8221;&#8216; | tr -d &#8216;[:alpha:]&#8217;| sed &#8216;s\/;\/\/g;s\/:\/ \/g;s\/,\/\/g&#8217; | awk &#8216;{ print<br \/>\n$1&#8243;\/&#8221;$2&#8243;\/&#8221;$6&#8243;,&#8221;$3&#8243;:&#8221;$4&#8243;:&#8221;$5&#8243;,&#8221;$8&#8243;,&#8221;$9&#8243;,&#8221;$10&#8243;,&#8221;$17&#8243;,&#8221;$18&#8243;,&#8221;$19&#8243;,&#8221;$20&#8243;,&#8221;$21&#8243;,&#8221;$22&#8243;,&#8221;$23&#8243;,&#8221;$24&#8243;,&#8221;$25&#8243;,&#8221;$26&#8243;,&#8221;$27&#8221;,&#8221;$28<br \/>\n}&#8217;<br \/>\nthis builds a csv you can import in a spreadsheet<br \/>\n7\/433<\/p>\n","protected":false},"excerpt":{"rendered":"<p>you can do this (date &#8220;+%d %m %H %M %S %Y&#8221; \/usr\/local\/bin\/top -b | head -4) &gt;&gt; \/tmp\/top.txt Then parse and collect: echo &#8220;date,time,loadavg1,loadavg5,loadavg10,processes,sleeping processes,on cpu,cpu idle,cpu user,cpu kernel,cpu iowait,swap,memory,free mem,total swap,free swap&#8221; cat \/tmp\/top.txt |nawk &#8216;ORS=NR%5?&#8221; &#8220;:&#8221;n&#8221;&#8216; | tr -d &#8216;[:alpha:]&#8217;| sed &#8216;s\/;\/\/g;s\/:\/ \/g;s\/,\/\/g&#8217; | awk &#8216;{ print $1&#8243;\/&#8221;$2&#8243;\/&#8221;$6&#8243;,&#8221;$3&#8243;:&#8221;$4&#8243;:&#8221;$5&#8243;,&#8221;$8&#8243;,&#8221;$9&#8243;,&#8221;$10&#8243;,&#8221;$17&#8243;,&#8221;$18&#8243;,&#8221;$19&#8243;,&#8221;$20&#8243;,&#8221;$21&#8243;,&#8221;$22&#8243;,&#8221;$23&#8243;,&#8221;$24&#8243;,&#8221;$25&#8243;,&#8221;$26&#8243;,&#8221;$27&#8221;,&#8221;$28 }&#8217; this builds a csv [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-576","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=576"}],"version-history":[{"count":0,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/576\/revisions"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=576"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}