Mwnci nettrans() Function

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("net")
println(nettrans(), "\n")
println(nettrans("eth0"))


{"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"}}

{"RX-OK": "1138304", "RX-ERR": "0", "RX-DRP": "0", "TX-OK": "344370", "TX-ERR": "0", "TX-DRP": "0"}