How-To: Monitor a specific web page or script output.
To expand on simple connectivity and availability of a web server as outlined in HT0011: Monitor a basic web server, you may wish to monitor a specific web page for full delivery, or the results of a server script.
In such a case, only two fields must be changed from the basic example provided in the document noted above.
In this example, we will be monitoring a web server by actually triggering a script and checking the results to make sure the HTML is being delivered by the server. This configuration provides great overall monitoring of the connection, availability, server functionality, and delivery of web pages.
This method can also be used in a situation where you create a back-end CGI or or other server side script to perform various tests from the web server. The result would need be nothing more than "SERVEROK" or "SERVERFAILED" contained in the response HTML. This is ideal for testing databases and other third tier systems that are required by your server.
In this document we will create an entry to do the following. (Alert configuration is covered elsewhere)
Connect to the web server.
Simulate a request for a specific script.
The Script contains code that checks a back-end database and returns an
appropriate result.
Evaluate the response for the expected result.
If we receive the text DATABASEOK, then the request was successful.
The only information we must know prior to beginning the configuration is the
URL of the web server we are monitoring as well as what information we should
expect to receive.
In this case, the URL will be http://www.someserver.com/scripts/dbtest.asp
If the script performs all functions successfully, a response of "DATABASEOK"
will be sent in the HTML. What the script actually does is not important
to this example other than the fact that it will output the above information
ONLY if it succeeds in it's processing.
From the IPSentry active display console,
select Options from the Edit.
Select the Server/Machine Monitoring tab.
Hit the Add button to begin configuring a
new entry.
Under the --Type-- section, select Network.
Enter a unique identifiable name in the Name
field.
Enter a meaningful description about this
entry in the Description field.
Enter www.someserver.com in the IP Address
field.
Note: When you leave this field, you will be asked if you want to convert
the name to an IP Address. We recommend answer yes and using the IP
Address. The reason for this is that if your access to DNS name
resolution is failing, you will receive an alert that this device is down
even though the problem exists with DNS and not with the web server.
You can always configure a DNS monitoring entry to check your DNS servers.
Enter HTTP in the Port field.
Click on the Auto Config button to have
IPSentry fill in the Data to Send and Data To Recv fields with basic
information used to monitor HTTP entries. (Not all ports are supported
with this option)
The Data To Send field should now be changed
so that IPSentry will make the proper request for our script. This
field should be set to: GET /scripts/dbtest.asp HTTP/1.0^^
Notice that the GET command has three parts.
- The Request Method (GET)
- The item requested ( /scripts/dbtest.asp )
- The HTTP version identifier ( HTTP/1.0)
The "^^" at the end is simply a double line feed to tell the
server that no further information is being sent with the request and the request
is complete.
The Data To Recv field should now be changed
to the information we expect to receive if everything goes well. As noted
above, it appears that the script will output "DATABASEOK" somewhere
in the document if all tests were perform successfully.
Set the Data To Recv field to: DATABASEOK
You can see from here how simple it would be to monitor any script or
specific web page and check the resulting contents for a known good result
simply by changing the GET request and the Data To Recv values accordingly.
At this point, all of the entries specific to configuring an entry to monitor a specific script/web page are complete. Additional alert options, timing, dependencies, and etc. can be configured at this point.
|
||
Contact: support@ipsentry.com | https://ipsentry.com | © 2006 by RGE, Inc. - All Rights Reserved |