Zabbix Documentation 4.4

3.04.04.24.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.4Guidelines

User Tools

Site Tools


manual:web_monitoring

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:web_monitoring [2019/01/23 10:18]
martins-v updating screenshots
manual:web_monitoring [2019/06/13 06:01] (current)
martins-v linking to Kerberos auth example
Line 44: Line 44:
 The **Scenario** tab allows you to configure the general parameters of a web scenario. The **Scenario** tab allows you to configure the general parameters of a web scenario.
  
-{{manual:​config:​scenario.png?600|}}+{{manual:​config:​scenario0.png|}}
  
 All mandatory input fields are marked with a red asterisk. ​ All mandatory input fields are marked with a red asterisk. ​
Line 58: Line 58:
 |//​Attempts// ​ |The number of attempts for executing web scenario steps. In case of network problems (timeout, no connectivity,​ etc) Zabbix can repeat executing a step several times. The figure set will equally affect each step of the scenario. Up to 10 attempts can be specified, default value is 1.\\ //Note//: Zabbix will not repeat a step because of a wrong response code or the mismatch of a required string.\\ This parameter is supported starting with //Zabbix 2.2//​. ​ | |//​Attempts// ​ |The number of attempts for executing web scenario steps. In case of network problems (timeout, no connectivity,​ etc) Zabbix can repeat executing a step several times. The figure set will equally affect each step of the scenario. Up to 10 attempts can be specified, default value is 1.\\ //Note//: Zabbix will not repeat a step because of a wrong response code or the mismatch of a required string.\\ This parameter is supported starting with //Zabbix 2.2//​. ​ |
 |//​Agent// ​ |Select a client agent.\\ Zabbix will pretend to be the selected browser. This is useful when a website returns different content for different browsers.\\ User macros can be used in this field, //starting with Zabbix 2.2//​. ​ | |//​Agent// ​ |Select a client agent.\\ Zabbix will pretend to be the selected browser. This is useful when a website returns different content for different browsers.\\ User macros can be used in this field, //starting with Zabbix 2.2//​. ​ |
-|//HTTP proxy// ​ |You can specify an HTTP proxy to use, using the format: //%%http://​[username[:​password]@]proxy.mycompany.com[:​port]%%//​\\ By default, 1080 port will be used.\\ If specified, the proxy will overwrite proxy related environment variables like http_proxy, HTTPS_PROXY. If not specified, the proxy will not overwrite proxy related environment variables.\\ The entered value is passed on "as is", no sanity checking takes place. You may also enter a SOCKS proxy address. If you specify the wrong protocol, the connection will fail and the item will become unsupported. With no protocol specified, the proxy will be treated as an HTTP proxy.\\ //Note//: Only simple authentication is supported with HTTP proxy.\\ User macros can be used in this field.\\ This parameter is supported starting with //Zabbix 2.2//​. ​ |+|//HTTP proxy// ​ |You can specify an HTTP proxy to use, using the format ​''​%%[protocol://][username[:​password]@]proxy.mycompany.com[:​port]%%''​.\\ This sets the [[https://curl.haxx.se/​libcurl/​c/​CURLOPT_PROXY.html|CURLOPT_PROXY]] cURL option.\\ The optional ''​%%protocol://​%%''​ prefix may be used to specify alternative proxy protocols (the protocol prefix support was added in cURL 7.21.7). With no protocol specified, the proxy will be treated as an HTTP proxy.\\ By default, 1080 port will be used.\\ If specified, the proxy will overwrite proxy related environment variables like http_proxy, HTTPS_PROXY. If not specified, the proxy will not overwrite proxy-related environment variables. The entered value is passed on %%"%%as is%%"%%, no sanity checking takes place.\\ You may also enter a SOCKS proxy address. If you specify the wrong protocol, the connection will fail and the item will become unsupported.\\ //​Note// ​that only simple authentication is supported with HTTP proxy.\\ User macros can be used in this field.\\ This parameter is supported starting with //Zabbix 2.2//​. ​ |
 |//​Variables// ​ |Variables that may be used in scenario steps (URL, post variables).\\ They have the following format:\\ **{macro1}**=value1\\ **{macro2}**=value2\\ **{macro3}**=regex:<​regular expression>​\\ For example:\\ {username}=Alexei\\ {password}=kj3h5kJ34bd\\ {hostid}=regex:​hostid is ([0-9]+)\\ The macros can then be referenced in the steps as {username}, {password} and {hostid}. Zabbix will automatically replace them with actual values. Note that variables with ''​regex:''​ need one step to get the value of the regular expression so the extracted value can only be applied to the step after.\\ If the value part starts with ''​regex:''​ then the part after it is treated as a regular expression that searches the web page and, if found, stores the match in the variable. At least one subgroup must be present so that the matched value can be extracted.\\ Regular expression match in variables is supported //since Zabbix 2.2//.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2.\\ Variables are automatically URL-encoded when used in query fields or form data for post variables, but must be URL-encoded manually when used in raw post or directly in URL.  | |//​Variables// ​ |Variables that may be used in scenario steps (URL, post variables).\\ They have the following format:\\ **{macro1}**=value1\\ **{macro2}**=value2\\ **{macro3}**=regex:<​regular expression>​\\ For example:\\ {username}=Alexei\\ {password}=kj3h5kJ34bd\\ {hostid}=regex:​hostid is ([0-9]+)\\ The macros can then be referenced in the steps as {username}, {password} and {hostid}. Zabbix will automatically replace them with actual values. Note that variables with ''​regex:''​ need one step to get the value of the regular expression so the extracted value can only be applied to the step after.\\ If the value part starts with ''​regex:''​ then the part after it is treated as a regular expression that searches the web page and, if found, stores the match in the variable. At least one subgroup must be present so that the matched value can be extracted.\\ Regular expression match in variables is supported //since Zabbix 2.2//.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2.\\ Variables are automatically URL-encoded when used in query fields or form data for post variables, but must be URL-encoded manually when used in raw post or directly in URL.  |
 |//​Headers// ​ |Custom HTTP headers that will be sent when performing a request.\\ Headers should be listed using the same syntax as they would appear in the HTTP protocol, optionally using some additional features supported by the [[http://​curl.haxx.se/​libcurl/​c/​CURLOPT_HTTPHEADER.html|CURLOPT_HTTPHEADER]] cURL option.\\ For example:\\ Accept-Charset=utf-8\\ Accept-Language=en-US\\ Content-Type=application/​xml;​ charset=utf-8\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported.\\ Specifying custom headers is supported //starting with Zabbix 2.4//​. ​ | |//​Headers// ​ |Custom HTTP headers that will be sent when performing a request.\\ Headers should be listed using the same syntax as they would appear in the HTTP protocol, optionally using some additional features supported by the [[http://​curl.haxx.se/​libcurl/​c/​CURLOPT_HTTPHEADER.html|CURLOPT_HTTPHEADER]] cURL option.\\ For example:\\ Accept-Charset=utf-8\\ Accept-Language=en-US\\ Content-Type=application/​xml;​ charset=utf-8\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported.\\ Specifying custom headers is supported //starting with Zabbix 2.4//​. ​ |
Line 80: Line 80:
 === Configuring steps === === Configuring steps ===
  
-{{manual:​config:​scenario_step_b.png?600|}}+{{manual:​config:​scenario_step0.png?600|}}
  
 Step parameters: Step parameters:
Line 86: Line 86:
 ^Parameter^Description^ ^Parameter^Description^
 |//​Name// ​ |Unique step name.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2.  | |//​Name// ​ |Unique step name.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2.  |
-|//​URL// ​ |URL to connect to and retrieve data. For example:\\ %%https://​www.google.com%%\\ %%http://​www.zabbix.com/​download%%\\ Domain names can be specified in Unicode characters since Zabbix 3.4. They are automatically punycode-converted to ASCII when executing the web scenario step.\\ The //Parse// button can be used to separate optional query fields (like ?​name=Admin&​password=mypassword) from the URL, moving the attributes and values into //Query fields// for automatic URL-encoding.\\ Variables can be used in the URL, using the {macro} syntax. Variables can be URL-encoded manually using a {{macro}.urlencode()} syntax.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2.\\ Limited to 2048 characters //starting with Zabbix 2.4//​. ​ | +|//​URL// ​ |URL to connect to and retrieve data. For example:\\ %%https://​www.google.com%%\\ %%http://​www.zabbix.com/​download%%\\ Domain names can be specified in Unicode characters since Zabbix 3.4. They are automatically punycode-converted to ASCII when executing the web scenario step.\\ The //Parse// button can be used to separate optional query fields (like ?​name=Admin&​password=mypassword) from the URL, moving the attributes and values into //Query fields// for automatic URL-encoding.\\ Variables can be used in the URL, using the {macro} syntax. Variables can be URL-encoded manually using a %%{{%%macro}.urlencode()} syntax.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2.\\ Limited to 2048 characters //starting with Zabbix 2.4//​. ​ | 
-|//Query fields// ​ |HTTP GET variables for the URL.\\ Specified as attribute and value pairs.\\ Values are URL-encoded automatically. Values from scenario variables, user macros or {HOST.*} macros are resolved and then URL-encoded automatically. Using a {{macro}.urlencode()} syntax will double URL-encode them.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported since Zabbix 2.2.  | +|//Query fields// ​ |HTTP GET variables for the URL.\\ Specified as attribute and value pairs.\\ Values are URL-encoded automatically. Values from scenario variables, user macros or {HOST.*} macros are resolved and then URL-encoded automatically. Using a %%{{%%macro}.urlencode()} syntax will double URL-encode them.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported since Zabbix 2.2.  | 
-|//​Post// ​ |HTTP POST variables.\\ In **Form data** mode, specified as attribute and value pairs.\\ Values are URL-encoded automatically. Values from scenario variables, user macros or {HOST.*} macros are resolved and then URL-encoded automatically.\\ In **Raw data** mode, attributes/​values are displayed on a single line and concatenated with a **&** symbol.\\ Raw values can be URL-encoded/​decoded manually using a {{macro}.urlencode()} or {{macro}.urldecode()} syntax.\\ For example: id=2345&​userid={user}\\ If {user} is defined as a variable of the web scenario, it will be replaced by its value when the step is executed. If you wish to URL-encode the variable, substitute {user} with {{user}.urlencode()}.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2.  |+|//​Post// ​ |HTTP POST variables.\\ In **Form data** mode, specified as attribute and value pairs.\\ Values are URL-encoded automatically. Values from scenario variables, user macros or {HOST.*} macros are resolved and then URL-encoded automatically.\\ In **Raw data** mode, attributes/​values are displayed on a single line and concatenated with a **&** symbol.\\ Raw values can be URL-encoded/​decoded manually using a %%{{%%macro}.urlencode()} or %%{{%%macro}.urldecode()} syntax.\\ For example: id=2345&​userid={user}\\ If {user} is defined as a variable of the web scenario, it will be replaced by its value when the step is executed. If you wish to URL-encode the variable, substitute {user} with %%{{%%user}.urlencode()}.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2.  |
 |//​Variables// ​ |Step-level variables that may be used for GET and POST functions.\\ Specified as attribute and value pairs.\\ Step-level variables override scenario-level variables or variables from the previous step. However, the value of a step-level variable only affects the step after (and not the current step).\\ They have the following format:\\ **{macro}**=value\\ **{macro}**=regex:<​regular expression>​\\ For more information see variable description on the [[web_monitoring#​configuring_a_web_scenario|scenario]] level.\\ Having step-level variables is supported since Zabbix 2.2.\\ Variables are automatically URL-encoded when used in query fields or form data for post variables, but must be URL-encoded manually when used in raw post or directly in URL.  | |//​Variables// ​ |Step-level variables that may be used for GET and POST functions.\\ Specified as attribute and value pairs.\\ Step-level variables override scenario-level variables or variables from the previous step. However, the value of a step-level variable only affects the step after (and not the current step).\\ They have the following format:\\ **{macro}**=value\\ **{macro}**=regex:<​regular expression>​\\ For more information see variable description on the [[web_monitoring#​configuring_a_web_scenario|scenario]] level.\\ Having step-level variables is supported since Zabbix 2.2.\\ Variables are automatically URL-encoded when used in query fields or form data for post variables, but must be URL-encoded manually when used in raw post or directly in URL.  |
 |//​Headers// ​ |Custom HTTP headers that will be sent when performing a request.\\ Specified as attribute and value pairs.\\ Headers on the step level will overwrite the headers specified for the scenario.\\ For example, setting a '​User-Agent'​ attribute with no value will remove the User-Agent value set on scenario level.\\ User macros and {HOST.*} macros are supported.\\ This sets the [[http://​curl.haxx.se/​libcurl/​c/​CURLOPT_HTTPHEADER.html|CURLOPT_HTTPHEADER]] cURL option.\\ Specifying custom headers is supported //starting with Zabbix 2.4//​. ​ | |//​Headers// ​ |Custom HTTP headers that will be sent when performing a request.\\ Specified as attribute and value pairs.\\ Headers on the step level will overwrite the headers specified for the scenario.\\ For example, setting a '​User-Agent'​ attribute with no value will remove the User-Agent value set on scenario level.\\ User macros and {HOST.*} macros are supported.\\ This sets the [[http://​curl.haxx.se/​libcurl/​c/​CURLOPT_HTTPHEADER.html|CURLOPT_HTTPHEADER]] cURL option.\\ Specifying custom headers is supported //starting with Zabbix 2.4//​. ​ |
Line 94: Line 94:
 |//Retrieve mode// ​ |Select the retrieve mode:\\ **Body** - retrieve only body from the HTTP response\\ **Headers** - retrieve only headers from the HTTP response\\ **Body and headers** - retrieve body and headers from the HTTP response\\ This option is supported //since Zabbix 4.2//​. ​ | |//Retrieve mode// ​ |Select the retrieve mode:\\ **Body** - retrieve only body from the HTTP response\\ **Headers** - retrieve only headers from the HTTP response\\ **Body and headers** - retrieve body and headers from the HTTP response\\ This option is supported //since Zabbix 4.2//​. ​ |
 |//​Timeout// ​ |Zabbix will not spend more than the set amount of time on processing the URL (maximum is 1 hour). Actually this parameter defines the maximum time for making connection to the URL and maximum time for performing an HTTP request. Therefore, Zabbix will not spend more than **2 x Timeout** seconds on the step.\\ [[:​manual/​appendix/​suffixes|Time suffixes]] are supported, e.g. 30s, 1m, 1h. [[:​manual/​config/​macros/​usermacros|User macros]] are supported. ​ | |//​Timeout// ​ |Zabbix will not spend more than the set amount of time on processing the URL (maximum is 1 hour). Actually this parameter defines the maximum time for making connection to the URL and maximum time for performing an HTTP request. Therefore, Zabbix will not spend more than **2 x Timeout** seconds on the step.\\ [[:​manual/​appendix/​suffixes|Time suffixes]] are supported, e.g. 30s, 1m, 1h. [[:​manual/​config/​macros/​usermacros|User macros]] are supported. ​ |
-|//Required string// ​ |Required regular ​expressions ​pattern.\\ Unless retrieved content (HTML) matches required pattern the step will fail. If empty, no check is performed.\\ For example:\\ Homepage of Zabbix\\ Welcome.*admin\\ //Note//: Referencing [[regular_expressions|regular expressions]] created in the Zabbix frontend is not supported in this field.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2. | +|//Required string// ​ |Required regular ​expression ​pattern.\\ Unless retrieved content (HTML) matches ​the required pattern the step will fail. If empty, no check on required string ​is performed.\\ For example:\\ Homepage of Zabbix\\ Welcome.*admin\\ //Note//: Referencing [[regular_expressions|regular expressions]] created in the Zabbix frontend is not supported in this field.\\ User macros and {HOST.*} [[:​manual/​appendix/​macros/​supported_by_location|macros]] are supported, since Zabbix 2.2. | 
-|//Required status codes// ​ |List of expected HTTP status codes. If Zabbix gets a code which is not in the list, the step will fail.\\ If empty, no check is performed.\\ For example: 200,​201,​210-299\\ User macros are supported since Zabbix 2.2.  |+|//Required status codes// ​ |List of expected HTTP status codes. If Zabbix gets a code which is not in the list, the step will fail.\\ If empty, no check on status codes is performed.\\ For example: 200,​201,​210-299\\ User macros are supported since Zabbix 2.2.  |
  
 <​note>​Any changes in web scenario steps will only be saved when the whole scenario is saved.</​note>​ <​note>​Any changes in web scenario steps will only be saved when the whole scenario is saved.</​note>​
Line 109: Line 109:
  
 ^Parameter^Description^ ^Parameter^Description^
-|//​Authentication// ​ |Authentication options.\\ ​ **None** - no authentication used.\\ **Basic ​authentication** - basic authentication is used.\\ **NTLM ​authentication** - NTLM ([[http://​en.wikipedia.org/​wiki/​NTLM|Windows NT LAN Manager)]] authentication is used.\\ Selecting an authentication method will provide two additional fields for entering a user name and password.\\ User macros can be used in user and password fields, //starting with Zabbix 2.2//​. ​ |+|//​Authentication// ​ |Authentication options.\\ ​ **None** - no authentication used.\\ **Basic** - basic authentication is used.\\ **NTLM** - NTLM ([[http://​en.wikipedia.org/​wiki/​NTLM|Windows NT LAN Manager)]] authentication is used.\\ **Kerberos** - Kerberos authentication is used. See also: [[:​manual/​appendix/​items/​kerberos|Configuring Kerberos with Zabbix]].\\ Selecting an authentication method will provide two additional fields for entering a user name and password.\\ User macros can be used in user and password fields, //starting with Zabbix 2.2//​. ​ |
 |//SSL verify peer// ​ |Mark the checkbox to verify the SSL certificate of the web server.\\ The server certificate will be automatically taken from system-wide certificate authority (CA) location. You can override the location of CA files using Zabbix server or proxy configuration parameter [[manual:​appendix:​config:​zabbix_server|SSLCALocation]].\\ This sets the [[http://​curl.haxx.se/​libcurl/​c/​CURLOPT_SSL_VERIFYPEER.html|CURLOPT_SSL_VERIFYPEER]] cURL option.\\ This option is supported //starting with Zabbix 2.4//​. ​ | |//SSL verify peer// ​ |Mark the checkbox to verify the SSL certificate of the web server.\\ The server certificate will be automatically taken from system-wide certificate authority (CA) location. You can override the location of CA files using Zabbix server or proxy configuration parameter [[manual:​appendix:​config:​zabbix_server|SSLCALocation]].\\ This sets the [[http://​curl.haxx.se/​libcurl/​c/​CURLOPT_SSL_VERIFYPEER.html|CURLOPT_SSL_VERIFYPEER]] cURL option.\\ This option is supported //starting with Zabbix 2.4//​. ​ |
 |//SSL verify host// ​ |Mark the checkbox to verify that the //Common Name// field or the //Subject Alternate Name// field of the web server certificate matches.\\ This sets the [[http://​curl.haxx.se/​libcurl/​c/​CURLOPT_SSL_VERIFYHOST.html|CURLOPT_SSL_VERIFYHOST]] cURL option.\\ This option is supported //starting with Zabbix 2.4//​. ​ | |//SSL verify host// ​ |Mark the checkbox to verify that the //Common Name// field or the //Subject Alternate Name// field of the web server certificate matches.\\ This sets the [[http://​curl.haxx.se/​libcurl/​c/​CURLOPT_SSL_VERIFYHOST.html|CURLOPT_SSL_VERIFYHOST]] cURL option.\\ This option is supported //starting with Zabbix 2.4//​. ​ |