In this article, we will see how to use Zabbix's Web monitoring feature to check the availability of our websites, measure response times, and verify that forms or logins work correctly.
Create a web scenario
Access the Zabbix panel and go to Data collection and Hosts, then click on Web on the host where you want to configure monitoring:
In the top right corner, click the blue Create web scenario button. A form will open to define the general parameters of the scenario. You only need to set the scenario name, the Update interval (e.g., 1m, 5m, 1h), and the number of retry attempts in case of failure:
Step configuration
Once the previous fields of the scenario are completed, go to the Steps tab, where we add the data for our website:
Required status codes correspond to the HTTP code returned by the web server in the response header. The usual code is 200, which means the request was processed successfully. If your application responds with other valid codes (e.g., 301 for redirects), you can also specify them here.
Repeat the previous steps as many times as URLs you want to monitor:
Important
Each time you add or create a new step in the scenario, remember to click the Update button so that changes are saved correctly. Otherwise, Zabbix will not consider the step in the next scenario executions.
Check the results
With these steps, our website is now monitored. To check if the scenario works correctly, go to Monitoring and Hosts, click on the host where the scenario was configured, and in View click on Web:
Select the scenario you created, and Zabbix will display metrics such as load times, the status of each step, detected content, and historical graphs:
Monitor forms
You can also monitor forms, whether for sending emails or accessing a private area. Suppose we have a form that posts to http://mydomain.com/form.php and the required fields are name and email. When the form is submitted successfully, the message appears: “We have received your inquiry, we will respond shortly”. With this information, we can verify whether the form works correctly.
To do this, in the Steps tab, create a new step like this:
In this way, each time Zabbix executes the scenario, it will automatically send the form data and check that the response contains the expected message. If everything works correctly, the step will appear in green as OK on the monitoring panel.
Remember, if you have any questions about this or any other topic related to your servers at Clouding, do not hesitate to write to support@clouding.io. We are here to support you with whatever you need!