LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 08-05-2010, 12:01 PM   #1
saurabhmehan
Member
 
Registered: Jul 2010
Posts: 44

Rep: Reputation: 0
Question Shell script for testing connectivity via URL


Hi

I have comma separated file containing 3 fields:
Name,Shortcode,URL
Example of file is
Sony,52525,http://17.0.0.1/xyz
NDTV,53636,http://10.0.0.1/abc

Now i want to test every URL connectivity from my server by executing it using shell script and if url gives back response it shows output as "OK" in green color and if url is not responding it shows "NOT CONNECTED" in red color.

Output will be like following
Sony 52525 OK
NDTV 53636 NOT CONNECTED

Please help

Thanks in advance
 
Old 08-05-2010, 12:14 PM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by saurabhmehan View Post
Hi

I have comma separated file containing 3 fields:
Name,Shortcode,URL
Example of file is
Sony,52525,http://17.0.0.1/xyz
NDTV,53636,http://10.0.0.1/abc

Now i want to test every URL connectivity from my server by executing it using shell script and if url gives back response it shows output as "OK" in green color and if url is not responding it shows "NOT CONNECTED" in red color.

Output will be like following
Sony 52525 OK
NDTV 53636 NOT CONNECTED

Please help

Thanks in advance
What you could use is php-cli and check the return like a 200 - would say page is loaded and returned. You would also use bash with curl.
 
Old 08-05-2010, 12:27 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,942

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Essentially a duplicate post asking the same thing, except with just a BIT more information. Again, we will HELP you, but we're not going to write this FOR YOU....post what you've written.
 
  


Closed Thread

Tags
asap


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture reponse of 20 different URL hits in single shell script saurabhmehan Linux - Newbie 4 08-05-2010 03:13 PM
Can we open a browser (firefox/IE) & enter URL in it via shell/PERL script. barde Linux - Newbie 6 02-18-2009 06:21 AM
Testing for member exists in shell script hukcjv Linux - Newbie 5 03-22-2008 10:35 AM
Shell Script Testing for Directory Non-existance binarybob0001 Programming 5 04-01-2006 03:15 PM
shell script for stress testing blackzone Programming 3 09-14-2004 01:00 AM


All times are GMT -5. The time now is 05:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration