Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
python_wiki:test_port [2014/11/20 19:34] 127.0.0.1 external edit |
python_wiki:test_port [2014/11/24 22:43] billdozor |
||
---|---|---|---|
Line 2: | Line 2: | ||
Function to check a network port to see if it is open on a host. | Function to check a network port to see if it is open on a host. | ||
- | < | + | < |
import socket | import socket | ||
Line 19: | Line 19: | ||
Call this function, checking server1 for tcp/22 (ssh): | Call this function, checking server1 for tcp/22 (ssh): | ||
- | < | + | < |
if test_port(server1, | if test_port(server1, | ||
do ssh stuff | do ssh stuff |