Problem with Date Variables

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
UKortkamp
Posts: 24
Joined: Thu Dec 01, 2005 9:02 am

Problem with Date Variables

Post by UKortkamp »

Hello Community,
Exchange names its log files in the UTC Time format: e. g. RECV2021061811-1.log
for 18. June 2021 11:00 - Instance 1
But local time is 13:00 (GMT+1 and Summertime)

To search the log files for a string I try RECV%yyyymmdd%%hh[-2h]%-1.log

Alternately tried: RECV%yyyymmddhh[-2h]%-1.log

No matter which formatting I enter, HM sends me back "Unknown."
If I explicitly enter a LogFileName (like the example above) the search string is found.

With variables, the checkmark “Translate macros� is activated.

The funny thing: if i use %NewestFile% instead RECV%yyyymmdd%%hh[-2h]%-1.log i get no error -- but even no result.


a) What am I doing wrong?
b) there is a way to see how the translated variables look => which file HM trying to open?




HM Latest Version 12.90

Kind regards
Uwe
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

There are no such option [-2h]. You may add/substract days, months or years.
Do you use Text Log test? And you want to check latest log file? Then use %NewstFile% variable

Regards
Alex
UKortkamp
Posts: 24
Joined: Thu Dec 01, 2005 9:02 am

Post by UKortkamp »

Thanks for your fast answer Alex
KS-Soft wrote:There are no such option [-2h]. You may add/substract days, months or years.
According the examples it was my hope that "H" also works... OK: explains the Unknown-Error :-)
KS-Soft wrote: Do you use Text Log test? And you want to check latest log file? Then use %NewstFile% variable
%NewstFile% or %NewestFile% (from Doku).
ukortkamp wrote: The funny thing: if i use %NewestFile% instead RECV%yyyymmdd%%hh[-2h]%-1.log i get no error -- but even no result.
Kind regards
Uwe
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

What means "no result"? Ok test status?
Text Log tests does not check old records in the log. It checks only new records (added since previous check).
If you need to check all (old) records, use Compare Files test

Regards
Alex
UKortkamp
Posts: 24
Joined: Thu Dec 01, 2005 9:02 am

Post by UKortkamp »

KS-Soft wrote:What means "no result"? Ok test status?
"no result" means:
i put in a search string which appears all ~5 min and wait about 30 min and get no "BAD" Message.

Same Test with explicitly enter a LogFileName (according to actually time) i get a "BAD Message" after 5 min.

Therefore my question if I can see somewhere in the log how the variables were resolved at runtime to determine which file was effectively read.

Kind regards and thanks for your help.
Uwe
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

https://www.ks-soft.net/hostmon.eng/mfr ... .htm#macro
the following variables provide information about the file detected by Folder/File Availability test method or the file processed by other file-related test methods (Text Log, Folder/File Size and Compare Files).
%FileName% - Name of the file. Useful when you setup the test using wildcards or variables in "filename" field.

Regards
Alex
UKortkamp
Posts: 24
Joined: Thu Dec 01, 2005 9:02 am

Post by UKortkamp »

KS-Soft wrote:https://www.ks-soft.net/hostmon.eng/mfr ... .htm#macro
the following variables provide information about the file detected by Folder/File Availability test method or the file processed by other file-related test methods (Text Log, Folder/File Size and Compare Files).
%FileName% - Name of the file. Useful when you setup the test using wildcards or variables in "filename" field.

Regards
Alex
Thanks!
That seems the problem:

Image

HM is looking in RECV2021062111-1.LOG (Top of the hardcopy ist the notify subject from "GOOD: Teste %FileName%")
Bottom of the hardcopy is same folder from explorer view with RECV2021062112-1.LOG as newest file

Edit: no Webspace to share the img - and OneDrive only generates those links..

Edit 2: Found space :-)

SORRY
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

time of last modification for both files?
I think since Windows Vista some Windows functions may report wrong file size and time in case file is still open..

Regards
Alex
UKortkamp
Posts: 24
Joined: Thu Dec 01, 2005 9:02 am

Post by UKortkamp »

KS-Soft wrote:time of last modification for both files?
I think since Windows Vista some Windows functions may report wrong file size and time in case file is still open..

Regards
Alex
You are right!
LastModify Time of RECV2021062112-1.LOG and RECV2021062111-1.LOG are absolute identical. Dont know why "12" ist not updated when Exchange writes new log entries!?

Is there any possibility to take "Last Creation Time" instead "Last Modify Time" or to integrate a [-xh] Option?

Regards
Uwe
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Please e-mail to support, we will provide update

Regards
Alex
Post Reply