cancel
Showing results for 
Search instead for 
Did you mean: 

check if device service available

check if device service available

Jose_Chaves
New Contributor II

Hi,

 

Is there a way to check if a specific service or port (for example port 80) is available?

 

Regards,

José Chaves

1 ACCEPTED SOLUTION

StephanH
Valued Contributor III

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")

 

Regards Stephan

View solution in original post

3 REPLIES 3

StephanH
Valued Contributor III

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")

 

Regards Stephan

PeterK
Contributor III

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

thalabi
New Contributor II

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

 

 

GTM-P2G8KFN