<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Shell Script for checking webserver pages are working or not in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892181#M96707</link>
    <description>Hi Shiv:&lt;BR /&gt;&lt;BR /&gt;I inadvertently dropped the shell shebang line --- the first line of a script that specifies the program (here, the shell) to use:&lt;BR /&gt;&lt;BR /&gt;# cat wget.sh&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset LOG=wget.log&lt;BR /&gt;typeset LST=wget.list&lt;BR /&gt;rm -f ${LOG}&lt;BR /&gt;wget --spider -a ${LOG} -i ${LST}&lt;BR /&gt;awk '/^Resolving/ {if (/failed/) {print $2,"bad"} else {print $2,"ok"}}' ${LOG}&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Sun, 05 Nov 2006 14:18:39 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2006-11-05T14:18:39Z</dc:date>
    <item>
      <title>Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892170#M96696</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am looking out for a shell script to check whether a web server is serving the page correctly or not.&lt;BR /&gt;One of the option is to check whether "get" is returning successful authentication status code 200 or not.&lt;BR /&gt;&lt;BR /&gt;Any other idea is welcome.&lt;BR /&gt;&lt;BR /&gt;Appreciate your help.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Fri, 03 Nov 2006 12:17:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892170#M96696</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-11-03T12:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892171#M96697</link>
      <description>Hi SHiv:&lt;BR /&gt;&lt;BR /&gt;How about 'wget':&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Gnu/wget-1.10.2/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Gnu/wget-1.10.2/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 03 Nov 2006 12:52:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892171#M96697</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-03T12:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892172#M96698</link>
      <description>Hi (again) Shiv:&lt;BR /&gt;&lt;BR /&gt;By the way, to learn more about 'wget', see:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.gnu.org/software/wget/manual/wget.html" target="_blank"&gt;http://www.gnu.org/software/wget/manual/wget.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Nov 2006 12:58:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892172#M96698</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-03T12:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892173#M96699</link>
      <description>Also:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://wget.sunsite.dk/" target="_blank"&gt;http://wget.sunsite.dk/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;(I do this on my VMS system with wget.)</description>
      <pubDate>Fri, 03 Nov 2006 23:50:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892173#M96699</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-11-03T23:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892174#M96700</link>
      <description>How to put it in a shell script ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Sat, 04 Nov 2006 18:36:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892174#M96700</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-11-04T18:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892175#M96701</link>
      <description>How would you put any command into a shell&lt;BR /&gt;script?  I use a text editor.&lt;BR /&gt;&lt;BR /&gt;Wget's normal output to stdout includes a line like this:&lt;BR /&gt;&lt;BR /&gt;HTTP request sent, awaiting response... 200 OK&lt;BR /&gt;&lt;BR /&gt;You should be able to save it in a temporary&lt;BR /&gt;file for later examination, or else pipe it&lt;BR /&gt;through "grep" to see if the "200" appeared&lt;BR /&gt;as expected.&lt;BR /&gt;&lt;BR /&gt;If you want more details, you might need to&lt;BR /&gt;specify the shell you wish to use.  If&lt;BR /&gt;you've never written a shell script before,&lt;BR /&gt;that would also be useful information.</description>
      <pubDate>Sat, 04 Nov 2006 21:39:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892175#M96701</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-11-04T21:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892176#M96702</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;I suggest you install a utility called wget&lt;BR /&gt;&lt;BR /&gt;Its available from the porting center and should be compiled not installed from depot because the depot install doesn't work well.&lt;BR /&gt;&lt;BR /&gt;Then have your shell script do this:&lt;BR /&gt;&lt;BR /&gt;wget http://website/index.html&lt;BR /&gt;&lt;BR /&gt;Important pages.&lt;BR /&gt;&lt;BR /&gt;Though this does not test how it works in a browser, it does attempt to download the page like a browser does and is a good quality control check.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Sun, 05 Nov 2006 02:14:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892176#M96702</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-11-05T02:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892177#M96703</link>
      <description>my question is:-&lt;BR /&gt;&lt;BR /&gt;i want to use "&lt;BR /&gt;wget http://website/index.html" in a shell script. &lt;BR /&gt;i want to run this script via cron job so that whenever status code 200 is not returned it should send some email alert to a user.&lt;BR /&gt;&lt;BR /&gt;I am not good in shell scripting and even if i start doing it would take longer than expected.&lt;BR /&gt;&lt;BR /&gt;appreciate your help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shiv&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 05 Nov 2006 10:49:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892177#M96703</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-11-05T10:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892178#M96704</link>
      <description>#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;/path_to/wget http://website/index.html &amp;gt; /tmp/webchk.log&lt;BR /&gt;&lt;BR /&gt;grep -i "HTTP request sent" /tmp/webchk.log |grep -i "200 OK"&lt;BR /&gt;&lt;BR /&gt;if [ $? -ne 0 ] ; then&lt;BR /&gt;   mailx -s "http://website/index.html is not OK" your_name@your.org.com &amp;lt; /tmp/webchk.log&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;rm /tmp/webchk.log&lt;BR /&gt;&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Yang</description>
      <pubDate>Sun, 05 Nov 2006 13:51:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892178#M96704</guid>
      <dc:creator>Yang Qin_1</dc:creator>
      <dc:date>2006-11-05T13:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892179#M96705</link>
      <description>&lt;!--!*#--&gt;Hi Shiv:&lt;BR /&gt;&lt;BR /&gt;The best way to become proficient at something is to begin by *trying*.  Here's a simple 'wget' session that verifies a list of web pages specified in 'wget.list'.&lt;BR /&gt;&lt;BR /&gt;# cat wget.list&lt;BR /&gt;&lt;A href="http://www.google.com" target="_blank"&gt;http://www.google.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.dummy.gov" target="_blank"&gt;http://www.dummy.gov&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.hp.com" target="_blank"&gt;http://www.hp.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;# cat wget.sh&lt;BR /&gt;typeset LOG=wget.log&lt;BR /&gt;typeset LST=wget.list&lt;BR /&gt;rm -f ${LOG}&lt;BR /&gt;wget --spider -a ${LOG} -i ${LST}&lt;BR /&gt;awk '/^Resolving/ {if (/failed/) {print $2,"bad"} else {print $2,"ok"}}' ${LOG}&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;...If you run this (and you may need to change the shell interpreter to '/usr/bin/sh' on HP-UX) you will see the following output:&lt;BR /&gt;&lt;BR /&gt;# ./wget.sh&lt;BR /&gt;&lt;A href="http://www.google.com..." target="_blank"&gt;www.google.com...&lt;/A&gt; ok&lt;BR /&gt;&lt;A href="http://www.dummy.gov..." target="_blank"&gt;www.dummy.gov...&lt;/A&gt; bad&lt;BR /&gt;&lt;A href="http://www.hp.com..." target="_blank"&gt;www.hp.com...&lt;/A&gt; ok&lt;BR /&gt;&lt;BR /&gt;The link to the 'wget' documentation I provided will enable you to decipher the 'wget' logic.  The shell script encapsulates the logic we need and should be easy to understand.  I used 'awk' to extract the lines I wanted from the logfile created by 'wget'.  'awk' numbers fields in a line starting from one (1).  By default, 'awk' splits a line into fields based on whitespace.  The character strings bounded by "/" denote a regular expression match.  By default, 'awk' attempts to match the bounded characters anywhere in each line it reads.  Hence, in our example we matched lines in the logfile that began with "Resolving".  Te caret ("^") in front of the "R" means anchor the string to a line's beginning.  Thus, we are looking for lines that *begin* with "Resolving".  The remainder of the 'awk' program should be easily deducible.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sun, 05 Nov 2006 14:05:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892179#M96705</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-05T14:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892180#M96706</link>
      <description>James, I appreciate your help. &lt;BR /&gt;&lt;BR /&gt;As always best regards to you.&lt;BR /&gt;Shiv&lt;BR /&gt;</description>
      <pubDate>Sun, 05 Nov 2006 14:18:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892180#M96706</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-11-05T14:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892181#M96707</link>
      <description>Hi Shiv:&lt;BR /&gt;&lt;BR /&gt;I inadvertently dropped the shell shebang line --- the first line of a script that specifies the program (here, the shell) to use:&lt;BR /&gt;&lt;BR /&gt;# cat wget.sh&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset LOG=wget.log&lt;BR /&gt;typeset LST=wget.list&lt;BR /&gt;rm -f ${LOG}&lt;BR /&gt;wget --spider -a ${LOG} -i ${LST}&lt;BR /&gt;awk '/^Resolving/ {if (/failed/) {print $2,"bad"} else {print $2,"ok"}}' ${LOG}&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sun, 05 Nov 2006 14:18:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892181#M96707</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-05T14:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892182#M96708</link>
      <description>Thanks Yang and others!!&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shiv</description>
      <pubDate>Sun, 05 Nov 2006 14:20:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892182#M96708</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-11-05T14:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892183#M96709</link>
      <description>Your best bet would be to use LYNX rather then WGET as if you have robots.txt to disallow robots, WGET will be rejected but Lynx will not.. &lt;BR /&gt;&lt;BR /&gt;Use #lynx -mime_header &lt;ADDRESS&gt; to get your 200 status code. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/ADDRESS&gt;</description>
      <pubDate>Wed, 29 Nov 2006 13:54:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892183#M96709</guid>
      <dc:creator>rmueller58</dc:creator>
      <dc:date>2006-11-29T13:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892184#M96710</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] if you have robots.txt to disallow&lt;BR /&gt;&amp;gt; robots, WGET will be rejected [...]&lt;BR /&gt;&lt;BR /&gt;Of course, that depends on what's in the&lt;BR /&gt;server's "robots.txt" file.  Also, as&lt;BR /&gt;"wget -h" will tell you, the user may decide&lt;BR /&gt;how wget identifies itself (here, from "GNU&lt;BR /&gt;Wget 1.10.2c" on VMS):&lt;BR /&gt;&lt;BR /&gt;  -U,  --user-agent=AGENT      identify as AGENT instead of Wget/VERSION.&lt;BR /&gt;&lt;BR /&gt;On the other hand, I'm sure that wget causes&lt;BR /&gt;cancer, so it's probably best to avoid it for&lt;BR /&gt;that reason, too.</description>
      <pubDate>Wed, 29 Nov 2006 14:45:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892184#M96710</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-11-29T14:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892185#M96711</link>
      <description>Someone told me to use openssl. Is it possible to use openssl ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Thu, 30 Nov 2006 04:29:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892185#M96711</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2006-11-30T04:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892186#M96712</link>
      <description>&amp;gt; Someone told me to use openssl. Is it&lt;BR /&gt;&amp;gt; possible to use openssl ?&lt;BR /&gt;&lt;BR /&gt;It probably is possible, but shouldn't you&lt;BR /&gt;be asking "How?" of the one who told you to&lt;BR /&gt;use it?&lt;BR /&gt;&lt;BR /&gt;Wget can incorporate OpenSSL, which it uses&lt;BR /&gt;for a URL which begins "https://".  All you&lt;BR /&gt;said in your original posting was "the page",&lt;BR /&gt;so everyone has been assuming that you meant&lt;BR /&gt;something simple, like "&lt;A href="http://xxx..." target="_blank"&gt;http://xxx...&lt;/A&gt;".  If&lt;BR /&gt;you say more than "the page", you might get&lt;BR /&gt;better responses.&lt;BR /&gt;&lt;BR /&gt;It's possible to do the job with Telnet, too,&lt;BR /&gt;but it's not simple, and if you are "not good&lt;BR /&gt;in shell scripting", then it's probably not&lt;BR /&gt;the easiest or best way to attack the&lt;BR /&gt;problem.&lt;BR /&gt;&lt;BR /&gt;And besides wget, there's also "curl":&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://curl.haxx.se/" target="_blank"&gt;http://curl.haxx.se/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Either one should be able do the job&lt;BR /&gt;(depending on exactly what "the job" is, of&lt;BR /&gt;course).</description>
      <pubDate>Thu, 30 Nov 2006 09:45:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892186#M96712</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-11-30T09:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892187#M96713</link>
      <description>Hi Shiv:&lt;BR /&gt;&lt;BR /&gt;I might add that if you drop the requirement for a *shell* script, the number of different solutions expand further.  Depending upon your requirements, *Perl* scripts with the 'LWP::Simple' module would work, too.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 30 Nov 2006 10:02:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892187#M96713</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-30T10:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script for checking webserver pages are working or not</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892188#M96714</link>
      <description>If you have got the openssl suite installed on your box (HP offers a free bundle) then you could use the incredibly versatile openssl command for most things crypto.&lt;BR /&gt;e.g.&lt;BR /&gt;You can pull certificate info of an SSL/TLS enabled webserver by issuing something like&lt;BR /&gt;(I assume you have the webserver running on the same box, but any other reachable IP also will work)&lt;BR /&gt; &lt;BR /&gt;$ openssl s_client -connect 127.0.0.1:443&lt;BR /&gt; &lt;BR /&gt;However, this may block if the DocumentRoot is AuthType "protected" because the webserver is sending an Authentication request which your client has to answer.&lt;BR /&gt; &lt;BR /&gt;If you have a recent Perl you could pull the header of any https website.&lt;BR /&gt;If it is AuthType protected you could use the&lt;BR /&gt;-C switch like below.&lt;BR /&gt;The HTTP response header received also contains entries about the SSL-Cert-Issuer (which I omitted below).&lt;BR /&gt;Most important the HTTP response status is sent in the first line (usually you would expect a 200 which is OK)&lt;BR /&gt;  &lt;BR /&gt;$ lwp-request -m head -C grothe:riddle &lt;A href="https://127.0.0.1/" target="_blank"&gt;https://127.0.0.1/&lt;/A&gt;|head -1&lt;BR /&gt;200 OK&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;You could also get the nagios-plugins, extract the tarball and only compile the check_tcp and check_http plugins.&lt;BR /&gt;They are specifically designed for monitoring purposes and offer a whole lot of options to virtually test any HTTP services.&lt;BR /&gt;When invoked with -h or --help you get a full screen where the options are explained.&lt;BR /&gt; &lt;BR /&gt;Unfortunately the nagios server where I've got those check commands available is a legacy AIX system that neither has a /dev/urandom nor an entropy gathering daemon why I only get this nasty error&lt;BR /&gt;&lt;BR /&gt;$ check_http -H somehost -N -S -a grothe:riddle&lt;BR /&gt;CRITICAL - Cannot make SSL connection &lt;BR /&gt;35196:error:24064064:random number generator:SSLEAY_RAND_BYTES:PRNG not seeded:md_rand.c:474:You&lt;BR /&gt; need to read the OpenSSL FAQ, &lt;A href="http://www.openssl.org/support/faq.html" target="_blank"&gt;http://www.openssl.org/support/faq.html&lt;/A&gt;&lt;BR /&gt;Error on receive&lt;BR /&gt; &lt;BR /&gt;But HP-UX provides patches that would create those random devices to make openssl or other SSL libs happy.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Nov 2006 11:15:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-for-checking-webserver-pages-are-working-or-not/m-p/3892188#M96714</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2006-11-30T11:15:19Z</dc:date>
    </item>
  </channel>
</rss>

