Extensions
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Synthetic SFTP monitor (2.4.0)

JPRio1
Observer

Hello, I'm using the extension Synthetic SFTP monitor (2.4.0) to detect if a file is not processed by a client (older than 10mn). Apparently this is not working for me.  
I rode the code of the extension and saw (if I'm not mistaken) that the file age is tested only if the file suffix is provided : 

                    if (configuration.test.process_file_suffix
                        and configuration.test.process_file_age
                        and process_file.filename == str(configuration.upload.local_path.replace('\\', '/').split('/')[-1] + configuration.test.process_file_suffix)):
                        self.logger.debug(f"{process_file.filename} ends in `{configuration.test.process_file_suffix}`.")
                        within_limit = self.is_file_within_age_limit(process_file, processing_time, configuration.test.process_file_age)

In my case, there is no suffix when the file is handled by the consumer. I think that's why the detection is not working for me. Is it necessary to leave this condition ?
BR,
JP

2 REPLIES 2

sujit_k_singh
Champion

Hi @JPRio1 

Spot on analysis! That truthy check on process_file_suffix is definitely skipping the age calculation if you leave the suffix blank. It shouldn't be required—the extension should ideally support checking the age of the base file without needing a suffix added by the consumer. As a workaround if you can edit the script, you could update the condition to something like:

suffix = configuration.test.process_file_suffix or ""
expected_name = str(configuration.upload.local_path.replace('\\', '/').split('/')[-1]) + suffix

if configuration.test.process_file_age and process_file.filename == expected_name:
# age check logic

Dynatrace Professional Certified

Thanks @sujit_k_singh . That could be a work around. But I have many active gates, and also it would be erased at each extension update. I would prefer a fix...

Featured Posts