Date macros not being translated

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
timn
Posts: 184
Joined: Thu Nov 20, 2003 9:57 am
Location: United States

Date macros not being translated

Post by timn »

I can't figure out what I am doing wrong. It appears that my date macros are not being translated on my URL-method test. I have a URL-method test where the URL I'm checking includes embedded date information (month and day - ie. somefile0522.gif )

The basic test can be described as:
wrote:"if an image file does not exist for a date '3 days in the future' then raise alert"
Thus I have checked "Translate date macro variables" in the Advanced section of the URL test and I am using this date expression:
wrote:%mmdd[+3d]%
Using Wireshark, I determined that the GET request is being passed to the web server with the date macros untranslated, i.e.
wrote:GET /assets/images/anws%mmdd[+3d]%.gif HTTP/1.1
Do you see anything I'm doing wrong? Thanks!

Here are the test details:
wrote:HM Version: 8.84
RMA Agent version: 4.14

Code: Select all

Method      = Url
;--- Common properties ---
;DestFolder = Root\Development\DevT\Test1\
RMAgent     = ZTech
Title       = Image Test
Comment     = http://files.myserver.com:80/assets/images/anws%mmdd[+3d]%.gif
RelatedURL  = 
CmntPattern = %path%
ScheduleMode= Regular
Schedule    = 
Interval    = 600
Alerts      = 
ReverseAlert= No
UnknownIsBad= Yes
WarningIsBad= Yes
UseCommonLog= Yes
PrivLogMode = Default
CommLogMode = Default
;--- Test specific properties ---
URL         = http://files.myserver.com:80/assets/images/anws%mmdd[+3d]%.gif
UrlUseMacros= Yes
is302ok     = No
IgnoreUnknCA= No
UseFrames   = No
UseImages   = No
CheckContents = notcontain
Expression    = Not Found
CaseSensitive = No
WholeWordsOnly= No
ExprUseMacros = No
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Sorry, URL test cannot resolve date expressions. Only file related tests can process expressions like [+3d].
Quote from the manual
=====================
When you setup "Folder/File Size", "File/Folder Availability", "Count Files", "Text Log" or "Compare Files" tests you can set "Translate macros" option and use special macro variables in the file name:
...
Expressions
...
=====================

Regards
Alex
timn
Posts: 184
Joined: Thu Nov 20, 2003 9:57 am
Location: United States

Post by timn »

Hmmmm. Ok.

This "web server" is on a hosted service - so we cannot install RMA on the box where the file actually lives. :(

We can access the box via HTTP or via FTP/SFTP.

Can you suggest a possible alternative? Perhaps I could browse directory and search the output?
timn
Posts: 184
Joined: Thu Nov 20, 2003 9:57 am
Location: United States

Post by timn »

Alex,

Just FYI, I just tried date macro alone without expression, ie.
I wrote:assets/images/anws%mmdd%.gif
Wireshark still shows the date macro not being translated:
I wrote:GET /assets/images/anws%mmdd%.gif HTTP/1.1
This puzzles me because there is that checkbox labeled "Translate date macro variables" immediately under the "File/Path" section in Advanced.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

For URL test it should be %mm%%dd%

We thought to change this behavior and allow the same expressions that allowed by file related tests but this will lead to problems for customers that already have many URL tests...
May be we can add some switch - use old macros or new expressions :roll:

Regards
Alex
timn
Posts: 184
Joined: Thu Nov 20, 2003 9:57 am
Location: United States

Post by timn »

Ahhh, the %mm%%dd% syntax does indeed work for URL-method! Being a long-time Host Monitor customer, I clearly understand the need to not break Host Monitor for current users. :wink:

It's not clear to me if any other customers would find date macro expressions useful for URL-method tests. If I'm the only one who ever requested it, then it's probably not worth the time it would take to implement. I understand that.

What might possibly be more useful to more users - and perhaps more applicable to a wider range of situations - to might be a hook to call an external script at the time of the test to provide a test parameter such as "file path". This is just a half-baked thought, not really a suggestion.

I'm going to go re-think my reqiuirements for this test a bit. With Host Monitor, I've found that if I can't "raise the bridge" then I can almost always "lower the river". Perhaps the easiest way to solve this would be to create a PHP script on the web site that performs this test - then Host Monitor simply calls that page.

Thanks for your help on this! :)
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

We added "unofficial" option into new version so you will be able to use date expressions for URL tests (this switch will effect all URL tests you have).
If you need it right away and you can install official release 8.86, we can provide this "unofficial" update.

Regards
Alex
Post Reply