siteBotAuditor: Help
The purpose of this page is to detail how to change the siteBotAuditor along with some ways to use it.

 


siteBotAuditor: Requirements
- Website to host siteBotAuditor
- Web browser
- PHP 5.3.2 or later

siteBotAuditor: Audit Types
When you access "siteBot.html" with your web browser (such as www.yoursite.com/siteBotAuditor/siteBot.html), you have the option to perform two activities: (1) Start Single Audit, and, (2) Start Full Audit. Whichever audit type you choose, siteBotAuditor will supply a few suggestions on how to resolve failed audits in addition to supplying server response code details (like response code 200 "Okay").

Start Single Audit
This audit type is intended for you to run an audit against a single website by providing some basic information. While it is the simplest to use and you do not need to configure or change any PHP code, it does not send email alerts if a failure is detected. As well it cannot react to a database server not being reachable by a website. However, it does show basically the same information that would be packaged in an email alert and also shows you the expiration date of an SSL certificate if (1) you connect to one of your sites in "https", and, (2) the connection is successful.

Start Full Audit
This audit type is intended for you to start and it will keep running as long as you have a connection to the Internet and keep the web browser open. This audit type periodically conducts an audit against a collection of websites you've defined (as well as database servers, if needed). Like the "Start Single Audit" if there are failures it will display failures in the page but it will also dispatch an email alert for each failure encountered (this includes when it detects an SSL certificate is about to expire at (1) the following month, and, (2) within the next week.

[TIP] Websites & Database Servers
If you are concerned about making sure your website(s) that are on a server can contact database servers (on a different server), you could create a webpage on a website that does simple database calls to all the database servers that should be contactable by the server with the website. If their are any failures in contacting a database server from the web server the website is on, format the response html code as shown below. I can't really give any tips on the code to use since there are a lot of programming languages that have different ways of interacting with databases.
<html><head><title>Failure</title></head><body>Database server names (or some other notation that you'll recognize) that could not be contacted</body></html>
NOTE: The bot recognizes "Failure" in the title to trigger an alert. It then puts whatever you have in the body, into the alert details. What is good to recognize here is that (1) if a 200 code is returned to the bot you know the website is reachable and is responding, (2) if a "Failure" is in the title then you know the website cannot contact the relevant database servers.


In order to use this audit type, it requires that you edit the siteBot.php file (editing can be accomplished by using a text editor such as Notepad). Please see the next section.

siteBotAuditor: Customizing Full Audit
In order to take advantage of full audit, please see the following details:


(Enlarge)
  • Open "siteBot.php" with a text editor.
  • Change the logon and password.
  • Change the email alert pre-text (the pre-text is followed by the website domain name which failed audit).
  • Change the email alert "from" email address.

(Enlarge)
  • For each website or website URL you want to audit, you need to define each one in the "siteBotData" array. As you can see each resource is defined by seven elements.
  • [0] - the connection method either "http" or "https".
  • [1] - the website domain name.
  • [3] - the actual resource to request at the website (do not request binary resources).
  • [4] - the email address to send an audit alert to; as shown by the second array block you can include multiple email addresses as long as they are separated by a comma.
  • [5] - ** DO NOT USE **; this stores the response code from the action of contacting the website.
  • [6] - ** DO NOT USE **; this stores the actual resource content (similar to you viewing the source code of a page in your web browser).

(Enlarge)
  • If you specify "https" as the connection method, the expiration date of the SSL certificate is examined.
  • If the SSL certificate is close to expiring (1) the following month, (2) within the next 7 days, or, (3) expired a failure audit is generated as shown below.
     


siteBotAuditor: Customizing Full Audit - Tracking Server Name
The ability to track the name of the server one of your websites is on can be a valuable diagnosis tool in relation to SSL certificates. However, the true benefit of using this method is most apparent if one of your websites is in a cluster environment (that is, a website is running on multiple physical or virtual web servers). In such cases, if there is an error with an "https" request (but not "http" requests), the name of the server can help you identify where a problem exists related to the SSL certificate (such as losing binding information which makes accessing pages via "https" impossible).


(Enlarge)
  • How can this be done? In order to capitalize on this capability, as previously hinted to, you need to make two audit requests. The first audit request should use "http". The second audit request should use "https" and be configured to use the same domain name and resource target. See the code block below for an example:
$siteBotDataCount = $siteBotDataCount + 1;
$siteBotData[$siteBotDataCount][0] = "http";
$siteBotData[$siteBotDataCount][1] = "www.yoursite.com";
$siteBotData[$siteBotDataCount][2] = "/someresource.html";
$siteBotData[$siteBotDataCount][3] = "you@yoursite.com";
$siteBotData[$siteBotDataCount][4] = "";
$siteBotData[$siteBotDataCount][5] = "0";
$siteBotData[$siteBotDataCount][6] = "";

$siteBotDataCount = $siteBotDataCount + 1;
$siteBotData[$siteBotDataCount][0] = "https";
$siteBotData[$siteBotDataCount][1] = "www.yoursite.com";
$siteBotData[$siteBotDataCount][2] = "/someresource.html";
$siteBotData[$siteBotDataCount][3] = "you@yoursite.com";
$siteBotData[$siteBotDataCount][4] = "";
$siteBotData[$siteBotDataCount][5] = "0";
$siteBotData[$siteBotDataCount][6] = "";


  • WAIT, ONE MORE STEP!
  • The resource that you have targeted (in this example "/someresource.html") needs to contain some very simple HTML code, and nothing else. This helps tip off the siteBotAuditor that it is to get the server name that you specified in target resource.
  • Your target resource HTML code, therefore, should contain nothing more than the following:
<html>The name (or code word) of the server the website is on goes here</html>

NOTE: In cluster environments that I've come across you can add a file or folder "filter" that will instruct the replicating agent (such as DFS) to not replicate a file or folder. This allows you to manually specify the server name in the resource target file of each website instance across the cluster environment.


siteBotAuditor: Full Audit - Speed Up Website Request/Response
In order to speed up the response time of the siteBotAuditor (and help avoid server timeouts) the resource target that you specify (such as "/someresource.html" below) should contain little response data because, under a full audit, all that is of concern is that the website is reachable in "http" and "https" (if applicable).

$siteBotDataCount = $siteBotDataCount + 1;
$siteBotData[$siteBotDataCount][0] = "http";
$siteBotData[$siteBotDataCount][1] = "www.yoursite.com";
$siteBotData[$siteBotDataCount][2] = "/someresource.html";
$siteBotData[$siteBotDataCount][3] = "you@yoursite.com";
$siteBotData[$siteBotDataCount][4] = "";
$siteBotData[$siteBotDataCount][5] = "0";
$siteBotData[$siteBotDataCount][6] = "";


So, what could go into the resource target? In order for the response to be processed as quick as possible you'll want a minimal amount of code. A few suggestions are shown below:

Option #1: <html>The name (or code word) of the server the website is on goes here</html>
Option #2: <html>Connection Success</html>