Requirements for the Check System

The main requirement for the system we are going to implement is the ability to monitor a remote web site. However, the check should go beyond a simple HTTP GET or POST request, and it must allow the user to specify a navigation path. For example, it should be able to perform some action that simulates the standard user behavior—get to the main web site page and then browse to the products list or navigate to the news web site and select the top story.

As a variation of that scenario, the system also needs to be able to simulate a login process whereby the check submits the user details to the remote web site. These details are then validated by the system and the security token is returned (usually in the form of a browser cookie value).

Unlike a simple HTTP check, which is readily available with the default Nagios distribution, this mechanism actually triggers the web application logic and acts as a more sophisticated check. Combined with the timing parameters, you may implement sophisticated checks that monitor the user logon time and alert if the login process is successful but is taking too long.

We are going to use Python's standard urllib and urllib2 libraries for accessing the web sites. As a web page parser we are going to use the Beautiful Soup HTML parsing library.

Every web site is unique, or at least is trying to stand out from the crowd. Therefore making a universal check system may be a complicated task, so for the sake of simplicity I am going to set some constraints on the system that we'll build in this chapter:

• The navigation (or user journey) path will be coded in the script and not available as a configuration.

• The login check works only on sites that use cookie-based authentication mechanisms.

Was this article helpful?

0 0

Post a comment