{"id":1173,"date":"2025-05-21T13:48:53","date_gmt":"2025-05-21T12:48:53","guid":{"rendered":"https:\/\/monkey.ploogie.co.uk\/?page_id=1173"},"modified":"2025-05-21T13:53:23","modified_gmt":"2025-05-21T12:53:23","slug":"mwnci-netstat-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-netstat-function\/","title":{"rendered":"Mwnci netstat() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>netstat<strong>()<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>netstat()<\/i> function returns an array containing arrays of the current connections to\/from the network. The data is similar to the output from the command-line <em>netstat<\/em> application.<\/p>\n<h2>Example<\/h2>\n<pre>include(\"net\")\r\nforeach Entry in netstat() {\r\n    println(Entry)\r\n}\r\n\r\n\r\n[\"tcp\", \"127.0.0.1:6010\", \"0.0.0.0:*\", \"LISTEN\"]\r\n[\"tcp\", \"192.168.0.136:25\", \"0.0.0.0:*\", \"LISTEN\"]\r\n[\"tcp\", \"127.0.0.1:631\", \"0.0.0.0:*\", \"LISTEN\"]\r\n[\"tcp\", \"0.0.0.0:22\", \"0.0.0.0:*\", \"LISTEN\"]\r\n[\"tcp\", \"192.168.0.136:53974\", \"192.168.0.240:22\", \"ESTABLISHED\"]\r\n[\"tcp\", \"192.168.0.136:22\", \"192.168.0.240:57496\", \"ESTABLISHED\"]\r\n[\"tcp6\", \"::1:631\", \":::*\", \"LISTEN\"]\r\n[\"tcp6\", \":::7890\", \":::*\", \"LISTEN\"]\r\n[\"tcp6\", \"::1:6010\", \":::*\", \"LISTEN\"]\r\n[\"tcp6\", \":::22\", \":::*\", \"LISTEN\"]\r\n[\"udp\", \"0.0.0.0:5353\", \"0.0.0.0:*\", \"\"]\r\n[\"udp\", \"0.0.0.0:54691\", \"0.0.0.0:*\", \"\"]\r\n[\"udp6\", \":::5353\", \":::*\", \"\"]\r\n[\"udp6\", \":::60791\", \":::*\", \"\"]\r\n[\"raw6\", \":::58\", \":::*\", \"\"]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax netstat() Description The netstat() function returns an array containing arrays of the current connections to\/from the network. The data is similar to the output from the command-line netstat application. Example include(&#8220;net&#8221;) foreach Entry in netstat() { println(Entry) } [&#8220;tcp&#8221;, &#8220;127.0.0.1:6010&#8221;, &#8220;0.0.0.0:*&#8221;, &#8220;LISTEN&#8221;] [&#8220;tcp&#8221;, &#8220;192.168.0.136:25&#8221;, &#8220;0.0.0.0:*&#8221;, &#8220;LISTEN&#8221;] [&#8220;tcp&#8221;, &#8220;127.0.0.1:631&#8221;, &#8220;0.0.0.0:*&#8221;, &#8220;LISTEN&#8221;] [&#8220;tcp&#8221;, &#8220;0.0.0.0:22&#8221;, &#8220;0.0.0.0:*&#8221;, &#8220;LISTEN&#8221;] &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-netstat-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci netstat() Function&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1173","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1173"}],"version-history":[{"count":3,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1173\/revisions"}],"predecessor-version":[{"id":1176,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1173\/revisions\/1176"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}