How do I post Macros in URL or HTTP tests?

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).
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

It is strange that you could not reproduce the problem... I am doing this via RCC, maybe this could be the problem?
RCC does not execute actions, so this should not be a problem.
Can you post the exact relatedURL in your test and what you entered in the request field in the HTTP Request action profile please?
I have tried HostMonitor 7.00 and 7.06 with the same parameters you are using
HTTP request: GET %RelatedURL%&Reply_Number=%Reply_Number%&AliveRatio=%RelatedURL% HTTP/1.0
Related URL: http://itdev/test/test.ASP?TEST=MonitoringServerAction
HostMonitor sent the following packet: GET http%3A%2F%2Fitdev%2Ftest%2Ftest%2EASP%3FTEST%3DMonitoringServerAction&Reply_Number=0%2E00&AliveRatio=http%253A%252F%252Fitdev%252Ftest%252Ftest%252EASP%253FTEST%253DMonitoringServerAction HTTP/1.0
H'm, there is extra %25 in second %RelatedURL% result... will check it.

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

Post by KS-Soft »

There is HostMonitor 7.07: www.ks-soft.net/download/hm707.zip
1) You may use macro for server name
2) double encoding problem has been fixed

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

You're increddible!
That's fast... Thanks.

OK, now 1 good and 1 bad news:

1- %HostAddr% now works perfectly for Host :D (THUMBS UP!)

2- %RelatedURL% does not work at the beginning of the Request :cry: :cry: but still works at the end!

I tried something: if I insert a space between test.asp and ?test, like this, the action doen't work

Code: Select all

http://itdev/test/test.ASP ?TEST=MonitoringServerAction
- So I removed the space and added these "[ ]" around my log responses to see if using %RelatedURL% inserted a space before ? and my parameters and I made sure that %RelatedURL% field was not ending with a space. I received this:

Code: Select all

Wed Dec 26 14:14:17 EST 2007	Data received: [MonitoringServerAction],[0.00],[http://itdev/test/test.ASP?TEST=MonitoringServerAction]
For now, "it looks like" there is no space in %RelatedURL%.. Anyway, it is just a guess..

I am sorry to bug you like this... Maybe I am doing something wrong...

Would you like me to send you screen shots of my HTTP Request Action Properties window? Maybe you will see right away.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Its better to send actions.lst and HML file to support@ks-soft.net

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

I sent them last night...

I will wait for your answer...
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

HostMonitor resolves variables correctly but there is interesting dilemma...
HostMonitor encodes special characters (? -> %3F, & -> %26, etc). This is necessary in some cases, e.g. you need to send reply value of the test as parameter to CGI script. If Reply field contains ? or & characters, request without encodig will be processed incorrectly by the server.
In your case such encoding make a problem because you are using variables not just as value of some parameter, you are using it as path to the script (probably its not a problem for some web servers, its not a problem for our "home made" server, but this definately leads to a problem when you are using IIS)
In other words - I do not see how HostMonitor can automatically choose processing mode for different situations :roll: In the same request, you may need encoding for one variable and "as is" mode for another variable.

Are you sure you need to store path to the script for each test item? Do you really want to store test results on 100 different servers using 100 different scripts?? Probably you may use hard coded name of the script and variable host address?

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

Alex wrote:Do you really want to store test results on 100 different servers using 100 different scripts??
You are perfectly right on this...
The page where I will post data is always going to be the same name and subpath (like /monitoring/receiver.cfm), but the domain will (of course) differ.
Sometimes the domain will use a subfolder before the standard path to the script (like www.domain.com/preprodversion/)

Like you said, maybe I could hardcode the path after the domain and only use the domain for %RelatedURL%?

Or maybe you could add a selector before the request field :
processing mode: (any one could be the default)
  • [] Keep values "As is"
    [] Encode special characters
Or maybe you could permit quotes like this:
"%RelatedURL%?TEST=MonitoringServerAction&Reply_Number=%Reply_Number%&AliveRatio=%AliveRatio%"
Or like this:
"%RelatedURL%/test/test.asp?TEST=MonitoringServerAction&Reply_Number=%Reply_Number%&AliveRatio=%AliveRatio%"

Anyhow, What do you think I should do?
Understanding my need for 100+ tests using this test profile, I would like to know how you would do it.

It doesn't really matter how the action profile is built, as long as I can use %RelatedURL% in some manner, I will then create all my tests to use this profile accordingly. If it can be "generic" I will be happy.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Or maybe you could add a selector before the request field :
processing mode: (any one could be the default)
[] Keep values "As is"
[] Encode special characters
This will not help in general case because you may need different processing rules for every occurence of the variable(s)

I think we can find compromise, HostMonitor may encode ? & = : characters but keep / and . intact. In such case you will be able to use variable for path to the script while special characters ? & should be hard coded.
E.g. GET http://%RelatedURL%?param1=%Reply%&param2=%LastReply% HTTP /1.0

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

This seems a very good compromise for me! :D

This would be perfect actually, URL in %RelatedURL% and parameters in the action profile = very intelligent and logic.

As I see, I will need to remove http:// from %RelatedURL% and hardcode it in the action profile request field?

If this is it, I am happy with what you came out with.

I guess it will be in a future release (7.0x) ? (soon I hope :roll: :lol: )

Again, let me say that I really appreciate your support, the future can only be bright for guys like you.
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

As I see, I will need to remove http:// from %RelatedURL% and hardcode it in the action profile request field?
Correct
I guess it will be in a future release (7.0x) ?
You may try this update www.ks-soft.net/download/hm707b.zip
Again, let me say that I really appreciate your support, the future can only be bright for guys like you.
Thank you. You may add something nice in this folurm http://www.ks-soft.net/cgi-bin/phpBB/viewforum.php?f=12 :wink:

Regards
Alex
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

Wow! I will try this version right after lunch.

Thanks a million times.


Post to [References & Opinions] is done.

Please have a look!

http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=4443
Robert_in_MTL
Posts: 229
Joined: Tue Jun 20, 2006 1:20 pm
Location: Montreal, Quebec

Post by Robert_in_MTL »

I couldn't wait... :roll:

Of course it works!!!

This is the RelatedURL:

Code: Select all

itdev/test/test.ASP
This is the request field:

Code: Select all

GET   http://%RelatedURL%?TEST=MonitoringServerAction&Reply_Number=%Reply_Number%&AliveRatio=%AliveRatio%    HTTP/1.0
Reply is as expected...

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

Post by KS-Soft »

You are welcome :)

Regards
Alex
Post Reply