Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to monitor three server pages. These three pages contain a simple text (for example it says it's "working fine"). I want to be notified when anything other than this message is displayed, e.g. via email.

I want shell scripting code for displaying the status of the three pages in an html file.

share|improve this question

if your pages are proper HTML-pages and you do not want to parse that, you might want to use lynx (the old-school text-base browser) for rendering the HTML into plaintext first (using the --dump flag):

for lnk in http://foo.example.com \
           http://bar.example.com \
   lynx --dump "${lnk}" \
   | grep "working fine" \
   || mailx -s "${lnk} failed" you@example.com
share|improve this answer

You could use either curl or wget along with bash to accomplish what you want.

$ wget -O- http://example.com | grep "working fine" || mailx -s "Oh NO" you ...
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.