Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:documentation:03_monitoring:06_web_monitoring [2021/06/21 16:15] jimmy.olano [HTTPS Monitoring] Error de migración. |
en:documentation:03_monitoring:06_web_monitoring [2023/02/20 16:54] (current) |
||
---|---|---|---|
Line 21: | Line 21: | ||
==== Installation and Configuration ==== | ==== Installation and Configuration ==== | ||
- | To be able to use Goliat, [[en: | ||
- | | + | To be able to use Goliath, [[: |
+ | < | ||
+ | |||
+ | webserver 1 | ||
+ | |||
+ | </ | ||
Depending on the number of requests you want to make, you may have to increase the number of threads and the default timeout: | Depending on the number of requests you want to make, you may have to increase the number of threads and the default timeout: | ||
< | < | ||
- | | + | |
| | ||
+ | |||
</ | </ | ||
- | There is an advanced configuration token that will allow you to change the type of library you use under Goliat, LWP or CURL. CURL is used by default, but you can change it at any time: | + | There is an advanced configuration token that will allow you to change the type of library you use under Goliath, LWP or CURL. CURL is used by default, but you may change it at any time: |
+ | |||
+ | < | ||
+ | web_engine curl | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP center round info 60%>\\ | ||
+ | Pandora FMS has protection against [[https:// | ||
+ | '' | ||
+ | Please take this protection into account when considering the use of " | ||
- | web_engine curl | ||
==== Creating Web Modules ==== | ==== Creating Web Modules ==== | ||
+ | |||
To monitor a web page remotely, once the agent is created, click on the **modules** tab. Then, select **Create a new webserver module** and click on **Create**: | To monitor a web page remotely, once the agent is created, click on the **modules** tab. Then, select **Create a new webserver module** and click on **Create**: | ||
- | {{ wiki:Gagita2.png?500 }} | + | {{ :wiki:pfms-creating_web_modules-goliat_server-img_002.png }} |
Click on **Create** to see a form where to fill out the appropriate fields to monitor a web page. | Click on **Create** to see a form where to fill out the appropriate fields to monitor a web page. | ||
- | {{ wiki: | + | {{ :wiki: |
There are several check types to choose from: | There are several check types to choose from: | ||
* **Remote HTTP module to check latency**: It obtains the total time that elapses from the first request until the last one is checked (in a WEB test there are one or more intermediate requests that complete the transaction). If it is defined in the check definition that the transaction must be carried out more than once, the average time of each request is used. | * **Remote HTTP module to check latency**: It obtains the total time that elapses from the first request until the last one is checked (in a WEB test there are one or more intermediate requests that complete the transaction). If it is defined in the check definition that the transaction must be carried out more than once, the average time of each request is used. | ||
- | + | | |
- | | + | |
* **Remote HTTP module to retrieve numeric data**: It retrieves a numeric value from an HTTP response using a regular expression. | * **Remote HTTP module to retrieve numeric data**: It retrieves a numeric value from an HTTP response using a regular expression. | ||
- | |||
* **Remote HTTP module to retrieve string data**: It retrieves a string from an HTTP response using a regular expression. | * **Remote HTTP module to retrieve string data**: It retrieves a string from an HTTP response using a regular expression. | ||
- | + | | |
- | | + | **Web Checks**: This essential field defines the WEB check to be performed. This is defined in one or more steps, or simple requests. These simple requests must be written in a special format in the Web checks field. Checks start with the tab page '' |
- | + | ||
- | **Web Checks**: This essential field defines the WEB check to be performed. This is defined in one or more steps, or simple requests. These simple requests must be written in a special format in the Web checks field. Checks start with the tab page '' | + | |
A complete example of a simple transaction would be the following: | A complete example of a simple transaction would be the following: | ||
- | |||
< | < | ||
+ | |||
| | ||
head http:// | head http:// | ||
| | ||
+ | |||
</ | </ | ||
- | {{ wiki:Resources-manage_agents-modules-remote_http_module_to_check_server_status_code.png? | + | {{ :wiki:resources-manage_agents-modules-remote_http_module_to_check_server_status_code.png? |
After saving, you can force the execution of the Module and visualize its result: | After saving, you can force the execution of the Module and visualize its result: | ||
- | {{ wiki:Resources-manage_agents-modules-remote_http_module_to_check_server_status_code-result.png? | + | {{ :wiki:resources-manage_agents-modules-remote_http_module_to_check_server_status_code-result.png? |
Another example with more commands: | Another example with more commands: | ||
< | < | ||
- | | + | |
get http:// | get http:// | ||
| | ||
Line 82: | Line 93: | ||
| | ||
| | ||
+ | |||
</ | </ | ||
- | In this basic example, it is being checked whether there is a string in a web page. To that end, there is the variable '' | + | In this basic example, it is being checked whether there is a string in a web page. To that end, there is the variable '' |
To ensure that a string does not exist on a web page, you can use the variable '' | To ensure that a string does not exist on a web page, you can use the variable '' | ||
+ | < | ||
- | | + | check_not_string Section 3 |
- | The arguments taken by the '' | + | </ |
+ | |||
+ | The arguments taken by the '' | ||
There are several extra variables to check forms: | There are several extra variables to check forms: | ||
Line 98: | Line 113: | ||
* **variable_name**: | * **variable_name**: | ||
* **variable_value**: | * **variable_value**: | ||
- | |||
By using these variables, it is possible to send data to forms and check whether they work appropriately or not. | By using these variables, it is possible to send data to forms and check whether they work appropriately or not. | ||
- | <WRAP center round important 60%> | + | <WRAP center round important 60%> In some specific cases, the domain redirection may **not** |
- | In some specific cases, the domain redirection may **not** work. To solve this problem, create a module that uses the final domain address after all redirections are completed. | + | |
- | </ | + | |
- | For the previous case, the **curl** command has the parameter | + | For the previous case, the **curl** |
- | {{ wiki:Resources-manage agents-modules-remote http debug.png?700 }} | + | < |
+ | -L | ||
+ | |||
+ | </ | ||
+ | |||
+ | in its short version and | ||
+ | |||
+ | < | ||
+ | --location | ||
+ | |||
+ | </ | ||
+ | |||
+ | in its long version, so when it receives HTTP 3XX redirections, | ||
+ | |||
+ | {{ :wiki:resources-manage_agents-modules-remote_http_debug.png? | ||
At the moment of creating the Module, it is inactive and you will be able to make use of it after you have done the first check, which you can force to run to save time. | At the moment of creating the Module, it is inactive and you will be able to make use of it after you have done the first check, which you can force to run to save time. | ||
- | When you modify this Module, click on the **Debug** button and you can enter debug mode to edit the **Query**: | + | When you modify this Module, click on the **Debug** |
+ | |||
+ | {{ : | ||
- | {{ wiki: | + | You can execute the query that the module has with the button **Execute query** |
- | You can execute the query that the module has with the button **Execute query** as well as modify and re-execute it with other values until you get the desired result. | + | {{ : |
- | {{ wiki: | ||
==== Checking website loading time ==== | ==== Checking website loading time ==== | ||
Line 150: | Line 177: | ||
==== Retrieving data from a website ==== | ==== Retrieving data from a website ==== | ||
- | Sometimes monitoring does not consist of finding out whether a specific Web site is working or how long it takes, but to get a real time value, such as Google' | ||
+ | Sometimes monitoring does not consist of finding out whether a specific Web site is working or how long it takes, but to get a real time value, such as the total number of modules registered in the same PFMS server [[: | ||
< | < | ||
- | task_begin | + | |
- | get http://finance.google.com/finance/info?client=ig&q=NASDAQ%3aGOOG | + | task_begin |
- | | + | get http://127.0.0.1/pandora_console/include/ |
- | | + | get_content \d+ |
+ | task_end | ||
</ | </ | ||
The output will look like this: | The output will look like this: | ||
- | {{ wiki:Google_stock_quote.png?700 }} | + | {{ :wiki:pfms-creating_web_modules-goliat_server-img_100.png }} |
- | + | It is also possible to specify a more complex regular expression for collecting data from more complex HTTP responses with the '' | |
- | It is also possible to specify a more complex regular expression for collecting data from more complex HTTP responses with the '' | + | |
< | < | ||
- | task_begin | + | task_begin |
- | | + | get https://pandorafms.com/manual/ |
- | | + | get_content_advanced |
- | | + | task_end |
</ | </ | ||
- | <WRAP center round important | + | {{ : |
- | The part of the regular expression defined in '' | + | |
+ | <WRAP center round important | ||
+ | |||
+ | * The part of the regular expression defined in '' | ||
+ | * If the text to be looked for contains parentheses, | ||
</ | </ | ||
+ | |||
+ | {{ : | ||
To configure the thresholds that will trigger warning or critical status, use the module configuration to verify that the received string matches what is expected. | To configure the thresholds that will trigger warning or critical status, use the module configuration to verify that the received string matches what is expected. | ||
+ | |||
==== Website form checking ==== | ==== Website form checking ==== | ||
Line 264: | Line 301: | ||
==== Simple HTTP Authentication ==== | ==== Simple HTTP Authentication ==== | ||
- | Some websites might require [[wp>Basic_access_authentication|simple HTTP authentication]]. | + | Some websites might require [[https:// |
- | {{: | + | {{ : |
It can be configured in the advanced check options (or directly in the WEB task definition) with the following configuration tokens: | It can be configured in the advanced check options (or directly in the WEB task definition) with the following configuration tokens: | ||
Line 272: | Line 309: | ||
**Check type** | **Check type** | ||
- | HTTP server check type. ;http auth (login): HTTP user. ;http auth (password): Password. **Proxy auth realm** | + | HTTP server check type. |
- | Auth realm' | + | **http |
- | Proxy server url. ;Proxy auth (login): Proxy connection user. ;Proxy auth (pass): Proxy connection password. | + | HTTP user. |
+ | |||
+ | **http auth (password)** | ||
+ | |||
+ | Password. | ||
+ | |||
+ | **Proxy auth realm** | ||
+ | |||
+ | Auth realm' | ||
+ | |||
+ | **Proxy auth (server)** | ||
+ | |||
+ | Domain and HTTP port on which to listen on. | ||
+ | |||
+ | **Proxy URL** | ||
+ | |||
+ | Proxy server url. | ||
+ | |||
+ | **Proxy auth (login)** | ||
+ | |||
+ | Proxy connection user. | ||
+ | |||
+ | **Proxy auth (pass)** | ||
+ | |||
+ | Proxy connection password. | ||
Full example: | Full example: | ||
Line 293: | Line 354: | ||
</ | </ | ||
+ | |||
+ | <WRAP center round important 60%>The use of quotation marks in the password for '' | ||
+ | |||
+ | </ | ||
Line 391: | Line 456: | ||
==== Advanced Options ==== | ==== Advanced Options ==== | ||
=== Modifying HTTP Headers === | === Modifying HTTP Headers === | ||
- | With the //header// option, you are able to modify HTTP headers or create your own. The example below changes the //Host// HTTP header: | ||
+ | With the //header// option, you are able to modify HTTP headers or create your own. The example below changes the //Host// HTTP header: | ||
+ | < | ||
| | ||
get http:// | get http:// | ||
| | ||
| | ||
+ | |||
+ | </ | ||
+ | |||
=== Debugging Web checks === | === Debugging Web checks === | ||
- | If you want to debug Web checks, add the '' | ||
+ | If you want to debug Web checks, add the '' | ||
+ | < | ||
| | ||
get http:// | get http:// | ||
debug / | debug / | ||
| | ||
+ | |||
+ | </ | ||
+ | |||
=== Using CURL instead of LWP === | === Using CURL instead of LWP === | ||
- | LWP library sometimes crashes when multiple threads issue HTTPS requests simultaneously (due to an OpenSSL constraint). The alternative is to use the [[https:// | ||
- | web_engine curl | + | LWP library sometimes crashes when multiple threads issue HTTPS requests simultaneously (due to an OpenSSL constraint). The alternative is to use the [[https:// |
+ | < | ||
+ | |||
+ | web_engine curl | ||
+ | |||
+ | </ | ||
Restart Pandora FMS Server, and the CURL binary will be used to perform web checks instead of LWP. | Restart Pandora FMS Server, and the CURL binary will be used to perform web checks instead of LWP. | ||
+ | |||
===== Advanced Transactional Monitoring ===== | ===== Advanced Transactional Monitoring ===== | ||
- | In addition to the feature offered by Goliath, there are other ways to carry out web transactional monitoring. | + | In addition to the feature offered by Goliath, there are other ways to carry out web transactional monitoring. |
- | * In a distributed way (UX), deployed as an " | + | |
- | * In a [[en: | + | * [[: |
+ | * In a centralized way (WUX) | ||
+ | |||
+ | [[:en: | ||
- | [[en: | ||