Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Queries network statistics for link layer on MacOS.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
SystemInfo | 10.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ❌ No |
Parameter | Description | Example |
---|---|---|
Name | The name of the interface to query. Can be empty for array of all interfaces. Pass "sum" to sum up all counters. |
"en0" |
Returns JSON or error.
Baudrate | The linespeed. |
Collisions | The number of collisions on csma interfaces. |
InputBytes | Total number of octets received. |
InputErrors | The number of input errors on interface. |
InputMulticasts | The number of packets received via multicast. |
InputPackets | The number of packets received. |
MTU | The maximum transmission unit. |
Name | The name of the interface. |
OutputBytes | Total number of octets sent. |
OutputErrors | The number of output errors. |
OutputMulticasts | The number of packets sent via multicast. |
OutputPackets | The number of packets sent. |
PhysicalType | The physical network type. e.g., AUI, Thinnet, 10base-T, etc |
Type | The network type. |
Query statistics for all interfaces:
MBS( "SystemInfo.NetworkStats" )
Example result:
[
{
"Name": "lo0",
"PhysicalType": 24,
"Type": 24,
"MTU": 16384,
"Baudrate": 0,
"InputPackets": 1211504,
"InputErrors": 0,
"OutputPackets": 1211504,
"OutputErrors": 0,
"Collisions": 0,
"InputBytes": 424215552,
"OutputBytes": 424215552,
"InputMulticasts": 866700,
"OutputMulticasts": 0
},
...
]
Query statistics for en0, first ethernet card:
MBS( "SystemInfo.NetworkStats"; "en0" )
Example result:
{
"Name": "en0",
"PhysicalType": 6,
"Type": 6,
"MTU": 1500,
"Baudrate": 112050000,
"InputPackets": 3349997,
"InputErrors": 0,
"OutputPackets": 9122258,
"OutputErrors": 28815,
"Collisions": 0,
"InputBytes": 2294099968,
"OutputBytes": 9673651200,
"InputMulticasts": 67811,
"OutputMulticasts": 0
}
Query sum of statistics:
MBS( "SystemInfo.NetworkStats"; "sum" )
Example result:
{
"Name": "sum",
"InputPackets": 3393156,
"InputErrors": 0,
"OutputPackets": 9154972,
"OutputErrors": 29387,
"Collisions": 0,
"InputBytes": 2303736832,
"OutputBytes": 9682581504,
"InputMulticasts": 88721,
"OutputMulticasts": 0
}
This function is free to use.
Created 3th December 2019, last changed 28th January 2023