Lines 1-4
Link Here
|
1 |
#!/usr/bin/python |
1 |
#!/usr/bin/python2 |
2 |
# |
2 |
# |
3 |
# Copyright (C) 2012 Paul Wouters <pwouters@redhat.com> |
3 |
# Copyright (C) 2012 Paul Wouters <pwouters@redhat.com> |
4 |
# |
4 |
# |
Lines 237-243
Link Here
|
237 |
|
237 |
|
238 |
def cmdchecks(): |
238 |
def cmdchecks(): |
239 |
printfun("Checking 'ip' command") |
239 |
printfun("Checking 'ip' command") |
240 |
if not os.path.isfile("/sbin/ip") and not os.path.isfile("/usr/sbin/ip"): |
240 |
if not os.path.isfile("/bin/ip") and not os.path.isfile("/usr/bin/ip"): |
241 |
print_result("FAIL","FAILED") |
241 |
print_result("FAIL","FAILED") |
242 |
p = subprocess.Popen(["ip", "xfrm"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
242 |
p = subprocess.Popen(["ip", "xfrm"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
243 |
output, err = p.communicate() |
243 |
output, err = p.communicate() |
Lines 255-261
Link Here
|
255 |
def udp500check(): |
255 |
def udp500check(): |
256 |
printfun(" Pluto listening for IKE on udp 500") |
256 |
printfun(" Pluto listening for IKE on udp 500") |
257 |
if 1==1: |
257 |
if 1==1: |
258 |
p = subprocess.Popen(["/usr/sbin/ss", "-n", "-l", "-u", "sport = :500"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
258 |
p = subprocess.Popen(["/sbin/ss", "-n", "-l", "-u", "sport = :500"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
259 |
output, err = p.communicate() |
259 |
output, err = p.communicate() |
260 |
if ":500" in output: |
260 |
if ":500" in output: |
261 |
print_result("OK","OK") |
261 |
print_result("OK","OK") |
Lines 270-276
Link Here
|
270 |
def tcp500check(): |
270 |
def tcp500check(): |
271 |
printfun(" Pluto listening for IKE on tcp 500") |
271 |
printfun(" Pluto listening for IKE on tcp 500") |
272 |
try: |
272 |
try: |
273 |
p = subprocess.Popen(["/usr/sbin/ss", "-n", "-l", "-t", "sport = :500"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
273 |
p = subprocess.Popen(["/sbin/ss", "-n", "-l", "-t", "sport = :500"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
274 |
output, err = p.communicate() |
274 |
output, err = p.communicate() |
275 |
if ":500" in output: |
275 |
if ":500" in output: |
276 |
print_result("OK","OK") |
276 |
print_result("OK","OK") |
Lines 282-288
Link Here
|
282 |
def udp4500check(): |
282 |
def udp4500check(): |
283 |
printfun(" Pluto listening for IKE/NAT-T on udp 4500") |
283 |
printfun(" Pluto listening for IKE/NAT-T on udp 4500") |
284 |
try: |
284 |
try: |
285 |
p = subprocess.Popen(["/usr/sbin/ss", "-n", "-l", "-u", "sport = :4500"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
285 |
p = subprocess.Popen(["/sbin/ss", "-n", "-l", "-u", "sport = :4500"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
286 |
output, err = p.communicate() |
286 |
output, err = p.communicate() |
287 |
if ":4500" in output: |
287 |
if ":4500" in output: |
288 |
print_result("OK","OK") |
288 |
print_result("OK","OK") |
Lines 295-301
Link Here
|
295 |
def tcp4500check(): |
295 |
def tcp4500check(): |
296 |
printfun(" Pluto listening for IKE/NAT-T on tcp 4500") |
296 |
printfun(" Pluto listening for IKE/NAT-T on tcp 4500") |
297 |
try: |
297 |
try: |
298 |
p = subprocess.Popen(["/usr/sbin/ss", "-n", "-l", "-t", "sport = :4500"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
298 |
p = subprocess.Popen(["/sbin/ss", "-n", "-l", "-t", "sport = :4500"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
299 |
output, err = p.communicate() |
299 |
output, err = p.communicate() |
300 |
if ":4500" in output: |
300 |
if ":4500" in output: |
301 |
print_result("OK","OK") |
301 |
print_result("OK","OK") |
Lines 308-314
Link Here
|
308 |
def tcp10000check(): |
308 |
def tcp10000check(): |
309 |
printfun(" Pluto listening for IKE on tcp 10000 (cisco)") |
309 |
printfun(" Pluto listening for IKE on tcp 10000 (cisco)") |
310 |
try: |
310 |
try: |
311 |
p = subprocess.Popen(["/usr/sbin/ss", "-n", "-l", "-t", "sport = :10000"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
311 |
p = subprocess.Popen(["/sbin/ss", "-n", "-l", "-t", "sport = :10000"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
312 |
output, err = p.communicate() |
312 |
output, err = p.communicate() |
313 |
if ":10000" in output: |
313 |
if ":10000" in output: |
314 |
print_result("OK","OK") |
314 |
print_result("OK","OK") |