× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Rick, 

Actually I am rather fond of the simplicity of:
             PING       RMTSYS(NOTESFAX) MSGMODE(*QUIET *ESCAPE)
             MONMSG     MSGID(TCP3210 TCP3202 TCP3213) EXEC(GOTO 
CMDLBL(ALERT))

However, the poster stated that the remote sites are blocking ping, so 
neither approaches help.


Rob Berendt
-- 
"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety." 
Benjamin Franklin 




"Chevalier, Rick" <Rick.Chevalier@americredit.com>
Sent by: midrange-l-bounces@midrange.com
01/28/2003 09:38 AM
Please respond to Midrange Systems Technical Discussion
 
        To:     "'Midrange Systems Technical Discussion'" 
<midrange-l@midrange.com>
        cc: 
        Fax to: 
        Subject:        RE: Ping via FTP?


Loyd,

Here is the routine I use to check for successful ping.

/* Check for a good connection to remote system 
 RTYPING:    PING       RMTSYS(&IPADDRESS) 
 
/* Error during ping process. Resend received message 
             MONMSG     MSGID(CPF0000) EXEC(DO) 
               RCVMSG     MSGTYPE(*EXCP) RMV(*NO) MSG(&ERRTXT) + 
                            MSGDTA(&ERRMSGDTA) MSGID(&ERRMSGID) + 
                            MSGF(&ERRMSGF) MSGFLIB(&ERRMSGFLIB) 
               SNDPGMMSG  MSGID(&ERRMSGID) MSGF(&ERRMSGFLIB/&ERRMSGF) + 
                            MSGDTA(&ERRMSGDTA) MSGTYPE(*ESCAPE) 
             ENDDO 
 
/* Get last error message and determine if ping was successful 
             RCVMSG     MSGQ(*PGMQ) MSGTYPE(*LAST) RMV(*NO) + 
                          MSG(&ERRTXT) MSGDTA(&ERRMSGDTA) + 
                          MSGID(&ERRMSGID) MSGF(&ERRMSGF) + 
                          MSGFLIB(&ERRMSGFLIB) 
 
             IF         COND(&ERRMSGID *EQ 'TCP3210') THEN(DO) 
 
/* Ping command completed but not with 100% success on the connections 
               IF         COND(%BIN(&ERRMSGDTA 9 4) *NE 100) THEN(DO) 
 
/* Retry 3 times before sending messages 
                 IF         COND(&TRIES < 3) THEN(DO) 
                   CHGVAR     VAR(&TRIES) VALUE(&TRIES + 1) 
                   DLYJOB     DLY(10) 
                   GOTO       CMDLBL(RTYPING) 
                 ENDDO 
 
                 CHGVAR     VAR(&ERRMSGDTA) VALUE(&IDENTIFIER *CAT +
                              %SST(&ERRMSGDTA 1 8) *CAT &IPADDRESS) 
                 SNDPGMMSG  MSGID(FTP1005) MSGF(QMSGFCO) + 
                              MSGDTA(&ERRMSGDTA) MSGTYPE(*ESCAPE) 
               ENDDO 
 
             ENDDO 

HTH,

Rick

-----Original Message-----
From: Loyd Goodbar [mailto:loyd@blackrobes.net]
Sent: Monday, January 27, 2003 6:14 PM
To: MIDRANGE-L@midrange.com
Subject: Ping via FTP?

I need to check that some external FTP servers are running. (FWIW, various
EDI
FTP servers over an ANX connection). However, the routers and firewalls
block
ping requests.

>From the command line, I can do an FTP 'w.x.y.z' and look at the 
resulting
screen, it usually says "Welcome ..." or "Connection failed." That's all I
would need to see, then F3 to exit the session.

If I get a Connection failed, then I could send emails to our shippers and
IT
folks up the line.

Is there an easy way to capture/parse the connection messages? I want to
schedule this type of job to run every 10-15 minutes.

pgm
ftp 'blah'
/* look through the ftp logs */
/* if the first output is Connection to host failed... */
snddst...
endpgm

Thanks,
Loyd
--




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.