Problem with Date Macros

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
stsch
Posts: 2
Joined: Fri May 16, 2008 4:29 am

Problem with Date Macros

Post by stsch »

Hello,

date macros do not work correctly for me. I need to look for a file from yesterday, so I use "%dd[-1d]%" but it doesn't work. "%dd%" just works fine. We use Advanced Hostmonitor v7.22c. Any ideas?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Could you provide more information, please?
- Do you use date macro variables with tests or actions? What exat test method do you use? What exact action? What exact field?
- I suppose, you are using %yyyy% or/and %mm% variables also, right?

Regards,
Max
stsch
Posts: 2
Joined: Fri May 16, 2008 4:29 am

Post by stsch »

I defined a "Folder/File Availibility" test by Hostmonitor (Enterprise) that should look for a daily image of a server "\\192.168.1.111\Backup\e010_pdc_%ddd[-1d]%.tib". Alert when file doesn't exist or older than 2880 min. Translate macros is enabled.

Since there seems to be no easy way to see how the macros are resolved, I've sent me a debug message with the filename in it, with and without [-1d]. The second filename (..%ddd%..) resolves as expected, first doesn't, this is what I get:

\\192.168.1.111\Backup\e010_pdc_%ddd[-1d]%.tib
\\192.168.1.111\Backup\e010_pdc_Mo.tib
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

In fact, I cannot reproduce the problem. e010_pdc_%ddd[-1d]%.tib variable is properly resolved for e010_pdc_Sun.tib file name and e010_pdc_%ddd%.tib is properly resolved for e010_pdc_Mon.tib file name.

Have you enabled "Translate macros" opion in "Test Properties" window?
Could you disable "older than 2880 m" option and leave "Alert when file doesn't exist" option only? Just for testing?

On the another hand, as I can see, you are trying to check file on remote server. Is HostMontor started as a service or as an application? What account have you specified for HostMonitor's serice? You may use "Connection manager" to specify certain account to perform "Folder/File Availability" test on remote machine: http://www.ks-soft.net/hostmon.eng/mfra ... htm#conmgr

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

Post by KS-Soft »

PS
I've sent me a debug message with the filename in it, with and without [-1d]. The second filename (..%ddd%..) resolves as expected, first doesn't, this is what I get:
\\192.168.1.111\Backup\e010_pdc_%ddd[-1d]%.tib
\\192.168.1.111\Backup\e010_pdc_Mo.tib
Actions do not support such expressions (%ddd[-1d]%)
http://www.ks-soft.net/hostmon.eng/mfra ... #timemacro

You may use the following variables as parameters of the action triggered by "File/Folder Availability" test method
%FileName%
%FileSize%
%FileTime%

Regards
Alex
Post Reply