...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
interface NetworkDiagnostics { Promise<InterfaceTestResult>Promise<NetworkDiagnosticsResult> testInternetConnectivity() Promise<InterfaceTestResult>Promise<NetworkDiagnotsticsResult> testNetworkInterface(String interface_name) Promise<InterfaceTestResult>Promise<PingResult> ping(String host_name, PingConfig config) //< For Promise<InterfaceTestResult>BrightSign traceroute(String host_name, TraceRouteConfig config) }; interface InterfaceTestResult {internal use. Behaviour subject to change without notice. Promise<TracerouteResult> traceroute(String diagnosis; host_name, TracerouteConfig config) bool//< For BrightSign internal ok;use. Behaviour subject to change LogListwithout log;notice. }; interface LogInterfaceTestResult { String namediagnosis; Stringbool pass; String resultok; Array<String>Array<Log> infolog; }; interface PingConfigLog { longString countname; longbool intervalpass; longString timeoutresult; longArray<String> packetsizeinfo; bool ipv4; bool ipv6; }; interface TraceRouteConfig { String resolve; //< For BrightSign internal use. Behaviour subject to change without notice. }; |
Object Creation
To create a networkdiagnostics object, first load the brightsign/networkdiagnostics
module using the require()
method. Then create an instance of the networkdiagnostics class.
...
ping()
Code Block | ||
---|---|---|
| ||
Promise<InterfaceTestResult>Promise<PingResult> ping(String host_name, PingConfig config) |
Pings a device with the specified host_name
to determine if there are connection issues.
traceroute()
Code Block | ||
---|---|---|
| ||
Promise<InterfaceTestResult> traceroute(String host_name, TraceRouteConfig config) |
Performs a standard traceroute diagnostic on the specified host_name
.
InterfaceTestResult
This interface contains diagnostic results:
...
[String] name
: A description of the diagnostic[bool] pass
: A Boolean flag indicating whether the diagnostic was successful[String] result
: A description of the diagnostic result[StringList] info
: A string list containing diagnostic data
PingConfig
[long] count:
[long] interval:
[long] timeout:
[long] packetsize:
The size of the returned packet.[bool] ipv4:
Iftrue
, IPv4 is enabled on the network interface. Iffalse
, it is not.[bool] ipv6:
Iftrue
, IPv6 is enabled on the network interface. Iffalse
, it is not.
TraceRouteConfig
[String] resolve:
Example
The following script creates a networkdiagnostics instance and logs Internet diagnostic data to the console:
...