Check the URL is alive or dead with port number


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Check the URL is alive or dead with port number
# 1  
Old 03-23-2012
Check the URL is alive or dead with port number

Hi,
I am running certain weblogic instance, in which it's hard to find which instance is stopped or running after stopping the weblogic , cause process status is for all the instance is same.
A URL which shows the instance is stopped or running.
But i have major challenge to check it through unix, cause it's having the port number and ping is not supporting it.
HTML Code:
ping -c4 my_url.com port_no
is not working for me.
Any other command does do the same job to check .

Thanks
# 2  
Old 03-23-2012
ping is ICMP, not related at all to ordinary TCP network connections.

Since it's a URL, try wget:

Code:
if wget -q http://server:port -O /dev/null
then
        echo "server:port is alive"
else
        echo "server:port is dead"
fi

# 3  
Old 03-28-2012
Correct.
Or use --spider with wget:
Code:
       --spider
           When invoked with this option, Wget will behave as a Web spider, which means that it will not download the pages, just check that they are there.

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

2. Ubuntu

How to authorisation resctricted access to public_ip:port/extension url in Ubuntu?

Hello, I am dealing with live video streaming server and have no problem with video quality. The main issue is that I am unable to restrict access to related address. Apache2 is installed into system. My objective is to make it "authorisation restricted access". There should be a username :... (3 Replies)
Discussion started by: baris35
3 Replies

3. Shell Programming and Scripting

Url Check for a keyword.

thanks (0 Replies)
Discussion started by: kata33
0 Replies

4. Shell Programming and Scripting

ksh to check url

I have a server that keeps going down (503 Service not available). Until we find out the problem I would like to setup a simple ksh script in cron that will query url and report the status code. This way we can get someone to restart the process. Does anyone know a simple command I can call... (5 Replies)
Discussion started by: oldman2
5 Replies

5. Shell Programming and Scripting

wget to check an URL

I all, I wrote an script which starts a Weblogic server and waits until its loaded to deploy several apps. The way I checked was something like: while ; do wget --spider <URL>:<port>/console > /dev/null 2>&1 rc=$? done This works perfectly because it's an HTML site and when server is... (2 Replies)
Discussion started by: AlbertGM
2 Replies

6. Shell Programming and Scripting

Check URL with ksh

Hi everybody, I'm currently writing a ksh script which automates the entire startup of a large number of Tibco BusinessWorks domains, as well as all the deployed components running on it. My script is to be used after an infrastructure release, when the entire environement is down. It... (1 Reply)
Discussion started by: HexAnubis666
1 Replies

7. Shell Programming and Scripting

How to check if a pid is alive?

I want to do some operations provided the pid is active. (6 Replies)
Discussion started by: ScriptDummy
6 Replies

8. UNIX for Dummies Questions & Answers

Check whether a process is alive or not

Hi Everybody I have small requirement that needs to be implemented in shell script. Currently i have shell script which invokes a java process say "Process A" which runs in background. If some one tries to invoke again the same shell script , then there should be some mechanism inside the... (23 Replies)
Discussion started by: appleforme1415
23 Replies

9. Shell Programming and Scripting

check if job still alive and killing it after a certain walltime

Hi! I'm using a script to start a process that might run forever if some parameters are given wrong (it's part of an optimization). I would now like to have the process killed after a certain walltime in that case. So far I get it done with the following lines ./My_process.e & pid=`ps -ef |... (3 Replies)
Discussion started by: ciwstevie
3 Replies

10. Shell Programming and Scripting

Check URL using PERL

I am trying to create a perl script that will make sure a web page can be accessed going through an Apache httpd. The actual content of the web page does not matter. Most likely the web page will just have "You have successfully reached this port." This script will eventually be running... (5 Replies)
Discussion started by: rehoboth
5 Replies
Login or Register to Ask a Question