can't monitor a web page which need to authorize
can't monitor a web page which need to authorize
Hi Alex,
I feel HM works not very well when monitor a web page which need to authorize.
For Example, I want to monitor the web service page of HM, log in first,then if http-contents not include " unknown : 0" then alarm.
I have tried lots of times, it seems I can not make HM work well.
I hope the reason is that I set the wrong parameters, can you try that and help me?
Thanks.
I feel HM works not very well when monitor a web page which need to authorize.
For Example, I want to monitor the web service page of HM, log in first,then if http-contents not include " unknown : 0" then alarm.
I have tried lots of times, it seems I can not make HM work well.
I hope the reason is that I set the wrong parameters, can you try that and help me?
Thanks.
What exactly authorization method do you use?
Just yesterday we spoke about similar problem, please read this topic: http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=2870
Regards
Alex
Just yesterday we spoke about similar problem, please read this topic: http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=2870
Regards
Alex
I have read that , it's helpful. Now I can test the web service of HM, it works well.KS-Soft wrote:please read this topic: http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=2870
The most of applications I need to monitor is the web page which wrote by asp.net, the login information is with _viewstate. I have not made this kind of test worked until now. Can HM do that ?KS-Soft wrote:What exactly authorization method do you use?
Thanks ALEX.
BTW,another question please:
two bad status actions in a action profile,how can I let the second action start after the first action has finished,or after 1 minute the first action started? The test is a NT event test, bad status only occurs one time normally, can't use "start when 2 consecutive bad occurs".
two bad status actions in a action profile,how can I let the second action start after the first action has finished,or after 1 minute the first action started? The test is a NT event test, bad status only occurs one time normally, can't use "start when 2 consecutive bad occurs".
As I understand, you have some pages, protected by password. Thus, you have web page with HTML form to input username/password.leo1631 wrote:The most of applications I need to monitor is the web page which wrote by asp.net, the login information is with _viewstate. I have not made this kind of test worked until now. Can HM do that ?
Obviously, HM can not submit HTML form but you could do it as described in foregoing mentioned topic.
- use URL string to send parameters if your web form and script uses GET method
- use HTTP test method and "Post data" option if your web form uses POST method
E.g. after you submit login form, it leads you to some srv page, that checks your credentials and fills _viewstate variable (or something like that) and redirects you to page, that could be available only for logged in users. You may use mentioned above method to make HM connect directly to this srv page with parameters username/password/etc. In case Get method it should be looking like that: http://www.somesite.com/check_credentia ... sword=test
Regards,
Yoorix
If 2 actions have the same value of the "Start when XX consecutive Bad/Good results occur" option, actions will be started in creation order.leo1631 wrote:two bad status actions in a action profile,how can I let the second action start after the first action has finished,or after 1 minute the first action started? The test is a NT event test, bad status only occurs one time normally, can't use "start when 2 consecutive bad occurs".
Could you explain what actions you want to start? There are some restrictions: if you create text file using some external program and "Execute external program" action, HostMonitor will start external program but it will not wait until program terminates. In this case you can use "Run HMScript" action (instead of "Execute external program" action) with single command "ExecuteProgram <time_to_wait> <command_line>"
Regards,
Yoorix
Yes,perfectly right.Yoorix wrote:As I understand, you have some pages, protected by password. Thus, you have web page with HTML form to input username/password.
E.g. after you submit login form, it leads you to some srv page, that checks your credentials and fills _viewstate variable (or something like that) and redirects you to page, that could be available only for logged in users.
I known little about asp.net, the page uses POST method, I have sniffered the data between client and web server when login, using the iris tool. But whatever I fill the "Post data" field, HM can not pass through the login form.Yoorix wrote:Obviously, HM can not submit HTML form but you could do it as described in foregoing mentioned topic.
- use URL string to send parameters if your web form and script uses GET method
- use HTTP test method and "Post data" option if your web form uses POST method
You may use mentioned above method to make HM connect directly to this srv page with parameters username/password/etc. In case Get method it should be looking like that: http://www.somesite.com/check_credentia ... sword=test
Can you help me if I mail the sniffered data to you?
The actions I want to start (by rma): AT first,stop a service;after that service has been stopped or after about 1 minute,stop another service.The first service depends on the second, it seems that the second service can't be stopped untile the first has finished stopping.Yoorix wrote:Could you explain what actions you want to start? There are some restrictions: if you create text file using some external program and "Execute external program" action, HostMonitor will start external program but it will not wait until program terminates. In this case you can use "Run HMScript" action (instead of "Execute external program" action) with single command "ExecuteProgram <time_to_wait> <command_line>"
Thanks Yoorix and sorry for my poor English.
As I've mentioned above, if 2 actions have the same value of the "Start when XX consecutive Bad/Good results occur" option, actions will be started in creation order. So, you should create profile with two actions:leo1631 wrote:The actions I want to start (by rma): AT first,stop a service;after that service has been stopped or after about 1 minute,stop another service.The first service depends on the second, it seems that the second service can't be stopped untile the first has finished stopping.
1. Stop first service
2. Stop second service
According to documentation they should be started consecutively (not simultaneously).
If you do not like such method, you are able do following things:
You should create .bat file, i.e. D:\temp\stop_services.bat, and write there two lines:
net stop "Service1Name"
net stop "Service2Name"
Then you should specify such .bat file to execute on "Run external command" Action. Or you may use "Run HMScript" action. To do that you should create .hms file contains one line "ExecuteProgram 5000 D:\TEMP\test.bat"
Regards,
Yoorix
I do not think you should use sniffer, all what you need, is lying in front of you, in HTML source of login page.leo1631 wrote:I known little about asp.net, the page uses POST method, I have sniffered the data between client and web server when login, using the iris tool.
Actually, HM can not pass thru login form, but it must not do it. In URL field of URL or HTTP test you should specify NOT login page url, but url of page, where login page leads you after submit. You should in your browser invoke view source for login page, and find tag <Form>. "Action" attribute of tag <Form> provides url page we are looking for. So, in URL field of appropriate test you shoud provide this url. Understand? Lets continue.leo1631 wrote:But whatever I fill the "Post data" field, HM can not pass through the login form. Can you help me if I mail the sniffered data to you?
You should find all tags <input> and concatenate attribute name of each one into one string, i.e.: username=your_username&password=your_password etc. Where your_username/your_password means your really credentials.
Such string you should provide in "Post data" field of HTTP test, or concatenate with URL field using '?' if you will use URL test. Do not forget mark "Follow redirect" option. It might be important.
Regards,
Yoorix
Yes, HostMonitor starts actions in creation order (if both actions have the same "Condition to start" settings). However in case of "stop service" action, HostMonitor will start second action without waiting for 1st action completion.1. Stop first service
2. Stop second service
According to documentation they should be started consecutively (not simultaneously).
If you do not like such method, you are able do following things:
You should create .bat file, i.e. D:\temp\stop_services.bat, and write there two lines:
net stop "Service1Name"
net stop "Service2Name"
So, in this case you should use .BAT file. To start BAT file you may use "Execute external program" actions, its more simple than HMScript action.
Regards
Alex
About the question of actions, it works at last.
Good idea, it works very well. Thank Yoorix and Alex.Yoorix wrote:You should create .bat file, i.e. D:\temp\stop_services.bat, and write there two lines:
net stop "Service1Name"
net stop "Service2Name"
That is the point, so the second service can't be stopped because the first one hasn't finished stopping.KS-Soft wrote:However in case of "stop service" action, HostMonitor will start second action without waiting for 1st action completion.
Sometimes maybe not. I found another strange thing when I try to stop more than one service.KS-Soft wrote:HostMonitor starts actions in creation order (if both actions have the same "Condition to start" settings).
I created 3 actions at this order:action_name1-stop a service named "reforward";action_name2-stop a service named "xms";action_name3-stop a service named "message".
The strange thing is that when the action profile is trigged, the executed order is action_name3,action_name1,action_name2, NOT the creation order. I guess maybe HM work at the ASCII order of service name.
Please check that if necessary, executed by rma.
Thank Yoorix for explaining the detail. I have tried many times according to the above, It still doesn't work.Yoorix wrote:You should in your browser invoke view source for login page, and find tag <Form>. "Action" attribute of tag <Form> provides url page we are looking for. So, in URL field of appropriate test you shoud provide this url. Understand? Lets continue.
You should find all tags <input> and concatenate attribute name of each one into one string, i.e.: username=your_username&password=your_password etc. Where your_username/your_password means your really credentials.
Such string you should provide in "Post data" field of HTTP test, or concatenate with URL field using '?' if you will use URL test. Do not forget mark "Follow redirect" option. It might be important.
Following is from source code of my login page, include <form> tag and all of <input> tags:
------------------------------------------------------------------------
<form name="serverForm" method="post" action="SignInPage.aspx?ru=http%3a%2f%2f10.77.8.205%2fwett%2fDefault.aspx&to=-2&aid=TestSignInPage&ip=10.77.13.38&lou=http%3a%2f%2f10.77.8.205%2fHBWebApp%2fHBPassportService%2fTestPage%2fTestLogOff.aspx" id="serverForm">
<input type="hidden" name="__VIEWSTATE" value="......" />
<input name="SignInControl:_ctl0:clientEnv" id="SignInControl__ctl0_clientEnv" type="hidden" />
<input name="SignInControl:_ctl0:signInName" type="text" value="leo1631" id="SignInControl__ctl0_signInName" class="flatInput" size="32" />
<input name="SignInControl:_ctl0:password" id="SignInControl__ctl0_password" type="password" size="32" class="flatInput" />
<input type="submit" name="SignInControl:_ctl0:SignInButton" value="login" id="SignInControl__ctl0_SignInButton" class="flatButton" style="width:64px;" />
<input id="SignInControl__ctl0_dontSaveUserName" type="checkbox" name="SignInControl:_ctl0:dontSaveUserName" />
-------------------------------------------------------------
As Yoorix told me ,I provide in "Post data" field of HTTP test with this string :
--------------------------------------------------------------------
SignInControl:_ctl0:signInName=leo1631&SignInControl:_ctl0:password=123456
------------------------------------------------------------------------------------
But it does not work, it seems just like do not post the string at all.
this kind of test is very important to me.
Help me and thanks a lot.