phenome_core.util.network module

check_internet()
get_host_domain(full_name)
get_local_ipaddress()

Returns local IP address of the agent.

get_local_macaddress()

Returns local MAC address of the agent.

get_mac_address(device)

Returns MAC address of the device by calling PING and using ARP table.

ping(hostname, count, ms)

Use the ping utility to attempt to reach the host. We send ‘count’ packets (‘-c xxx’) and wait ‘ms’ milliseconds (‘-i y’) between packets and timeout is 1. The function returns the return code from the ping utility. Cannot wait less than 200 milliseconds between pings.

run_command_over_ssh(object, command)
run_commands_over_ssh(object, commands)
wake_on_lan(device)

Sends a Wake-On-Lan (WOL) magic packet to a device if there is a MAC address or if a MAC can be determined by ARP