LinuxQuestions.org
Help answer threads with 0 replies.
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


Reply
  Search this Thread
Old 08-29-2008, 03:16 PM   #1
myfoot
LQ Newbie
 
Registered: Nov 2007
Posts: 17

Rep: Reputation: 0
URL testing


Hello,,


I need script which send me email if specific URL using 8080 port goes down.

e.g http://linuxquestions.org.com:8080

Thanks.
 
Old 08-29-2008, 04:42 PM   #2
Fantasio
Member
 
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152

Rep: Reputation: 19
lynx -dump -connect_timeout=10 http://your_url | grep -i "Unable to connect to remote host" && cat <<"EOF"
Webserver doesn't work.
EOF
| sendmail -r nobody@yourdomain -s "Warning" admin@yourdomain
 
Old 08-29-2008, 05:00 PM   #3
Fantasio
Member
 
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152

Rep: Reputation: 19
Put content below into a file called testurl.sh, followed by a chmod u+x testurl.sh

It works, I have tried it

#!/bin/bash
lynx -dump -stderr -connect_timeout=3 http://yout_url_2_test 2> /dev/stdout | grep -i "Unable to connect to remote host" && mail -s "warning" your_email_address <<"EOF"
test failure
EOF
 
Old 08-31-2008, 06:06 AM   #4
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
or you could maybe even try fiddling with netcat....?
 
  


Reply


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
Replace 'etch' with 'testing' in /etc/apt/sources.list to track 'testing' branch? Akhran Debian 3 04-09-2007 10:45 AM
Sarge-testing To Etch-testing? SMurf7 Debian 3 02-21-2006 10:59 PM
ERROR The requested URL could not be retrieved While trying to retrieve the URL: /re Niceman2005 Linux - General 1 06-29-2005 09:51 AM
Setup as getting debian testing files from ftp - will it stay with testing BrianHenderson Debian 2 09-02-2004 06:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:57 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
Open Source Consulting | Domain Registration