Ad Widget

Collapse

Check if a file changed once per day

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • msi
    Junior Member
    • Sep 2009
    • 12

    #1

    Check if a file changed once per day

    We get some reports once a day (Monday till Friday between 22:00 and 24:00) which are placed in single report files on a specific windows system.

    Now we would like to check once per day (shortly after 00:00) if these reports were generated.

    We created an item "vfs.file.md5sum[C:\dataexchange\blabla.txt]" and a trigger which checks if the md5sum is different from the previous check.

    Now our problem/question: How can i configure this item, to just check once a day in a specific timeframe?

    If it checks more then once a day, the trigger fires of as the files just changes once.
  • msi
    Junior Member
    • Sep 2009
    • 12

    #2
    i just wanna post my current solution for this problem.
    Maybe someone knows some issues with this solution:

    Item: (Interval: 3600)
    vfs.file.md5sum[C:\dataexchange\blabla.txt]

    Trigger:
    {host:vfs.file.md5sum[C:\dataexchange\blabla.txt].last(0)}#{host:vfs.file.md5sum[C:\dataexchange\blabla.txt].last(#24)} & {host:vfs.file.md5sum[C:\dataexchange\blabla.txt].dayofweek(0)}<6

    So this trigger should only fire off Monday till Friday, when the file didn't change the last 24 hours (+/- 1 hour)

    Comment

    • trikke
      Senior Member
      • Aug 2007
      • 140

      #3
      Other solution would be (untested )

      {host:vfs.file.md5sum[C:\dataexchange\blabla.txt].diff(0)} > 0 & ( {host:vfs.file.md5sum[C:\dataexchange\blabla.txt].time(0)} > 220000 & {host:vfs.file.md5sum[C:\dataexchange\blabla.txt].time(0)} < 235900 )


      greets
      Patrick

      Comment

      • msi
        Junior Member
        • Sep 2009
        • 12

        #4
        Originally posted by trikke
        Other solution would be (untested )

        {host:vfs.file.md5sum[C:\dataexchange\blabla.txt].diff(0)} > 0 & ( {host:vfs.file.md5sum[C:\dataexchange\blabla.txt].time(0)} > 220000 & {host:vfs.file.md5sum[C:\dataexchange\blabla.txt].time(0)} < 235900 )


        greets
        Patrick
        my first configuration was almost like that, but:
        - the exact time of the report varies (just a few minutes normally)
        - assume an intervall 3600 for your suggestion:
        report: 22:10 h
        itemcheck: 22:15 and 23:15
        trigger: first time ok, second problem (although the report was done this day)

        - assume an intervall 7200 for your suggestion:
        report: 22:10 h
        itemcheck: 22:05
        trigger: problem (although the report was done this day)

        Comment

        Working...