8 Replies Latest reply on Jan 6, 2005 8:10 AM by rjenk

    XML

      Does anyone use XML, I came across in the Network Performance Monitor that you can take a XMl snapshot and on a time table. I am trying to figure out how to view the XML snapshot.



      David Townzen
      Northrop Grumman
      Network Engineer
      Madigan Army Medical center

      David.Townzen@NW.Amedd.Army.Mil
        • Re: XML
          Found a good XML Viewer at WWW.ALTON.COM StyleVision is the name of the XML Viewer.

          David Townzen
          Northrop Grumman
          Network Engineer
          Madigan Army Medical center

          David.Townzen@NW.Amedd.Army.Mil
          • Re: XML
            Try using an XSL File to define the output

            Paste this into a text file with a .htm extension:
            --------------SystemStatus.htm--------------
            <html>
            <head><META HTTP-EQUIV="refresh" content="300"></head>
            <body><script type="text/javascript">// Load XML
            var xml = new ActiveXObject("Microsoft.XMLDOM")
            xml.async = false
            xml.load("NetPerfMon-NetObjects.SnapShot")

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

            // Transform
            document.write(xml.transformNode(xsl))</script>

            </body>
            </html>
            --------------End Copy--------------

            Then paste this into a file called Systems.xsl
            --------------Systems.xsl--------------
            <?xml version="1.0"?>

            <xsl:stylesheet version="1.0"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

            <xsl:template match="/">
              <html>
              <body>
                <h2>System Status</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>
                </tr>
            <xsl:for-each select="NetPerfMon/NetworkNodes/NetworkNode/Interfaces/Interface">
                <tr>
                  <td><xsl:value-of select="../../@NodeName"/></td>
                  <td><xsl:value-of select="@InterfaceCaption"/></td>
                  <td><xsl:value-of select="@OperStatus"/></td>
            <xsl:choose>
              <xsl:when test="RawData/@InPercentUtil > 50">
                  <td bgcolor="red"><xsl:value-of select="@InPercentUtil"/></td>
              </xsl:when>
              <xsl:otherwise>
                  <td><xsl:value-of select="@InPercentUtil"/></td>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:choose>
              <xsl:when test="RawData/@OutPercentUtil > 50">
                  <td bgcolor="red"><xsl:value-of select="@OutPercentUtil"/></td>
              </xsl:when>
              <xsl:otherwise>
                  <td><xsl:value-of select="@OutPercentUtil"/></td>
              </xsl:otherwise>
            </xsl:choose>

                  <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>
                </tr>
                </xsl:for-each>
                </table>
              </body>
              </html>
            </xsl:template></xsl:stylesheet>
            --------------End Copy--------------
            These two files should be located in the same folder as the snapshot.
            To view, just open the .htm file, it will autorefresh every 5 minutes.

            What is happening is the .htm page will load the file NetPerfMon-NetObjects.SnapShot and format it in a table view as defined in the .xsl file.  When an in/out value is over 50% the cell turns red.  It's a little bit basic but a good start for adapting to your own needs.
            • Re: XML
              Thanks masoncooper! I have been looking for some code to do this! Thanks again!
              • Re: XML
                masoncooper -

                Thank you oh so much!  I've been trying to figure out how to do this on my own for a while with no success.  You've saved me a whole bunch o' trouble.

                Thanks again.

                Ken Cohen
                • Re: XML
                  Thank you masoncooper for helping those of us who don't know what they are doing. I followed your instrutions but i keep getting an error on line 13 which is the // Transform command in the SystemStatus.htm. Would you happen to know why i would be getting this error?

                  quote:Originally posted by masoncooper

                  Try using an XSL File to define the output

                  Paste this into a text file with a .htm extension:
                  --------------SystemStatus.htm--------------
                  <html>
                  <head><META HTTP-EQUIV="refresh" content="300"></head>
                  <body><script type="text/javascript">// Load XML
                  var xml = new ActiveXObject("Microsoft.XMLDOM")
                  xml.async = false
                  xml.load("NetPerfMon-NetObjects.SnapShot")

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

                  // Transform
                  document.write(xml.transformNode(xsl))</script>

                  </body>
                  </html>
                  --------------End Copy--------------

                  Then paste this into a file called Systems.xsl
                  --------------Systems.xsl--------------
                  <?xml version="1.0"?>

                  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

                  <xsl:template match="/">
                  <html>
                  <body>
                  <h2>System Status</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>
                  </tr>
                  <xsl:for-each select="NetPerfMon/NetworkNodes/NetworkNode/Interfaces/Interface">
                  <tr>
                  <td><xsl:value-of select="../../@NodeName"/></td>
                  <td><xsl:value-of select="@InterfaceCaption"/></td>
                  <td><xsl:value-of select="@OperStatus"/></td>
                  <xsl:choose>
                  <xsl:when test="RawData/@InPercentUtil > 50">
                  <td bgcolor="red"><xsl:value-of select="@InPercentUtil"/></td>
                  </xsl:when>
                  <xsl:otherwise>
                  <td><xsl:value-of select="@InPercentUtil"/></td>
                  </xsl:otherwise>
                  </xsl:choose>
                  <xsl:choose>
                  <xsl:when test="RawData/@OutPercentUtil > 50">
                  <td bgcolor="red"><xsl:value-of select="@OutPercentUtil"/></td>
                  </xsl:when>
                  <xsl:otherwise>
                  <td><xsl:value-of select="@OutPercentUtil"/></td>
                  </xsl:otherwise>
                  </xsl:choose>

                  <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>
                  </tr>
                  </xsl:for-each>
                  </table>
                  </body>
                  </html>
                  </xsl:template></xsl:stylesheet>
                  --------------End Copy--------------
                  These two files should be located in the same folder as the snapshot.
                  To view, just open the .htm file, it will autorefresh every 5 minutes.

                  What is happening is the .htm page will load the file NetPerfMon-NetObjects.SnapShot and format it in a table view as defined in the .xsl file. When an in/out value is over 50% the cell turns red. It's a little bit basic but a good start for adapting to your own needs.
                  • Re: XML
                    sir,
                    Greetings
                    My Name is Senthil kumar.still i am working in abtinfo.net as network admin.
                    presently we are using solarwinds engineers edition.we want to see the traffic and device details in web. so i find your xml document and i can do all as per you told me .
                    but  i can't able to see the details and i am seeing only
                    ***************************************
                    System Status
                    Device Interface Status % In % Out In Out Max In Today Max Out Today
                    ***************************************
                    so kindly help me about this matter .
                    can i do any other work?
                    pls tell me in details.

                    i will wait for your golden mail.

                    Thanks in advance
                    senthil






                    senthilkumar
                    • Re: XML
                      I am using this XLS file and it works for me, however it only displays interfaces. Does anyone know how to modify the code to have it display nodes and interfaces?
                      • Re: XML
                        rjenk
                        Works as advertised for our shop.  Do have one request if someone knows how to do it...there is a TimeStamp in the .SnapShot file and it would be nice if that was displayed at the top of the page so that you would know how current the displayed data is.  Any suggestions?  I have played with is some but I am very new to XML.

                        Thanks,
                        Ray