Community discussions

MikroTik App
 
drdoom
just joined
Topic Author
Posts: 8
Joined: Sat Apr 16, 2011 10:11 am

Script to check whether a destination port is open

Tue May 15, 2012 12:03 am

Hello,

I have a mikrotik with running web proxy which is setup with a parent proxy.
Also, I have setup netwatch to check the availablity of the parent proxy and to update the configuration of my web proxy to another parent if the current parent is not available.
The problem is that netwatch checks whether the parent proxy's IP address is reachible, but it is not aware whether the port of the parent proxy is open.
In this case even if the device where the parent proxy is running is reachible, but the parent proxy itself is down, netwatch will not do a fail-over to another parent proxy.

Is it there a way I can check whether the port on which is listening the parent proxy is available?
Basically I need to check whether a destination port is open, something similar to "telnet 192.168.1.1 8080".


Thank you.
 
Devil
Member Candidate
Member Candidate
Posts: 170
Joined: Thu Jul 21, 2011 9:13 am

Re: Script to check whether a destination port is open

Sun Jun 03, 2012 1:40 pm

Someone might have a better idea, but you could probably use fetch tool to test whether you could access to a website through a proxy or not, this is an example:
/tool fetch address=187.115.172.82 port=8181 host=www.mikrotik.com src-path=/resources.html mode=http
the address/port specified, is an active open proxy server at the time of writing. basically, by doing that, you are making the fetch command to request the page through that proxy. if the proxy fails, the fetch command should fail too.
Also, take a look at this thread: http://forum.mikrotik.com/viewtopic.php?f=9&t=56396
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: Script to check whether a destination port is open

Mon Jun 04, 2012 2:20 am

 
nagylzs
Member
Member
Posts: 354
Joined: Sun May 26, 2019 2:08 pm

Re: Script to check whether a destination port is open

Mon Jul 08, 2019 4:38 pm

Sorry for being a necromancer. I also need to test if a port is open. But I cannot use fetch, because this is not http, https or ftp protocol. The fetch tool can only use these protocols. Is there way tell if a port is open in general? (I need to test TCP 6055 and UDP 6055 in particular, and I know nothing about the protocol above layer 3)
 
NoahMVM
just joined
Posts: 4
Joined: Mon Feb 12, 2024 12:18 pm

Re: Script to check whether a destination port is open

Mon Feb 19, 2024 10:21 am

does someone know how to solve this issue ?

Who is online

Users browsing this forum: No registered users and 18 guests