{"id":1179,"date":"2025-05-22T14:25:55","date_gmt":"2025-05-22T13:25:55","guid":{"rendered":"https:\/\/monkey.ploogie.co.uk\/?page_id=1179"},"modified":"2025-05-22T14:33:34","modified_gmt":"2025-05-22T13:33:34","slug":"mwnci-nettrans-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-nettrans-function\/","title":{"rendered":"Mwnci nettrans() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>nettrans<strong>(<em>string<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>nettrans()<\/i> function returns a hash of all network interfaces and statistics.  If an interface is given as an argument, only the information for that interface is returned. The hash is keyed on the interface name.<\/p>\n<h2>Example<\/h2>\n<pre>include(\"net\")\r\nprintln(nettrans(), \"\\n\")\r\nprintln(nettrans(\"eth0\"))\r\n\r\n\r\n{\"lo\": {\"RX-OK\": \"184\", \"RX-ERR\": \"0\", \"RX-DRP\": \"0\", \"TX-OK\": \"184\", \"TX-ERR\": \"0\", \"TX-DRP\": \"0\"}, \"eth0\": {\"TX-DRP\": \"0\", \"RX-OK\": \"1138130\", \"RX-ERR\": \"0\", \"RX-DRP\": \"0\", \"TX-OK\": \"344223\", \"TX-ERR\": \"0\"}, \"wlan0\": {\"TX-DRP\": \"0\", \"RX-OK\": \"0\", \"RX-ERR\": \"0\", \"RX-DRP\": \"0\", \"TX-OK\": \"0\", \"TX-ERR\": \"0\"}}\r\n\r\n{\"RX-OK\": \"1138304\", \"RX-ERR\": \"0\", \"RX-DRP\": \"0\", \"TX-OK\": \"344370\", \"TX-ERR\": \"0\", \"TX-DRP\": \"0\"}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax nettrans(string) Description The nettrans() function returns a hash of all network interfaces and statistics. If an interface is given as an argument, only the information for that interface is returned. The hash is keyed on the interface name. Example include(&#8220;net&#8221;) println(nettrans(), &#8220;\\n&#8221;) println(nettrans(&#8220;eth0&#8221;)) {&#8220;lo&#8221;: {&#8220;RX-OK&#8221;: &#8220;184&#8221;, &#8220;RX-ERR&#8221;: &#8220;0&#8221;, &#8220;RX-DRP&#8221;: &#8220;0&#8221;, &#8220;TX-OK&#8221;: &#8220;184&#8221;, &#8220;TX-ERR&#8221;: &#8220;0&#8221;, &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-nettrans-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci nettrans() 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-1179","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1179","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=1179"}],"version-history":[{"count":3,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1179\/revisions"}],"predecessor-version":[{"id":1182,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1179\/revisions\/1182"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}