 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Sidney Broerse
Joined: 11 Mar 2003 Posts: 6
|
|
Strange PingPort problem |
|
Hi, I am developing a 24x7 script to download files from an FTP-server (actually an FTP- connection with a mainframe). To do this, the script uses a user-defined statement (built by me) that uses pingport max. two times in a loop to determine if the FTP-connection is 'alive'. If this is true, it will download some files. The problem is that everything works just fine in debug mode, but when I run the main script with 'Run Now' it halts altogether at the PingPort statement. If I test the statement in another script, which will only determine whether the files are there, it works fine in both debug mode and run mode. What is the problem? Am I missing something?
|
|
Tue Mar 11, 2003 8:09 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7964
|
|
Re: Strange PingPort problem |
|
Turn on the trace option (Tools/Options;Logging;Tracing enabled). Let the job run and heck for additional messages in the trace window and trace files that can shed some light on the problem. If the script hangs please let me know which specific operation causes it to hang. : Hi, : I am developing a 24x7 script to download files from an FTP-server (actually : an FTP- : connection with a mainframe). : To do this, the script uses a user-defined statement (built by me) : that uses pingport max. two times in a loop to determine if the : FTP-connection : is 'alive'. If this is true, it will download some files. : The problem is that everything works just fine in debug mode, but when I : run the main script with 'Run Now' it halts altogether at the PingPort : statement. : If I test the statement in another script, which will only determine whether : the : files are there, it works fine in both debug mode and run mode. : What is the problem? Am I missing something?
|
|
Tue Mar 11, 2003 9:06 am |
|
 |
Sidney Broerse
Joined: 11 Mar 2003 Posts: 6
|
|
Re: Strange PingPort problem |
|
I have tested it already with Tracing enabled and this is what happens: It reads PINGPORT EXECUTING PINGPORT("172.26.1.2","21","false") Pingport 172.26.1.2:21... Pinging 172.26.1.2:21Found active port at 172.26.1.2:21, service name: "ftp" After this, it simply halts and gives control back to the user interface of 24x7 (as if it has finished). I also tried using PING, which gives the following: PING Executing PING("172.26.1.2","false") PING 172.26.1.2... Pinging 172.26.1.2 64 bytes from 172.26.1.2: icmp_seq = 0. time: 16 ms 64 bytes from 172.26.1.2: icmp_seq = 1. time: 15 ms 64 bytes from 172.26.1.2: icmp_seq = 2. time: 16 ms After which the same occurs: it halts as if it is finished. Trying this with a simple testscript results in a Return "true" after both the PINGPORT and the PING sequence and a normal execution of the rest of the script. The PINGPORT/PING statement is part of a user-defined statement I built. Calling this statement in the script I'm developing results in the situation above; calling the statement in a simple testscript results in normal execution. I tried Pinging the IP-adress in the DOS-prompt, which gave no problems.
|
|
Wed Mar 12, 2003 6:21 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7964
|
|
Re: Strange PingPort problem |
|
Please post your script. : I have tested it already with Tracing enabled and this is what happens: It : reads : PINGPORT : EXECUTING PINGPORT("172.26.1.2","21","false") : Pingport 172.26.1.2:21... : Pinging 172.26.1.2:21Found active port at 172.26.1.2:21, service name: : "ftp" : After this, it simply halts and gives control back to the user interface of : 24x7 : (as if it has finished). : I also tried using PING, which gives the following: PING : Executing PING("172.26.1.2","false") : PING 172.26.1.2... : Pinging 172.26.1.2 : 64 bytes from 172.26.1.2: icmp_seq = 0. time: 16 ms : 64 bytes from 172.26.1.2: icmp_seq = 1. time: 15 ms : 64 bytes from 172.26.1.2: icmp_seq = 2. time: 16 ms : After which the same occurs: it halts as if it is finished. : Trying this with a simple testscript results in a : Return "true" after both the PINGPORT and the PING sequence and a : normal execution of the rest : of the script. : The PINGPORT/PING statement is part of a user-defined statement I built. : Calling this statement in the script I'm developing results in the situation : above; calling the statement in a simple testscript results in normal : execution. : I tried Pinging the IP-adress in the DOS-prompt, which gave no problems.
|
|
Wed Mar 12, 2003 8:58 am |
|
 |
Sidney Broerse
Joined: 11 Mar 2003 Posts: 6
|
|
Re: Strange PingPort problem |
|
THIS IS THE MAIN SCRIPT: //*************************************************************************************** // // Job: GetFromGEMAL // Creatiedatum: 04-02-2003 // Auteur: S.Q. Broerse, GBS-MDS // Contactpersoon: J-P. Lerou, GHRS-OS // G. v/d Steen, GHRS-OS // Functionaliteit: Deze job start ieder half uur en op het moment dat er een GEMAL-controle-bestand // aanwezig is haalt het na aanwezigheidscontroles dit controlebestand en een ZIP- // bestand op uit de GEMAL-omgeving. Tenslotte worden de benodigde bestanden // uitgepakt en op inhoud gecontroleerd. // //*************************************************************************************** //*************************************************************************************** // // Wijzigingen (ook aangeven op lokatie in script) // // Datum: // Wijziging door: // Beschrijving wijziging: // // Datum: // Wijziging door: // Beschrijving wijziging: // //*************************************************************************************** //*************************************************************************************** // // Variabele-declaraties // //*************************************************************************************** //Naampad controlebron Dim strCtlSrc,string //Naampad controledoel Dim strCtlTar,string //Naampad bronbestand (ZIP) Dim strZIPSrc, String //Naam/pad doelbestand (ZIP) Dim strZIPTar, String //Servernaam of IP-adres Dim strServer, String //Gebruikernaam Dim strUser, String //Wachtwoord Dim strPWD, String //Te loggen Entry Dim strEntry,String //Lock-file op FTP-server Dim strLockFile,string //Directory om uitgepakte bestanden te plaatsen Dim strUnzipDir,string //In-directory voor PASRUN Dim strPASRUN_IN,string //Directory voor backups die OK zijn Dim strBKUP_OK,string //Directory voor backups die NIET OK zijn Dim strBKUP_ERR,string //Directory statusbestanden Dim strStatusDir,string //Geeft returnwaarden van user-defined statements ed. Dim blnOK,Boolean //Bestandsnummer Dim numFileNumber,number //*************************************************************************************** // // Initialisatie // //*************************************************************************************** //Openen INI-bestand (het enige hard geprogrammeerde pad) FileExists "c:\\MF2PAS_INI\\GEMALGET.INI", blnOK if(blnOK,INI_FOUND,NO_INI_FOUND) //INI-bestand niet gevonden (FOUT) NO_INI_FOUND: set strEntry,"" ConcatEx "INI-bestand NIET Gevonden!!",strEntry GOTO HANDLE_ERRORS //INI-bestand gevonden INI_FOUND: //Openen bestand FileOpen "c:\\MF2PAS_INI\\GEMALGET.INI","LINEMODE","READ",False,numFileNumber //Zetten naam/pad controlebronbestand FileRead numFileNumber, strCTLSrc //Zetten naam/pad controledoelbestand FileRead numFileNumber, strCTLTar //Zetten naam/pad bronbestand FileRead numFileNumber, strzipsrc //Zetten naam/pad doelbestand FileRead numFileNumber,strziptar //Zetten FTP-server FileRead numFileNumber,strserver //Zetten usernaam en password FileRead numFileNumber,strUser FileRead numFileNumber,strPWD //Zetten LOCKFILE FileRead numFileNumber,strLockFile //Zetten directory om te unzippen FileRead numFileNumber,strUnzipDir //Zetten in-directory PASRUN FileRead numFileNumber,strPASRUN_IN //Zetten backupdirectories FileRead numFileNumber,strBKUP_OK FileRead numFileNumber,strBKUP_ERR //Zetten statusdirectory FileRead numFileNumber,strStatusDir //Sluiten bestand FileClose numFileNumber //*************************************************************************************** // // Proces // //*************************************************************************************** //Bepalen of andere engines draaien met behulp van een user-defined statement checkengines "GEMAL",strStatusDir,blnOK if(blnOK,FREE,NO_FREE) //Een van de engines is aktief; melden en stoppen NO_FREE: //Log-entry creeeren en wegschrijven mbv een user-defined statement set strEntry,"" ConcatEx "Een van de Engines is bezig; GEMAL is gestopt",strEntry customOK strEntry,"GetFromGEMAL" GOTO CLOSE // Er is geen engine aktief; deze engine kan verder FREE: //Pollen naar controlebestand met behulp van een user-defined statement pollforFile strCTLSrc,strCTLTar,strServer,21,"GEMAL",strUser,strPWD,blnOK if(blnOK, CONTROL_OK,NO_CONTROL) //Controle-bestand niet aanwezig; melden en stoppen NO_CONTROL: //OK-log entry creeeren en wegschrijven mbv een user-defined statement set strEntry,"" ConcatEx "Controlebestand ",strCTLSrc," niet gevonden.",strEntry customOK strEntry,"GetFromGEMAL" GOTO CLOSE //Controle-bestand aanwezig CONTROL_OK: //OK-logentry creeeren en wegschrijven mbv een user-defined statement set strEntry,"" ConcatEx "Controlebestand ",strCTLSrc," gevonden.",strEntry customOK strEntry,"GetFromGEMAL" //Pollen naar ZIP-bestand met behulp van een user-defined statement wait 5 blockFTP strServer,21,strLockFile,"GEMAL",strUser,strPWD,blnOK if(blnOK,LOCK,NO_LOCK) NO_LOCK: GOTO UNBLOCK LOCK: pollforFile strZIPsrc,strZIPTar,strServer,21,"GEMAL",strUser,strPWD,blnOK if(blnOK,ZIP,NO_ZIP) //ZIP-bestand niet aanwezig (terwijl het controlebestand wel aanwezig is: FOUT!) NO_ZIP: //Fout-logentry creeeren set strEntry,"" ConcatEx "ZIP-bestand ",strZIPSrc," NIET Gevonden!!",strEntry GOTO HANDLE_ERRORS //ZIP-bestand bestaat ZIP: //Uitpakken ZIP-bestand met behulp van een userdefined statement unzipandlog strZIPTar,strUnzipDir,"GEMAL",blnOK if(blnOK, UNZIP,NO_UNZIP) //Niet Uitgepakt; de fout wordt elders afgehandeld; sluiten NO_UNZIP: GOTO UNBLOCK //Wel uitgepakt UNZIP: //Controle uitgepakte bestanden (allemaal aanwezig vlgs. Controlebestand) checkfiles strCTLTar,strUnZipDir,"GEMAL",blnOK if (blnOK,WRAP_UP, NO_GOOD) //Niet alle bestanden aanwezig NO_GOOD: GOTO UNBLOCK //Wel alle bestanden aanwezig WRAP_UP: //Verplaatsen naar PASRUN-directory setforpasrun strPASRUN_IN,strUnzipDIr,strBKUP_OK,"GEMAL" GOTO UNBLOCK HANDLE_ERRORS: //Wegschrijven foutmelding mbv een user-defined statement customerror(strentry,"s.q.broerse@getronics.nl","GetFromGEMAL") UNBLOCK: //Deblokkeren GEMAL unblockFTP strServer,21,strLockFile,"GEMAL",strUser,strPWD //Verwijderen controlebestand van server deletefromserver strServer,21,strUser,strPWD,strCTLSrc,"GEMAL",blnOK if(blnOK,CTRLDELETED,CTRLNOTDELETED) //Bestand niet verwijderd CTRLNOTDELETED: GOTO CLOSE //Bestand verwijderd CTRLDELETED: //Zip van server verwijderen deletefromserver strServer,21,strUser,strPWD,strZIPSrc,"GEMAL",blnOK if(blnOK,ZIPDELETED,ZIPNOTDELETED) //ZIP niet verwijderd ZIPNOTDELETED: GOTO CLOSE //ZIP verwijderd ZIPDELETED: //Lokaal controlebestand verwijd eren deletefromclient strCTLTar,"GEMAL",blnOK if(blnOK,LOCALCDELETED,LOCALCNOTDELETED) //Bestand niet verwijderd LOCALCNOTDELETED: GOTO CLOSE //Bestand verwijderd LOCALCDELETED: //ZIP lokaal verwijderen deletefromclient strZIPTar,"GEMAL",blnOK if(blnOK,LOCALZDELETED,LOCALZNOTDELETED) //ZIP niet verwijderd LOCALZNOTDELETED: GOTO CLOSE //ZIP verwijderd LOCALZDELETED: CLOSE: // Deblokkeren script en SLUITEN unblockEngine "GEMAL",strStatusDir Exit
|
|
Wed Mar 12, 2003 9:09 am |
|
 |
Sidney Broerse
Joined: 11 Mar 2003 Posts: 6
|
|
Re: Strange PingPort problem |
|
THIS IS THE SCRIPT FOR checkengines: //*************************************************************************************** // //Custom Script: checkengines // Creatiedatum: 17-02-2003 // Auteur: S.Q. Broerse, GBS-MDS // Contactpersoon: J-P. Lerou, GHRS-OS // G. v/d Steen, GHRS-OS // Functionaliteit: Dit script voor een user-defined statement ontvangt een engine-naam en controleert // vervolgens aan een aantal statusbestanden of deze engine verder mag. // Parameters: Dit script accepteert de volgende parameters: // AskingEngine: Engine die 'vraagt' of hij kan gaan draaien // Return: Dit script geeft een boolean (True of False) terug // //*************************************************************************************** //*************************************************************************************** // // Wijzigingen (ook aangeven op lokatie in script) // // Datum: // Wijziging door: // Beschrijving wijziging: // // Datum: // Wijziging door: // Beschrijving wijziging: // //*************************************************************************************** //*************************************************************************************** // // Variabele-declaraties // //*************************************************************************************** //Geeft aan of de vragende engine GEMAL is Dim blnGEMAL,boolean //Geeft aan of de vragende engine ASAP is Dim blnASAP,boolean //Geeft aan of de vragende engine BRUNET is Dim blnBRUNET,boolean //Geeft aan of de vragende engine ILIAS is Dim blnILIAS,boolean //Geeft aan of de vragende engine INTRACOM is Dim blnINTRACOM,boolean //Geeft aan of een statusbestand bestaat Dim blnFound,boolean //Returnwaarde Dim blnRet,boolean //Naam betreffende engine Dim strEngineNaam,string //Status betreffende engine Dim strEngine,string //Bestandsnaam & pad dim strBestand,string //Log-entry Dim strEntry,string //Bestandsnummer Dim numFileNumber,number //*************************************************************************************** // // Proces // //*************************************************************************************** //Initialisatie boolean engines set blnGEMAL,false set blnASAP,false set blnBRUNET,false set blnILIAS,false set blnINTRACOM,false //Bepalen welke engine vraagt ChooseCase AskingEngine, END_ASK Case "GEMAL" set blnGEMAL,true Case "ASAP" set blnASAP,true Case "BRUNET" set blnBRUNET,true Case "ILIAS" set blnILIAS,true Case "INTRACOM" set blnINTRACOM,true CaseElse set strentry,"" ConcatEx "De vragende Engine (",AskingEngine,") is onbekend!! Pas de statement checkengines aan.",strentry Goto HANDLE_ERRORS END_ASK: //Controle ASAP if(blnASAP,ASAP_ASKS,NO_ASAP_ASKS) //ASAP is niet de vragende engine NO_ASAP_ASKS: set strEngineNaam,"ASAP" //Controle bestaan bestand set strBestand,"" concatex PadNaarStatus,"\\ASAPStatus.txt",strBestand FileExists strBestand,blnfound if(blnfound,ASAPSTAT_EXISTS,NO_STAT_EXISTS) //Bestand bestaat ASAPSTAT_EXISTS: //Openen bestand FileOpen strBestand,"LineMode","Read",False,numFileNumber //Uitlezen inhoud FileRead numFileNumber,strEngine //Bepalen status ASAP ChooseCase strEngine,END_ASAP Case "ASAP_FREE" FileClose numFileNumber CaseElse FileClose numFileNumber set blnRet,false GOTO WRAPUP END_ASAP: //ASAP is de vragende Engine ASAP_ASKS: //Controle ILIAS if(blnILIAS,ILIAS_ASKS,NO_ILIAS_ASKS) //ASAP is niet de vragende engine NO_ILIAS_ASKS: set strEngineNaam,"ILIAS" //Controle bestaan bestand set strBestand,"" concatex PadNaarStatus,"\\ILIASStatus.txt",strBestand FileExists strBestand,blnfound if(blnfound,ILIASSTAT_EXISTS,NO_STAT_EXISTS) //Bestand bestaat ILIASSTAT_EXISTS: //Openen bestand FileOpen strBestand,"LineMode","Read",False,numFileNumber //Uitlezen inhoud FileRead numFileNumber,strEngine //Bepalen status ILIAS ChooseCase strEngine,END_ILIAS Case "ILIAS_FREE" FileClose numFileNumber CaseElse FileClose numFileNumber set blnRet,false GOTO WRAPUP END_ILIAS: //ILIAS is de vragende Engine ILIAS_ASKS: //Controle INTRACOM if(blnINTRACOM,INTRACOM_ASKS,NO_INTRACOM_ASKS) //INTRACOM is niet de vragende engine NO_INTRACOM_ASKS: set strEngineNaam,"INTRACOM" //Controle bestaan bestand set strBestand,"" concatex PadNaarStatus,"\\INTRACOMStatus.txt",strBestand FileExists strBestand,blnfound if(blnfound,INTRACOMSTAT_EXISTS,NO_STAT_EXISTS) //Bestand bestaat INTRACOMSTAT_EXISTS: //Openen bestand FileOpen strBestand,"LineMode","Read",False,numFileNumber //Uitlezen inhoud FileRead numFileNumber,strEngine //Bepalen status ASAP ChooseCase strEngine,END_INTRACOM Case "INTRACOM_FREE" FileClose numFileNumber CaseElse FileClose numFileNumber set blnRet,false GOTO WRAPUP END_INTRACOM: //INTRACOM is de vragende Engine INTRACOM_ASKS: //Controle BRUNET if(blnBRUNET,BRUNET_ASKS,NO_BRUNET_ASKS) //Brunet is niet de vragende engine NO_BRUNET_ASKS: set strEngineNaam,"BRUNET" //Controle bestaan bestand set strBestand,"" concatex PadNaarStatus,"\\BRUNETStatus.txt",strBestand FileExists strBestand,blnfound if(blnfound , BRUNETSTAT_EXISTS,NO_STAT_EXISTS) //Bestand bestaat BRUNETSTAT_EXISTS: //Openen bestand FileOpen strBestand,"LineMode","Read",False,numFileNumber //Uitlezen inhoud FileRead numFileNumber,strEngine ChooseCase strEngine,END_BRUNET Case "BRUNET_FREE" FileClose numFileNumber CaseElse FileClose numFileNumber set blnRet,false GOTO WRAPUP END_BRUNET: //Brunet is de vragende engine BRUNET_ASKS: //Controle GEMAL if(blnGEMAL,GEMAL_ASKS,NO_GEMAL_ASKS) //Gemal is niet de vragende engine NO_GEMAL_ASKS: set strEngineNaam,"GEMAL" //Controle bestaan bestand set strBestand,"" concatex PadNaarStatus,"\\GEMALStatus.txt",strBestand FileExists strBestand,blnfound if(blnfound , GEMALSTAT_EXISTS,NO_STAT_EXISTS) //Bestand bestaat GEMALSTAT_EXISTS: //Openen bestand FileOpen strBestand,"LineMode","Read",False,numFileNumber //Uitlezen inhoud FileRead numFileNumber,strEngine ChooseCase strEngine,END_GEMAL Case "GEMAL_FREE" FileClose numFileNumber CaseElse FileClose numFileNumber set blnRet,false GOTO WRAPUP END_GEMAL: //Gemal is de vragende engine GEMAL_ASKS: set strentry,"" ConcatEx ASKINGENGINE," kan doorgaan",strentry customOK strentry,"CheckEngines" blockengine AskingEngine,PadNaarStatus set blnRet, true GOTO Wrapup NO_STAT_EXISTS: //Er ontbreekt een statusbestand set strentry,"" ConcatEx "Het statusbestand voor ",strEngineNaam," ontbreekt!!",strentry Goto HANDLE_ERRORS HANDLE_ERRORS: //Foutafhandeling customerror(strentry,"s.q.broerse@getronics.nl","CheckEngines") set blnRet,false WRAPUP: Return blnRet
|
|
Wed Mar 12, 2003 9:10 am |
|
 |
Sidney Broerse
Joined: 11 Mar 2003 Posts: 6
|
|
Re: Strange PingPort problem |
|
This is the script for POLLFORFILE: //*************************************************************************************** // //Custom Script: pollforfile // Creatiedatum: 18-02-2003 // Auteur: S.Q. Broerse, GBS-MDS // Contactpersoon: J-P. Lerou, GHRS-OS // G. v/d Steen, GHRS-OS // Functionaliteit: Dit script voor een user-defined statement pollt voor een bestand en indien gevonden // haalt hij het bestand over // Parameters: Dit script accepteert de volgende parameters: // FileNamePath: Naam en pad bestand waarvoor gepolld wordt op FTP-server // LocalNamePath: Naam en pad bestand waarnaartoe gekopieerd dient te worden // TheServer: Naam FTP-server waar het bestand gezocht wordt // ThePort: Poortnummer FTP-server // Engine: Naam betreffende salaris-engine // Username: Gebruikersnaam account // Password: Wachtwoord account // Return: Dit script geeft een boolean (TRUE of FALSE) terug. // //*************************************************************************************** //*************************************************************************************** // // Wijzigingen (ook aangeven op lokatie in script) // // Datum: // Wijziging door: // Beschrijving wijziging: // // Datum: // Wijziging door: // Beschrijving wijziging: // //*************************************************************************************** //*************************************************************************************** // // Variabele-declaraties // //*************************************************************************************** //Loop-criterium Dim blnOut,boolean //Geeft aan of loop afgebroken moet worden (max. 2 maal laten loopen) Dim blnEnd,boolean //Geeft aan of er contact met de database is Dim blnContact,boolean //Geeft aan of een bestand gevonden is Dim blnFound,boolean //Returnwaarde Dim blnRet,boolean //Teller voor in loop Dim numTeller,number //Interne teller om teller op te kunnen hogen Dim numIntern,number //Log-entry Dim strEntry,string //*************************************************************************************** // // Proces // //*************************************************************************************** //Zetten boolean voor loop Set blnOut,true //Starten loop LoopWhile(blnOut,ENDLOOP) //Controleren contact met FTP-server/Salaris-engine PingPort (TheServer,ThePort,blnContact) //ping Theserver, blnContact wait 5 If(blnContact,GO_ON,NO_GO) //Indien contact GO_ON: //Stoppen loop Set blnout, false Break //Geen contact NO_GO: //Teller ophogen met 1 Add(numTeller,1,numIntern) Set numTeller, numIntern //Test of teller > 1 is IsGreater(numTeller,1,blnEnd) If(blnEnd,GET_OUT,REPEAT) //Indien teller > 1 GET_OUT: //Stoppen loop Set blnOut,false Break //Indien teller <= 1 REPEAT: //Herhalen loop Set blnOut,true ENDLOOP: If(blnContact,PROCESS,CONTACT_ERROR) //Contact OK PROCESS: //OK logentry creeeren set strentry,"" ConcatEx "Contact met FTP-server ",TheServer," (",Engine,") OK",strentry //OK log schrijven mbv user-defined statement customOK strentry,"pollforfile" //Configureren FTP-settings FTPConfig("TRANSFER MODE","BINARY") //Test of Controlebestand bestaat op server FTPFileExists(TheServer,UserName,PassWord,FileNamePath,blnFound) If(blnFound,ISTHERE,NOTTHERE) //Bestand op FTP-server niet gevonden. Omdat niet ieder bestand per se gevonden hoeft te worden; foutafhandeling indien nodig elders NOTTHERE: set blnRet,False GOTO CLOSE //Bestand gevonden ISTHERE: //OK-logentry creeeren en wegschrijven mbv een user-defined statement Set strEntry,"" ConcatEx "Bestand ",FileNamePath," op server ",TheServer," (", Engine, ") gevonden",strEntry customok strEntry,"pollforfile" //Ophalen bestand FTPGetFile(TheServer,UserName,PassWord,FileNamePath,LocalNamePath) //Lokaal op aanwezigheid controleren FileExists(LocalNamePath,blnFound) If(blnFound,PROCEED,NOTHERE) //Bestand is lokaal aanwezig en dus gekopieerd PROCEED: //Creeeren OK-logentry en wegschrijven mbv een user-defined statement set strEntry,"" ConcatEx "Bestand ",FIleNamePath," van server ", TheServer," (", Engine,") succesvol gekopieerd",strEntry customok strEntry,"pollforfile" set blnRet,True GOTO CLOSE //Bestand is lokaal niet aanwezig: FOUT NOTHERE: //Creeeren Error-logentry set strEntry,"" ConcatEx "Bestand ",FileNamePath," van server ", TheServer, " (",Engine,") NIET gekopieerd!!",strEntry GOTO HANDLE_ERRORS //Contact niet OK CONTACT_ERROR: //Error logentry creeeren Set strEntry,"" ConcatEx "Contact met FTP-server ", TheServer, " (",Engine, ") niet in orde!!",strentry Goto HANDLE_ERRORS HANDLE_ERRORS: //Error log schrijven mbv user-defined statement customerror(strEntry,"s.q.broerse@getronics.nl","pollforfile") set blnRet,False CLOSE: Return blnRet
|
|
Wed Mar 12, 2003 9:12 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7964
|
|
Re: Strange PingPort problem |
|
Did you say the job runs fine in debugger but behaves incorrectly when it runs normally? Does the job have "ignore errors" property checked? If the job is set to run asynchronous please try setting it to run synchronously and check the trace files after the run. Please either check script.log file in 24x7 home directory or check [job id].log file in the Performance Data subdirectory. The latest should have complete tracing log for all runs. If you cannot file why the job breaks. Please email your scripts and the trace file to support@softtreetech.com. : This is the script for POLLFORFILE: : //*************************************************************************************** : // : //Custom Script: pollforfile : // Creatiedatum: 18-02-2003 : // Auteur: S.Q. Broerse, GBS-MDS : // Contactpersoon: J-P. Lerou, GHRS-OS : // G. v/d Steen, GHRS-OS : // Functionaliteit: Dit script voor een user-defined statement pollt voor een : bestand en indien gevonden : // haalt hij het bestand over : // Parameters: Dit script accepteert de volgende parameters: // FileNamePath: : Naam en pad bestand waarvoor gepolld wordt op FTP-server : // LocalNamePath: Naam en pad bestand waarnaartoe gekopieerd dient te worden : // TheServer: Naam FTP-server waar het bestand gezocht wordt : // ThePort: Poortnummer FTP-server : // Engine: Naam betreffende salaris-engine : // Username: Gebruikersnaam account : // Password: Wachtwoord account : // Return: Dit script geeft een boolean (TRUE of FALSE) terug. : // : : //*************************************************************************************** : : //*************************************************************************************** : // : // Wijzigingen (ook aangeven op lokatie in script) : // : // Datum: // Wijziging door: // Beschrijving wijziging: // : // Datum: // Wijziging door: // Beschrijving wijziging: // : : //*************************************************************************************** : : //*************************************************************************************** : // : // Variabele-declaraties : // : : //*************************************************************************************** : //Loop-criterium : Dim blnOut,boolean : //Geeft aan of loop afgebroken moet worden (max. 2 maal laten loopen) : Dim blnEnd,boolean : //Geeft aan of er contact met de database is : Dim blnContact,boolean : //Geeft aan of een bestand gevonden is : Dim blnFound,boolean : //Returnwaarde : Dim blnRet,boolean : //Teller voor in loop : Dim numTeller,number : //Interne teller om teller op te kunnen hogen : Dim numIntern,number : //Log-entry : Dim strEntry,string : : //*************************************************************************************** : // : // Proces : // : : //*************************************************************************************** : //Zetten boolean voor loop : Set blnOut,true : //Starten loop : LoopWhile(blnOut,ENDLOOP) : //Controleren contact met FTP-server/Salaris-engine : PingPort (TheServer,ThePort,blnContact) : //ping Theserver, blnContact : wait 5 : If(blnContact,GO_ON,NO_GO) : //Indien contact : GO_ON: //Stoppen loop : Set blnout, false : Break : //Geen contact : NO_GO: //Teller ophogen met 1 : Add(numTeller,1,numIntern) : Set numTeller, numIntern : //Test of teller > 1 is : IsGreater(numTeller,1,blnEnd) : If(blnEnd,GET_OUT,REPEAT) : //Indien teller > 1 : GET_OUT: //Stoppen loop : Set blnOut,false : Break : //Indien teller <= 1 : REPEAT: //Herhalen loop : Set blnOut,true : ENDLOOP: If(blnContact,PROCESS,CONTACT_ERROR) : //Contact OK : PROCESS: //OK logentry creeeren : set strentry,"" : ConcatEx "Contact met FTP-server ",TheServer," : (",Engine,") OK",strentry : //OK log schrijven mbv user-defined statement : customOK strentry,"pollforfile" : //Configureren FTP-settings : FTPConfig("TRANSFER MODE","BINARY") : //Test of Controlebestand bestaat op server : FTPFileExists(TheServer,UserName,PassWord,FileNamePath,blnFound) : If(blnFound,ISTHERE,NOTTHERE) : //Bestand op FTP-server niet gevonden. Omdat niet ieder bestand per se : gevonden hoeft te worden; foutafhandeling indien nodig elders : NOTTHERE: set blnRet,False : GOTO CLOSE : //Bestand gevonden : ISTHERE: //OK-logentry creeeren en wegschrijven mbv een user-defined : statement : Set strEntry,"" : ConcatEx "Bestand ",FileNamePath," op server : ",TheServer," (", Engine, ") gevonden",strEntry : customok strEntry,"pollforfile" : //Ophalen bestand : FTPGetFile(TheServer,UserName,PassWord,FileNamePath,LocalNamePath) : //Lokaal op aanwezigheid controleren : FileExists(LocalNamePath,blnFound) : If(blnFound,PROCEED,NOTHERE) : //Bestand is lokaal aanwezig en dus gekopieerd : PROCEED: //Creeeren OK-logentry en wegschrijven mbv een user-defined : statement : set strEntry,"" : ConcatEx "Bestand ",FIleNamePath," van server ", : TheServer," (", Engine,") succesvol : gekopieerd",strEntry : customok strEntry,"pollforfile" : set blnRet,True : GOTO CLOSE : //Bestand is lokaal niet aanwezig: FOUT : NOTHERE: //Creeeren Error-logentry : set strEntry,"" : ConcatEx "Bestand ",FileNamePath," van server ", : TheServer, " (",Engine,") NIET gekopieerd!!",strEntry : GOTO HANDLE_ERRORS : //Contact niet OK : CONTACT_ERROR: //Error logentry creeeren : Set strEntry,"" : ConcatEx "Contact met FTP-server ", TheServer, " : (",Engine, ") niet in orde!!",strentry : Goto HANDLE_ERRORS : HANDLE_ERRORS: //Error log schrijven mbv user-defined statement : : customerror(strEntry,"s.q.broerse@getronics.nl","pollforfile") : set blnRet,False : CLOSE: Return blnRet
|
|
Wed Mar 12, 2003 9:52 am |
|
 |
Sidney Broerse
Joined: 11 Mar 2003 Posts: 6
|
|
Re: Strange PingPort problem |
|
"Ignore Errors" was not checked. However, I was running it asynchronously. When I tried to run it synchronously, it worked just fine!!! So, thanks very much. I just have one more question (out of curiosity): Why doesn't it work asynchronously??
|
|
Thu Mar 13, 2003 4:40 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7964
|
|
Re: Strange PingPort problem |
|
In asynchronous mode some operation can be also executed asynchronously and as a result they can run concurrently which can sometimes (rarely) produce different results. : "Ignore Errors" was not checked. However, I was running it : asynchronously. : When I tried to run it synchronously, it worked just fine!!! So, thanks very : much. I just have one more question (out of curiosity): Why doesn't it work : asynchronously??
|
|
Thu Mar 13, 2003 9:33 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|