Monitor Website


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Monitor Website
# 1  
Old 12-22-2014
Monitor Website

Hi all,
i need to do the following,
when i connect to my website it prints out "Welcome User",
but sometimes there are errors like "dictionary not loaded" or "wrong user name or password"
so i wanted to make a script that checks that login page,
and if i get the Welcome massage do nothing,
if i get any other errors/messages i need to restart tomcat
because that is the only solution i have to solve these issues.

#!/bin/sh
url=`www.mywebsite.login.jsp?Username=test&UserPassword=foo`
#check if i get welcome message
if [ $url = Welcome ] ;
then
echo "website is up and running"
else #every thing else printe i need to restart tomcat
/etc/init.d/tomcat restart | echo "$url is down" mail -s 'restarting website' admin@mydomain.com;

fi


Can any body help me on how to configure this script?

Thanks in advance.

Last edited by charli1; 12-23-2014 at 03:54 AM..
# 2  
Old 12-22-2014
Run lynx or wget to download the page contents, and check that for the desired keyword(s) with e.g. grep or awk
This User Gave Thanks to RudiC For This Post:
# 3  
Old 12-22-2014
Quote:
Originally Posted by RudiC
Run lynx or wget to download the page contents, and check that for the desired keyword(s) with e.g. grep or awk
Thanks for the reply mate,Can you please edit the above script with wgetlynx

Thank you.

Last edited by charli1; 12-23-2014 at 03:51 AM..
# 4  
Old 12-22-2014
Try with lynx $url or lynx -dump $url and redirect to a temp file.
# 5  
Old 12-22-2014
-bash: lynx: command not found

Thanks anyway for your help.

Last edited by charli1; 12-23-2014 at 03:52 AM..
# 6  
Old 12-22-2014
You may have to install lynx. What about wget $url?
# 7  
Old 12-22-2014
This doesn't help me mate,
because the Welcome massage, is a frame and it is on another jsp (http://mywebsite/welcome.jsp)
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Script monitor website wth default tomcat script

Hi all, on our application server we have the following script that monitor the status of the website, my problem here is that i have edite the retries from 3 to 5, and the timewait to 120 second, so the script should check 5 times every 2 minutes, and if the fifth check fails it must restart... (0 Replies)
Discussion started by: charli1
0 Replies

2. Infrastructure Monitoring

Searching for Saas Monitor service which monitor my servers which are sitting in different providers

Sorry if this is the wrong forum Searching for Saas Monitor service which monitor my servers which are sitting in different providers . This monitor tool will take as less CPU as possible , and will send info about the server to main Dashboard. The info I need is CPU / RAM / my servers status (... (1 Reply)
Discussion started by: umen
1 Replies

3. Hardware

Fedora 16 dual monitor - dual head - automatic monitor shutdown

Hi, I am experiencing troubles with dual monitors in fedora 16. During boot time both monitors are working, but when system starts one monitor automatically shut down. It happend out of the blue. Some time before when I updated system this happend but then I booted older kernel release and... (0 Replies)
Discussion started by: wakatana
0 Replies

4. Shell Programming and Scripting

Website crawler

Hi, I want to build a crawler that seeks for a keyword on certain websites. This is what the website looks like: website.com/xxxxAA11xxxx I want that the crawler automatically changes the letters alphanumerically and if a certain keyword is found, the website got to be logged. But... (12 Replies)
Discussion started by: yaylol
12 Replies

5. Web Development

my website.please. help me.

hello!! well, i am planning to make my own virtual pet site like that of a neopets. unfortunately i don't have any idea on how to do it.. i've tried searching in the net, but the result is really complicated. i don't know where to begin.i have already drawn some that i think would help... (2 Replies)
Discussion started by: ackiemae
2 Replies

6. Shell Programming and Scripting

Monitor: Read from the monitor

Hello, I would like to write a script that use the display as an input. In the display there is a list of file. I want to use it as an array and this would be the input in my script. Does somebody know how do I make it? (2 Replies)
Discussion started by: mig8
2 Replies

7. UNIX for Dummies Questions & Answers

Website

Hey guys I know you probably get this question a lot but, I want to make a website, and I don't have any experience doing this. I have a iMac and i was wondering if there is someone you could refer me to or a site that will show me how to do it. Thanks. (2 Replies)
Discussion started by: mmecca21
2 Replies

8. Filesystems, Disks and Memory

website

HELLO FELLOW GEEKS. PLZ CHECK OUT MY FRIENDS SITE AT http://isunshine.dhs.org or u can also join the message board at http://isunshine.dhs.org/scripts/ikonboard.cgi wixifer (1 Reply)
Discussion started by: wixifer
1 Replies
Login or Register to Ask a Question