Published on System iNetwork (http://systeminetwork.com)
Free Utility CHKWEBSITE Checks if Web Site Is Available
By tzura
Created Apr 24 2003 - 04:00

Herman Van der Staey has posted a free utility CHKWEBSITE in the iSeries NEWS forums that tests if a given Web site is available. Here's a sample program that calls CHKWEBSITE:

TESTWEB: PGM

         DCL        VAR(&AVAILABLE)   TYPE(*LGL)

         CHKWEBSITE WEBSITE('http://www.mycompany.com') +
                    WEBAVAIL(&AVAILABLE)

         IF         COND(&AVAILABLE) THEN(DO)
           SNDPGMMSG  MSG('Website is available')
         ENDDO
         ELSE       CMD(DO)
           SNDPGMMSG  MSG('Website is NOT available')
           SNDDST     TYPE(*LMSG)                                 +
                        TOINTNET((webmaster@yourcompany.com [1]))     +
                        DSTD('Long Message') LONGMSG('The website +
                        is not available. Please take action.')   +
                        SUBJECT('Website not available !')
         ENDDO

END:     ENDPGM

You can obtain the command, CL, and Java source at http://www.iseriesnetwork.com/Forums/Thread.cfm?CFApp=55&Thread_ID=30314&mc=14#Message108051 [2].

© 2010 Penton Media, Inc.

Source URL: http://systeminetwork.com/node/61171

Links:
[1] mailto:webmaster@yourcompany.com
[2] http://systeminetwork.com/Forums/Thread.cfm?CFApp=55&Thread_ID=30314&mc=14#Message108051