ipMonitor 7.x Soap Sample: CentralStatus
 
Sample Description:
   
The CentralStatus sample is a ASP .NET project that uses SOAP to communicate with a number of ipMonitor 7.x instances and status information from a single web page.
 
With this sample, you can:
  • View status information of all ipMonitor 7 instances from a single web page
  • Provide status information without providing access to ipMonitor 7
  • Provide status information using IIS account/password/certificate security settings
  • Integrate ipMonitor 7 status information with any web page (ie: intranet dashboard / portal)
  • Completely customize the display of status information
 
Downloads:
 
ipMonitor 7 SOAP Methods Used (C#):
Project Discussion
 
Class View, Courtesy of Microsoft Visual Studio .NET 2003

Our goal for this project is to showcase how to retrieve real-time status information in ASP .NET with as little "display formatting" as possible. Our technique is to collect status information and store it in the following tree format:

design implementation
ServerList
  Server
    Group
      Monitor
      Monitor
    Group
      Monitor
      Monitor
  Server
    Group
      Monitor
      Monitor
    Group
      Monitor
      Monitor
ipm7ServerList
  ipm7ServerList::servers
    ipm7Server
      ipm7Server::groups
        ipm7Group
          ipm7Group::monitors
            rtMonitor

  • There is a single ipm7ServerList (a collection of ipm7Server objects)
  • Each ipm7Server object has a collection of ipm7Group objects
  • Each ipm7Group object has a collection of rtMonitor structures

    To stick to our goal of keeping the sample as simple as possible, we've taken the above tree and expressed it in Javascript as an array of Javascript Objects. We're expecting Javascript to render HTML from the Javascript variables. With all the display formatting in Javascript (which we might have gone overboard in doing), the ASP .NET code contains very little other than how to collect status information.

    1. When the application starts, examine "config\centralstatus.aspx" for settings (see Global.aspx for details)
    2. Next, allocate and initialize the ipm7ServerList and start the thread to keep it refreshed
    3. Any hit to centralstatus.aspx = a large javascript array containing all the data we have
    4. Web browser is told to render said Javascript array (according to cookie settings) in HTML
    5. Web browser calculates when to refresh itself (so the next page is requested after all the ipm7Server objects are "Refreshed")
  •  
    SOAP Sample Breakdown, by file:
     

    .\wwwroot\centralstatus.csproj[.webinfo]
    The C# project that contains everything needed to compile the web application. Note: you will likely have to change the webinfo file to correspond to the location of centralstatus.csproj.

    .\config\centralstatus.xml
    Settings for the sample, includes refresh rates, password and account info, and location of servers. This file is intentionally out of the wwwroot so it doesn't get downloaded. Later we'll expand this sample to show the usage of "utility.LoadWithMachineKey" so passwords and accounts aren't stored out in the open.

    .\wwwroot\bin\com.ipmonitor.samples.centralstatus.dll
    ASP .NET compiled code to run behind the aspx pages.

    .\wwwroot\global.aspx[.cs]
    Applicaton "global" object (receives application events) and is where we create our ipm7ServerList and start the thread that keeps it up-to-date. Note that the centralstatus.xml is read in the global.aspx.cs file.

    .\wwwroot\centralstatus.aspx[.cs]
    The web page that receives the ipm7ServerList data in Javascript, then re-renders it in HTML. This page auto refreshes. This is also the place where we implement the System.Web.UI.Page: DisplayAll (as shown in the classview)

    .\wwwroot\centralstatus.css
    Display formatting css data for use with centralstatus.aspx.

    .\wwwroot\centralstatus.js
    The code that generates the HTML from the Javascript representation of ipm7ServerList. Since one cannot view source of centralstatus.aspx to see the HTML, the bottom of the page includes a link to expose the HTML generated.

    .\wwwroot\displayitems.cs
    The thread that collects the information from all the servers listed in centralstatus.xml; The method(s) to translate the c# objects (ipm7Server,ipm7Group,rtMonitor) into Javascript data.

    .\wwwroot\utility.cs
    A couple of our utility functions to make the sample function. Note: RewindPath is how we locate the centralstatus.xml.

    .\wwwroot\ipm_menu.js
    Javascript to assist with context sensitive menus

    .\wwwroot\ipm_cookies.js & .\wwwroot\ipm_serialize.js
    Javascript to assist with setting / retrieving persistent settings

    .\wwwroot\imgs\*
    Images used for display within centralstatus.aspx

    .\wwwroot\Web References\ipm7status\*
    The after effects of consuming the ipMonitor 7 Status WSDL