start_scan_network()
- Scan network for existing devices.
Edit
Edit
fields | type | description |
---|---|---|
script | string | The path to handle script. Example: “HUB:zwave/scripts/handle_network_scan_results”. The every since result comes to this script as argument. |
ip_addresses | string | The list format is set of ip addresses are separated by comma. Example: “192.168.0.0, 192.168.0.1, 192.168.122.1, 192.168.0.34”. The range format are two ip addresses are separated by hyphen. Example: “192.168.0.0 – 192.168.122.9” |
ip_version | string | The two possible values are “ip4” and “ip6” |
ports | intArray | [opt] The array of ports what should be scanned. |
Edit
scan_id (int)
Edit
fields | type | description |
---|---|---|
event | string | The name of this module “network” |
data | table | The result of scanning. |
Edit
fields | type | description |
---|---|---|
scan_id | int | The Id of scanning. |
status | string | The status of scanning. The possible tokens: , , . |
ip_address | string | [opt] The IP address of device |
mac | string | [opt] The MAC address of device |
host_name | string | [opt] The host name of device |
ports | intArray | [opt] The array of open ports. |
Edit
require "network"
local ip_list = "192.168.0.0, 192.168.0.1, 192.168.122.1, 192.168.0.34"
local ip_range = "192.168.0.0 - 192.168.122.9"
local ports = { 2020, 30, 8080 }
local handle_results = "HUB:zwave/scripts/handle_network_scan_results"
local scan_id1 = network.start_scan_network( ip_list, "IPv4", handle_results )
local scan_id2 = network.start_scan_network( ip_range, "IPv4", handle_results, ports )
network.stop_scan_network( scan_id1 )
network.stop_scan_network( scan_id2 )