Everything Up? Server Self Test

Simple Free and Open Source Server Check Tool for ASP.net

Can test any HTTP or HTTPS based service, mail services (SMTP and POP3), HTTP redirects and most text based network protocols, can be extended by writing new tests in C#

Everything Up is licensed under the Apache version 2 license, this means you can use it for free everywhere, modify it any way you wish and use it as part of other software (even commercial software).

About Everything Up

We have a lot of different services running on our server, we have web sites, web applications, blogs, mail and internal tools, some of them even share the same IIS web site.

When so many different programs are running on the same server it’s easy to make a configuration change in one application that will affect other applications, after a somewhat nasty outage caused by such a changed we started using a checklist to make sure everything is up after every change – but that was time consuming and tedious – and so Everything Up was born.

Everything up is a very simple web application, you create a list of everything you need to test in an XML file on the server – and after you make any change to the server you just open Everything Up in your browser and it will run the tests from the XML file and show you the results.

Download

The latest version is 1.0, released on September 4th, 2011:

Precompiled Binaries (19KB, zip file)

Source Code (344KB, zip file)

Installation and System Requirements

Everything Up requires IIS and The .net Framework version 3.5 on Windows operating system.

To install (on IIS 7.x):

  1. just download the latest binaries above, unzip into a folder on your web site (for example, if you have just one web site and you are using the default IIS configuration, create a folder named EverythingUp under c:\inepub\wwwroot and unzip the file below into it).
  2. Open IIS Manager, go to the new folder and make it a web application (right click on the folder and select “Convert to Application”).
  3. Make sure the application is running under .net 3.5 (IIS manager should show runtime version 2.0):
    Click on the Everything Up folder in IIS Manager, now click the “Basic Settings” link on the right side of the window, note the name of the application pool in the basic settings window and click Cancel.
    Now, in the tree on the left click “Application Pools” (at the top, right below the computer name), on the right select the application pool that Everything Up is running in, if the .net version is v2.0 everything is set up, otherwise double click on the application pool row in the table and set the .net version to 2.0.x.
  4. Configure your tests – Go to the folder containing Everything up, open the “bin” sub-folder and edit the Test.xml File, see “Tests Configuration” below for details on how to set up all the possible tests.

Tests Configuration

HTTP and HTTPS

<Test Type="HttpDownload"
      Name="<display name>"
      Url=”<page url>”
      LookFor=”<text>" (optional) />

Name – name to display on results page

Url – Url of web page to download (example: “http://www.example.com/MyPage.aspx”)

LookFor – Text that must appear on page (optional)

SMTP

<Test Type="Smtp"
      Name="<display name>"
      Server=”<server name>”
      Port=”<port number>" (optional) />

Name - name to display on results page

Server – Server name (example: “mail.example.com”)

Port – SMTP port, use for testing alternative SMTP ports (optional)

POP3

<Test Type="Pop3"
      Name="<display name>"
      Server=”<server name>” />

Name - name to display on results page

Server – Server name (example: “mail.example.com”)

HTTP (and HTTPS) Redirects

<Test Type="Redirect"
      Name="<display name>"
      Url="<url to test>"
      Target="<redirection target>"
      Permanent=”<true|false>” />

Name – name to display on results page

Url – Url of web page to download that should redirect (example: “http://www.example.com/MyPage.aspx”)

Target – Url that the should be redirected to

Permanent – “true” if this should be a permanent redirect (301), “false” for temporary redirect (302)

Any other text based TCP/IP protocol with a status code in the first line (advanced)

With this option Everything up will connect to the specified machine/port and wait for one line of text (it will read everything until the first newline), than it will look for the specified text in this line.

<Test Type="Smtp"
      Name="<display name>"
      Server=”<server name>”
      Port=”<port number>"
      LookFor=”<status text>" />

Name - name to display on results page

Server – server name (example: “mail.example.com”)

Post – port number

LookFor – Text that should appear on first line sent from the server

Example: you can test POP3 with the following configuration:

<Test Type="TcpTextLine" Name=”POP3” Server=”mail.example.com” Port=”110”  LookFor=”+OK ” />

Writing your own tests (advanced)

Each type of test is a .net class, all tests must be compiled into the ServerSelfTest.dll (the main Everything Up dll), must be in the ServerSelfTest.Tests namespace, the class name must end with “Test” and it must implement the ServerSelfTest.Models.ITest interface

All public properties of the test class can be set from the Tests.xml file and the RunTest method (from the ITest interface) is called to actually perform the test.

For example, let’s look at the code complete for the RedirectTest class:

using System;
using System.Web;
using System.Net;
using ServerSelfTest.Base;

namespace ServerSelfTest.Tests
{
    public class RedirectTest : ITest
    {
        public string Url { get; set; }
        public string Target { get; set; }
        public bool Permanent { get; set; }

        public bool RunTest()
        {
            try
            {
                var request = (HttpWebRequest)WebRequest.Create(Url);
                request.AllowAutoRedirect = false;
                var response = (HttpWebResponse)request.GetResponse();
                return (Permanent ? 
                    response.StatusCode == HttpStatusCode.MovedPermanently : 
                    response.StatusCode == HttpStatusCode.Moved) &&
                    response.Headers["Location"] == Target;
            }
            catch
            {
                return false;
            }

        }
    }
}  

And the XML definitions to us the class:

<Test Type=”Redirect” Name=”example.com -> www.example.com” 
   Url=”http://example.com” Target=”http://www.example.com” Permanent=”true” />

The Tests.xml parser creates and object of the class by looking for a class with the name specified in the Type attribute (but with the “Test” suffix) and then copies the content of the Xml attributes into the class properties.

The Type and Name attributes are reserved and not passed to the test class.

Contribute

We will set a public code repository sometime in the future, until then you can send bug reports, requests, questions and of course patches to support@nbdtech.com