Dear Ladies and Gentlemen,
thank you for developing this great plugin check_http which we use in many cases to monitor our applications.
Unfortunately in the following particular case it does not what we expect.
The following link works fine when entering it in the browser:
https://secs.siemens-enterprise.com/encs/mysap_initiateconfiguration.do?request=<?xml version='1.0' encoding='UTF-8'?><Configurator GUID='CSCKP_SWZ_sces1'><Request Transaction='RECOVER_CONFIGURATION'><CallingApplication>CSC_SWZ</CallingApplication><CSPassword>cscch001</CSPassword><Usage>VAP-W</Usage><Language>DE</Language><SubSystems/></Request></Configurator>
After a forwarding request you will receive an xml-page as a respond.
So we call this page (url-encoded) using the check_http plugin like follows:
check_http -S -v -H secs.siemens-enterprise.com --onredirect=follow -u "/encs/mysap_initiateconfiguration.do?request=%3C%3Fxml+version%3D'1.0'+encoding%3D'UTF-8'%3F%3E%3CConfigurator+GUID%3D'CSCKP_SWZ_sces1'%3E%3CRequest+Transaction%3D'RECOVER_CONFIGURATION'%3E%3CCallingApplication%3ECSC_SWZ%3C%2FCallingApplication%3E%3CCSPassword%3Ecscch001%3C%2FCSPassword%3E%3CUsage%3EVAP-W%3C%2FUsage%3E%3CLanguage%3EDE%3C%2FLanguage%3E%3CSubSystems%2F%3E%3C%2FRequest%3E%3C%2FConfigurator%3E%22" -R "HIP4000"
This works so far without an error message, but it appears as the check_http plugin does not wait for the xml-respond and therefore does not find the string "HIP4000" that is included in the xml-page and that we are looking for.
Would you kindly check this issue and let us know if we have to enter some additional parameter or if we have an bug in the plugin?
Thanks in advance!
thaham
check_http plugin
Re: check_http plugin
How long need to wait? Nagios has a time limit and on-top of that it's not good for performance and scalability to have checks taking too long.
As a rule I'd say your checks should take no more then 3 seconds. After 10 times that(30 seconds) is a good place to stop your self from waiting and at 45 seconds you should just exit with out cleaning up. At 60 seconds you are stopped and given no chance to explain your self, your exit is an error and an alert is recorded.
These can all be adjusted, but consider using passive checks instead for anything you know to take a little time.
There is also a chance that the webserver is not returning what you think and that the check command is opperating as it should. You can use network or process monitoring tools like ngrep/tcpdump/strace to verify proper opperation. However due to the dificulty some have with implementing these perhaps you should instead use debugging statements in your web-app to log acctivity.
As a rule I'd say your checks should take no more then 3 seconds. After 10 times that(30 seconds) is a good place to stop your self from waiting and at 45 seconds you should just exit with out cleaning up. At 60 seconds you are stopped and given no chance to explain your self, your exit is an error and an alert is recorded.
These can all be adjusted, but consider using passive checks instead for anything you know to take a little time.
There is also a chance that the webserver is not returning what you think and that the check command is opperating as it should. You can use network or process monitoring tools like ngrep/tcpdump/strace to verify proper opperation. However due to the dificulty some have with implementing these perhaps you should instead use debugging statements in your web-app to log acctivity.
Re: check_http plugin
Thank you for responding,
actually I am testing the plugin from commandline and this can be done independend from nagios as far as I know.
Regarding the respond time of the server I would like to ask you again to copy and paste this link into you browser:
https://secs.siemens-enterprise.com/enc ... uest=<?xml version='1.0' encoding='UTF-8'?><Configurator GUID='CSCKP_SWZ_sces1'><Request Transaction='RECOVER_CONFIGURATION'><CallingApplication>CSC_SWZ</CallingApplication><CSPassword>cscch001</CSPassword><Usage>VAP-W</Usage><Language>DE</Language><SubSystems/></Request></Configurator>
You will see that the respond time is less than 1 second.
So I would appreciate if anyone could give me a clue that points to the reason of the mentioned problem.
To me it looks like the plugin does not follow to the last page (XML-page), which you can verify if you put the link into your browser.
Thanks in advance
thaham
actually I am testing the plugin from commandline and this can be done independend from nagios as far as I know.
Regarding the respond time of the server I would like to ask you again to copy and paste this link into you browser:
https://secs.siemens-enterprise.com/enc ... uest=<?xml version='1.0' encoding='UTF-8'?><Configurator GUID='CSCKP_SWZ_sces1'><Request Transaction='RECOVER_CONFIGURATION'><CallingApplication>CSC_SWZ</CallingApplication><CSPassword>cscch001</CSPassword><Usage>VAP-W</Usage><Language>DE</Language><SubSystems/></Request></Configurator>
You will see that the respond time is less than 1 second.
So I would appreciate if anyone could give me a clue that points to the reason of the mentioned problem.
To me it looks like the plugin does not follow to the last page (XML-page), which you can verify if you put the link into your browser.
Thanks in advance
thaham
Re: check_http plugin
Yes, because of special carecters this may not pass through a shell. You will have to use proper escaping.
There will be several versions of the same URL each used in diffrent situations, but all having the same effect.
There will be several versions of the same URL each used in diffrent situations, but all having the same effect.
Re: check_http plugin
NO, the arguments has passed successfully. I have already investigated this.
The Server has received all necessary parameters correctly and answers with "..Connecting to Siemens Enterprise Configuration System. Please wait...".
So this is not the reason. (Please find the appended Logfile provided by the check_http plugin -v option).
I would appreciate if you could investigate why the plugin does not receive the following xml-page wich is sent by the server in a second step afterwards.
Maybe the server expects something from the browser that the check_http can not provide, like cookies or sending post data or whatever, etc...
Thanks in advance!
thaham
The Server has received all necessary parameters correctly and answers with "..Connecting to Siemens Enterprise Configuration System. Please wait...".
So this is not the reason. (Please find the appended Logfile provided by the check_http plugin -v option).
I would appreciate if you could investigate why the plugin does not receive the following xml-page wich is sent by the server in a second step afterwards.
Maybe the server expects something from the browser that the check_http can not provide, like cookies or sending post data or whatever, etc...
Thanks in advance!
thaham
You do not have the required permissions to view the files attached to this post.
Re: check_http plugin
I'm unable to quote this properly for a shell. Neither of your examples are quoted properly as far as my testing can conclude. This is the closest I can get passing the URL via a file handle.
If you put this URI into a file and sourced it with cat that should work for you.
Code: Select all
root@ubuntu:/usr/lib/nagios/plugins# ./check_http -s'Connecting to Siemens Enterprise Configuration System. Please wait.' -H secs.siemens-enterprise.com --ssl -u "$(cat)"
/encs/mysap_initiateconfiguration.do?request=%3C?xml%20version='1.0'%20encoding='UTF-8'?%3E%3CConfigurator%20GUID='CSCKP_SWZ_sces1'%3E%3CRequest%20Transaction='RECOVER_CONFIGURATION'%3E%3CCallingApplication%3ECSC_SWZ%3C/CallingApplication%3E%3CCSPassword%3Ecscch001%3C/CSPassword%3E%3CUsage%3EVAP-W%3C/Usage%3E%3CLanguage%3EDE%3C/Language%3E%3CSubSystems/%3E%3C/Request%3E%3C/Configurator%3E
HTTP OK: HTTP/1.1 200 OK - 17041 bytes in 2.165 second response time |time=2.165254s;;;0.000000 size=17041B;;;0