View previous topic :: View next topic |
Author |
Message |
timn
Joined: 20 Nov 2003 Posts: 184 Location: United States
|
Posted: Wed May 25, 2011 3:29 pm Post subject: Date macros not being translated |
|
|
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:
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: | 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 |
|
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12798 Location: USA
|
Posted: Wed May 25, 2011 3:37 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
timn
Joined: 20 Nov 2003 Posts: 184 Location: United States
|
Posted: Wed May 25, 2011 3:45 pm Post subject: |
|
|
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? |
|
Back to top |
|
|
timn
Joined: 20 Nov 2003 Posts: 184 Location: United States
|
Posted: Wed May 25, 2011 3:54 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12798 Location: USA
|
Posted: Wed May 25, 2011 5:20 pm Post subject: |
|
|
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
Regards
Alex |
|
Back to top |
|
|
timn
Joined: 20 Nov 2003 Posts: 184 Location: United States
|
Posted: Thu May 26, 2011 7:18 am Post subject: |
|
|
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.
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! |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12798 Location: USA
|
Posted: Mon May 30, 2011 1:21 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
|