{"id":1171,"date":"2014-08-15T12:25:25","date_gmt":"2014-08-15T10:25:25","guid":{"rendered":"http:\/\/blog.rabahi.net\/?page_id=1171"},"modified":"2015-02-04T14:13:01","modified_gmt":"2015-02-04T13:13:01","slug":"diagnostic-survival-guide","status":"publish","type":"page","link":"https:\/\/blog.rabahi.net\/?page_id=1171","title":{"rendered":"Diagnostic Survival Guide"},"content":{"rendered":"<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">Contents<\/p><ul class=\"toc_list\"><li><a href=\"#Hardware\"><span class=\"toc_number toc_depth_1\">1<\/span> Hardware<\/a><ul><li><a href=\"#dstat\"><span class=\"toc_number toc_depth_2\">1.1<\/span> dstat<\/a><\/li><li><a href=\"#iotop\"><span class=\"toc_number toc_depth_2\">1.2<\/span> iotop<\/a><\/li><li><a href=\"#lshw\"><span class=\"toc_number toc_depth_2\">1.3<\/span> lshw<\/a><\/li><li><a href=\"#top\"><span class=\"toc_number toc_depth_2\">1.4<\/span> top<\/a><\/li><\/ul><\/li><li><a href=\"#Network\"><span class=\"toc_number toc_depth_1\">2<\/span> Network<\/a><ul><li><a href=\"#iftop\"><span class=\"toc_number toc_depth_2\">2.1<\/span> iftop<\/a><\/li><li><a href=\"#wireshark\"><span class=\"toc_number toc_depth_2\">2.2<\/span> wireshark<\/a><\/li><li><a href=\"#nmap\"><span class=\"toc_number toc_depth_2\">2.3<\/span> nmap<\/a><\/li><\/ul><\/li><li><a href=\"#Memory\"><span class=\"toc_number toc_depth_1\">3<\/span> Memory<\/a><ul><li><a href=\"#top-2\"><span class=\"toc_number toc_depth_2\">3.1<\/span> top<\/a><\/li><li><a href=\"#free\"><span class=\"toc_number toc_depth_2\">3.2<\/span> free<\/a><\/li><\/ul><\/li><\/ul><\/div>\n<h1><span id=\"Hardware\">Hardware<\/span><\/h1>\n<h2><span id=\"dstat\">dstat<\/span><\/h2>\n<p>Installation<\/p>\n<pre lang=\"bash\">\r\necho \"install dstat\"\r\nyum -y install dstat\r\n\r\necho \"Now let list all the aivalable plugins\"\r\ndstat --list\r\n<\/pre>\n<p>Example of use<\/p>\n<pre lang=\"bash\">\r\necho \"get cpu usage\"\r\ndstat -t --cpu --cpu24\r\n\r\necho \"get disk read\/write usage\"\r\ndstat -t --disk\r\n\r\necho \"get top process memory usage\"\r\ndstat --top-io --top-mem\r\n<\/pre>\n<h2><span id=\"iotop\">iotop<\/span><\/h2>\n<p>Disk I\/O monitoting.<\/p>\n<p>Installation<\/p>\n<pre lang=\"bash\">\r\necho \"install iotop\"\r\nyum -y install iotop\r\n<\/pre>\n<p>Example of use<\/p>\n<pre lang=\"bash\">\r\necho \"launch iotop\"\r\niotop --only\r\n<\/pre>\n<h2><span id=\"lshw\">lshw<\/span><\/h2>\n<p>Tools that list all hardware<\/p>\n<p>Installation<\/p>\n<pre lang=\"bash\">\r\necho \"install lshw\"\r\nyum -y install lshw\r\n<\/pre>\n<p>Example of use<\/p>\n<pre lang=\"bash\">\r\necho \"list everything\"\r\nlshw\r\n\r\necho \"only list network informations\"\r\nlshw -class network\r\n<\/pre>\n<h2><span id=\"top\">top<\/span><\/h2>\n<pre lang=\"bash\">\r\necho \"use this easy command :\"\r\ntop\r\n<\/pre>\n<h1><span id=\"Network\">Network<\/span><\/h1>\n<h2><span id=\"iftop\">iftop<\/span><\/h2>\n<p>It display bandwidth usage on an interface by host.<\/p>\n<p>Installation<\/p>\n<pre lang=\"bash\">\r\necho \"install iftop\"\r\nyum -y install iftop\r\n<\/pre>\n<p>Example of use<\/p>\n<pre lang=\"bash\">\r\niftop\r\n<\/pre>\n<h2><span id=\"wireshark\">wireshark<\/span><\/h2>\n<p>Dump and analyze network traffic.<\/p>\n<p>Installation<\/p>\n<pre lang=\"bash\">\r\necho \"install wireshark\"\r\nyum -y install wireshark\r\n<\/pre>\n<p>Example of use<\/p>\n<pre lang=\"bash\">\r\necho \"capture network interface ens33 for 12 hours\"\r\ntimeout 12h 'tshark -i ens33 -w \/tmp\/packets.pcap'\r\n<\/pre>\n<h2><span id=\"nmap\">nmap<\/span><\/h2>\n<p>Verifying Which Ports Are Listening<\/p>\n<p>Installation<\/p>\n<pre lang=\"bash\">\r\necho \"install nmap\"\r\nyum -y install nmap\r\n<\/pre>\n<p>Example of use<\/p>\n<pre lang=\"bash\">\r\necho \"determines which ports are listening for TCP connections from localhost\"\r\nnmap -sT -O localhost\r\n<\/pre>\n<h1><span id=\"Memory\">Memory<\/span><\/h1>\n<h2><span id=\"top-2\">top<\/span><\/h2>\n<p>Example of use<\/p>\n<pre lang=\"bash\">\r\necho \"display top\"\r\ntop\r\n<\/pre>\n<h2><span id=\"free\">free<\/span><\/h2>\n<p>Display free\/used memory<\/p>\n<p>Example of use<\/p>\n<pre lang=\"bash\">\r\necho \"display human readable\"\r\nfree -h\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Contents1 Hardware1.1 dstat1.2 iotop1.3 lshw1.4 top2 Network2.1 iftop2.2 wireshark2.3 nmap3 Memory3.1 top3.2 free Hardware dstat Installation echo &#8220;install dstat&#8221; yum -y install dstat echo &#8220;Now let list all the aivalable plugins&#8221; dstat &#8211;list Example of use echo &#8220;get cpu usage&#8221; dstat -t &#8211;cpu &#8211;cpu24 echo &#8220;get disk read\/write usage&#8221; dstat -t &#8211;disk echo &#8220;get top [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":443,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-1171","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/1171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1171"}],"version-history":[{"count":21,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/1171\/revisions"}],"predecessor-version":[{"id":1269,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/1171\/revisions\/1269"}],"up":[{"embeddable":true,"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=\/wp\/v2\/pages\/443"}],"wp:attachment":[{"href":"https:\/\/blog.rabahi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}