infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Cloverleaf
error running FTP inside alert tcl
Peter Heggie
I'm trying to use the ftp package inside an alert tcl. The alert is checking if a remote file has been created and is ready for processing by Cloverleaf. Maybe I should just run this script from the command line using cron, but I want to put all my monitors in the Cloverleaf alert function, as much as possible.
I've been successful at executing other tcl procs inside the monitor, but I can't get the ftp functions to work.
If I don't specify a timeout, there are no messages, it just hangs. If I have a timeout specified, I get these messages:
error error | E: Timeout of control connection after 10 sec.!:
error can't read "_ncfg_ProcessData(hcimonitord)": no such element in array
error while executing
error "set data $_ncfg_ProcessData($proc) "
I've tried just a single proc with all the FTP commands, and I've tried splitting it up into a 'main' proc and called procs within a namespace, so that I could specify an output routine on the ftp::Open call, but as far as I can tell, this output proc is not invoked.
Can I assume that the ftp package is being pulled in via the package require ftp because I see 'control connection' mentioned in the error message?
Should I just invoke an 'exec' statement in the tcl to call an external tcl? It would inherit the same environment though, right?
I would appreciate any clues.
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
Peter,
Maybe I am missing something but why not have a Fileset/FTP prtocol thread look throught the day (or at scheduled times) to see if a file is there?
Then do whatever it is you want to do with that file.
Peter Heggie
Hi Jim,
I need to raise an alert if the file is not there. It will only be produced once a day, and the responsible group wants to be emailed if the file is not created.
If I use a directory tcl on the inbound protocol, is it triggered no matter if a file is there or not? If so, I still have to create an email if the file is missing. And there are two different files, with more coming in the future, so I need the process to be generic. If I use the directory tcl, I need to be able to specify the file names in a generic, consistent way.
Jim Kosloskey
Peter,
OK in release 5.6 Cloverleaf which we are on, an 'error' status is raised when there are no files to be FTP'd and there is an entry in the log that indicates no files were found as a result of the nlst command (550 No Files Found and RETR response: 550). However those values are not available for use.
I know in a later release the FTP protocol was changed and maybe this no longer throws an error but rather provides something nice (I would think the best solution would be to provide an empty list to the dirparse UPoC then you could use a proc to see if the list were empty.
At a previous hospital what we did to overcome this was to have a never to be delted file always resident in teh source directory. Then the thread would alwyas find one file but we would eliminate that file from the dirparse list in the dirparse UPoC and check to see if the list was then empty - if it was that meant the only file there was the default file which means the source system did not place a file.
Fortunately we were able to do the above with virtually all of our systems so this work-around sufficed for us.
One could always make the assumption the 'error' status means files not found and use that status to alert that fact. However, if there is any other error, the alert could be mis-leading.
I don't know what release of Cloverleaf you are on but if you are on 5.8 I would be interested in knowing if a no files found situation still raises an 'error' status - or what the outward indication is.
Peter Heggie
I will try the dirparse UPOC. We are on 5.8.4, and I'll let you know how an empty directory is returned.
As I add new monitors, like checking for messages in the error or recovery DB, or checking for successful cron jobs, I make sure to append one line to a daily monitor summary file that is emailed every morning, which will list each monitor that ran, a return code and an an error description. I only want emails for individual monitors to go out if there is an error, otherwise, everybody only gets the one summary email. To do this, my monitors need to open the summary file for append and write a record to it. So this dirparse UPOC needs to evaluate the directory for a specified list of files and report errors on each one (not found), send an email if specified with enough information to identify the problem file and append a line of data to the daily report summary file. Hopefully thats not too much activity in a dirparse UPOC.
This is an example of the daily report summary email. The email font is fixed when it is delivered.
Daily Batch Monitor Report - 02/28/2012
time interface check for report file RC status
--
07:15:02 audit_purge cron execution /home/hci/logs/purge_audit.log 0 ok - cron file has been updated within the last 30 minutes
12:15:01 smatr_audit_12 cron execution /home/hci/logs/smatr_audit_1207.log 0 ok - cron file has been updated within the last 30 minutes
17:15:03 smatr_audit_17 cron execution /home/hci/logs/smatr_audit_1707.log 0 ok - cron file has been updated within the last 30 minutes
01:00:03 smatr_audit_00 cron execution /home/hci/logs/smatr_audit_0050.log 0 ok - cron file has been updated within the last 30 minutes
01:40:04 clean_smat cron execution /prod/crons/smatArchive.log 0 ok - cron file has been updated within the last 500 minutes
02:15:04 uds_ftp cron execution /tmp/udsftp.adt.chbthprd.ftp 0 ok - cron file has been updated within the last 500 minutes
02:40:00 clean_local_smat cron execution /prod/crons/localsmatArchive.log 0 ok - cron file has been updated within the last 500 minutes
05:50:04 smatr_audit_05 cron execution /home/hci/logs/smatr_audit_0540.log 0 ok - cron file has been updated within the last 30 minutes
06:30:02 Error DB messages queued /tmp/hci_rpt_chonlprd_err_db 8 error - 18 msgs found in Err DB for chonlprd - see email
06:30:03 Error DB messages queued /tmp/hci_rpt_cmonlprd_err_db 0 ok - no messages found in Error DB for cmonlprd
06:30:03 Error DB messages queued /tmp/hci_rpt_chbthprd_err_db 0 ok - no messages found in Error DB for chbthprd
06:30:04 Recov DB messages queued /tmp/hci_rpt_chbthprd_rec_db 0 ok - no messages found in Recovery DB for chbthprd
06:40:00 save_RHIO_smat cron execution /home/hci/logs/saveSmatArchive.log 0 ok - cron file has been updated within the last 500 minutes
Jim Kosloskey
Peter,
If you want to email me and we can discuss this off-line.