2 Replies Latest reply on Jan 15, 2005 10:25 AM by masoncooper



      Is there any code available using which I can display the NetPerfMon-NetObjects.SnapShot in IIS? Cause right now when I host the site with NetPerfMon-NetObjects.SnapShot default document ...It does not open the XML - instead asks to save.

      I searched for xml webhosting and found that I need to call the XML file using codes e.g. Java,XDL,CSS in a html page and so on.
      This is something I am not understanding....If any site which can guide me - It will be a great help.
        • Re: NetPerfMon-NetObjects.SnapShot
          Do a search in this forum for "XML".
          There have been other posts on this subject.

          • Re: NetPerfMon-NetObjects.SnapShot
            Since the XML file if only data, you  need some way of describing how you want the data displayed.  The way I displayed our snapshot file was by loading an XML stylesheet (XSL) and applied the XML data to it.

            The entire process requires 3 files and no server-side processing (it's all done at the client-side)

            First, I have my XSL sheet, it is fairly basic but it allows us to see what we need to see
            <?xml version="1.0"?>

            <xsl:stylesheet version="1.0"

            <xsl:template match="/">
                <h2>System Status for <xsl:value-of select="NetPerfmon/Snapshot/@TimeStamp"/></h2>
                <table border="1">
                <tr bgcolor="#9acd32">
                  <th align="left">Device</th>
                  <th align="left">Interface</th>
                  <th align="left">Status</th>
                  <th align="left">% In</th>
                  <th align="left">% Out</th>
                  <th aligh="left">In</th>
                  <th aligh="left">Out</th>
                  <th aligh="left">Max In Today</th>
                  <th aligh="left">Max Out Today</th>
            <xsl:for-each select="NetPerfMon/NetworkNodes/NetworkNode/Interfaces/Interface">
                  <td><xsl:value-of select="../../@NodeName"/></td>
                  <td><xsl:value-of select="@InterfaceCaption"/></td>
                  <td><xsl:value-of select="@OperStatus"/></td>
              <xsl:when test="RawData/@InPercentUtil > 50">
                  <td bgcolor="red"><xsl:value-of select="@InPercentUtil"/></td>
                  <td><xsl:value-of select="@InPercentUtil"/></td>
              <xsl:when test="RawData/@OutPercentUtil > 50">
                  <td bgcolor="red"><xsl:value-of select="@OutPercentUtil"/></td>
                  <td><xsl:value-of select="@OutPercentUtil"/></td>

                  <td><xsl:value-of select="@InBps"/></td>
                  <td><xsl:value-of select="@OutBps"/></td>
                  <td><xsl:value-of select="@MaxInBpsToday"/></td>
                  <td><xsl:value-of select="@MaxOutBpsToday"/></td>
            Notice the xsl:for-each, this will go through all interfaces in NetPerfMon/NetworkNodes/NetworkNode/Interfaces

            And of course you have your NetPerfMon-NetObjects.Snapshot file

            And lastly you bring the two together with a basic HTML file
            <head><META HTTP-EQUIV="refresh" content="300"></head>
            <body><script type="text/javascript">// Load XML
            var xml = new ActiveXObject("Microsoft.XMLDOM")
            xml.async = false

            // Load XSL
            var xsl = new ActiveXObject("Microsoft.XMLDOM")
            xsl.async = false

            // Transform

            This is also pretty basic, just a little bit of javascript.
            We load both files into XMLDOM objects and then use the transformNode method of the XML file to create our new layout.

            I'd strongly recommend looking at http://www.w3schools.com/xsl/xsl_languages.asp for more info on stylesheets, they are pretty powerful and best of all, they don't necessarily require server-side processing.

            Hope this helps!

            Cooper & Scully
            900 Jackson St Suite 100
            Dallas, TX 75202