Alerting – Need Help With Finding Out If File Exists

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Alerting – Need Help With Finding Out If File Exists

  • Creator
    Topic
  • #55567
    Sterling Jones
    Participant

      I am attempting to setup an alert that sends an email if a file is missing before FTP pickup. The alert will run before the scheduled job.

      Normally I would use “filesize” alert and set the source (remote directory on server within network); source count: all; comparing: != -1; duration: once; within a few minutes of when the connection is scheduled to read. I have had success with this elsewhere, but what I am finding is that I can’t get it to work when there is another directory within the source directory. The file name also is not static (i.e., date appended to end of name), so I can’t set a specific filename in the source of the alert.

      This location is typically where we have an archive directory that keeps a copy of the file just moved by the job. So, I will have this setup:

      ./[source]

      ./[source]/archive

      The alert appears to be reading that something exists as I think it is hitting the child archive directory. Setting a specific name in the source won’t work because the file name is dynamic. I can’t seem to get any sort of wildcard matching in the source to work, either.

      I have fiddled with having a TCL alert instead and passing the pattern as an arg, but am having little luck with following the documentation. If TCL alert is the path to take, I would like to setup a generic script that can pass some standardized args. Would I need to pass the directory as an arg as well? Any help would be great

    Viewing 0 reply threads
    • Author
      Replies
      • #85780
        Jim Kosloskey
        Participant

          I have used the dirparse UPoC with some success to things like this.

          At the dirparse UPoC you will receive a list of files found after directory scan but prior to reading. You could check that list and if your file is not there take whatever action you want (including returning an empty list so no files get processed.

          For example, I have a proc used at the dirparse UPoC which checks to see if the list is empty (meaning no files were found). If that condition is true, the proc sends emails/pages to the appropriate individuals. Since the list is empty, no files get processed.

          I also use this proc stacked after another proc which modifies the files found list. So if after modifying the files found no files exist I can notify.

          You should be able to do something similar or email me if you want my proc(s) as examples or to use.

          Others may be able to assist you in getting the Alert Configuration to work but I have no insight there.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.