Linked Questions
16 questions linked to/from Test if remote TCP port is open from a shell script
1
vote
2
answers
9k
views
Checking remote port status in bash script [duplicate]
I need check port on the remote server in bash script before script will continue.
I search here and on the internet, but I can´t find answer which works for me.
I´m using RHEL 7.2 virtual machine so ...
0
votes
1
answer
2k
views
Testing a telnet connectivity for multiple servers from a file [duplicate]
I have a file with 10 servers (one per line) and I need to check from time to time if telnet on port 1231 is opened.
How can I do that using a bash script?
I tried to find a similar topic related to ...
0
votes
1
answer
1k
views
How to verify port connectivity between two unix hosts? [duplicate]
I am creating one bash script which can automate the process of checking the connectivity between two unix hosts. Need to check whether specific port is open from one host to other. hosts don't have ...
0
votes
1
answer
278
views
IP list specific port checker script [duplicate]
I currently searching for a code/script that will allow it to check if a specific port is open, let's say 123. Found a public script on a ftp but I don't know how and what to modify in it to suit my ...
0
votes
0
answers
77
views
bash: checking host availability over tcp [duplicate]
I would like to test in a script [Linux: CentOS 7] the availability of a remote machine. While TCP packages can blocked by a firewall on the way, ICMP packages may be possible and are not blocked by ...
214
votes
14
answers
458k
views
Efficiently test if a port is open on Linux?
From a bash script how can I quickly find out whether a port 445 is open/listening on a server.
I have tried a couple of options, but I want something quick:
1. lsof -i :445 (Takes seconds)
2. ...
9
votes
4
answers
12k
views
How to decrease TCP connect() system call timeout?
In command below I enable file /dev/tcp/10.10.10.1/80 both for reading and writing and associate it with file descriptor 3:
$ time exec 3<>/dev/tcp/10.10.10.1/80
bash: connect: Operation timed ...
4
votes
2
answers
20k
views
How to display nc return value in Linux shell script?
I am using nc command in my Linux box like below to check if a port is listening;
This displays success message:
nc -z 192.168.0.2 9000
This displays 0:
echo $?
I have combined it in a shell script ...
1
vote
2
answers
8k
views
Alternative in CentOS 7 for "nc -z"
I have a bash program that checks that a daemon in a given port is working:
nc -z localhost $port > /dev/null
if [ "$?" != "0" ]
then
echo The server on port $port is not working
exit
fi
This ...
1
vote
2
answers
4k
views
Check if a linux command outputs an empty string
I want to check if a port is being used or not. I've used the command: netstat -an | grep <port_no> | grep -i listen. When I compare its output by running, if(message_port_check.equals(null)), ...
0
votes
1
answer
6k
views
Cron job to restart network ONLY if it's down?
I've had frustrating issues with a computer whose network drops at apparently random times and as a work-around I made a simple cron job to restart it every hour. But this seems silly if the network ...
3
votes
1
answer
3k
views
Can't access node_exporter from public ip address on EC2
I am setting up prometheus/node_exporter on AWS EC2. With the following configuration
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=...
0
votes
1
answer
4k
views
Script to check connection every 5 minutes and write result to file (without ping) in LINUX
I need to check my connection to a spesific port every 5 minutes, currently i can't use ping command, so i need other alternative to do this.I want to execute this command in shell script
Can someone ...
0
votes
2
answers
1k
views
How to check if a connection can be made to a port in bash
I would like to check if I can connect to a port or not from within a bash script
Based on the answer to a similar question I tried running
nc -zvw10 <host> <port>
and check if the status ...
0
votes
2
answers
686
views
Docker-Compose error with Kanban and Redis
while i installed Kanban and Redis on my Server, which OS is CentOS 7, i get some issue, which i can't make out. This is what i want to do: i want to have three docker containers -> gitlab -> redis -> ...