04-08-2021 11:20 AM
Hi,
Is there a way to check if a specific service or port (for example port 80) is available?
Regards,
José Chaves
Solved! Go to Solution.
04-09-2021 07:28 AM
Hello Jose,
there is no built-in function to check any devices in the network for open ports.
But you can easily build this with a script or workflow. Below is a small example. The script is direct executable in XMC. If you want to generate alarms/emails etc. depending on the result, you can do that with the alarms.
import subprocess
out = subprocess.Popen(['nc', '-zv', '-w 10', '10.10.10.10', '80'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout = out.communicate()
print(stdout)
if stdout.find('succeeded!') != -1:
print ("Port is open")
elif stdout.find('timed out:') != -1:
print ("Device not reachable")
else:
print ("Port is not open")
04-09-2021 07:28 AM
Hello Jose,
there is no built-in function to check any devices in the network for open ports.
But you can easily build this with a script or workflow. Below is a small example. The script is direct executable in XMC. If you want to generate alarms/emails etc. depending on the result, you can do that with the alarms.
import subprocess
out = subprocess.Popen(['nc', '-zv', '-w 10', '10.10.10.10', '80'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout = out.communicate()
print(stdout)
if stdout.find('succeeded!') != -1:
print ("Port is open")
elif stdout.find('timed out:') != -1:
print ("Device not reachable")
else:
print ("Port is not open")
04-08-2021 11:54 AM
I think, he will do a active check for a range of devices.
I think you can do this with the governance / compliance engine of XMC
04-08-2021 11:31 AM
Here is the link which can show you all the ports that you are looking for, i belive port 80 is there already:
https://emc.extremenetworks.com/content/oneview/r_used_ports.html