2 Replies Latest reply on Sep 8, 2008 11:01 AM by sotherls

    How to edit a resource?

      Hello


      I am trying to edit the Nodes with Problems resource so that as well as showing the node, the status, the response time and the percent loss, I can also see what time and date the node went down! Can any one please point me in the right direction? 


      Many thanks


      Darren

        • Re: How to edit a resource?
          mark wiggans



           ...I can also see what time and date the node went down! Can any one please point me in the right direction? 

           

           

          this thread may help- How long each interface or node was down.

          • Re: How to edit a resource?
            sotherls

            I made some modifications to the 03-DownNodes.Resource and had it display the Status icon, Device, Last Change and Duration. I also had it display a few other things particular to our organization and it works like a champ.


            Make a backup copy of the original and then use this new resource.


            <!-- Title=Down Nodes -->
            <!-- Level=7 -->
            <!--#include Virtual=/NetPerfMon/scripts/Resource.asp -->
            <%
             Title=Resource.Title
             If Len(Title)=0 Then Title="Down Nodes"
             SubTitle="The Following Nodes are not Responding"
             if Len(Resource.SubTitle)>0 Then SubTitle=Resource.SubTitle
             HelpPage="DownNodes"
             EditButton="/NetPerfMon/Resources/Filter.Edit.asp?ResourceID=" & Resource.ResourceID & "&ViewID=" & ViewID
             DoResourceHeader
             Set SQLResource = NetPerfMon.NewSQLResource
             SQLResource.SQL="SELECT N.NodeID as NodeID,N.StatusLED as Status, N.Caption AS Device,MAX(E.EventTime) AS DownTime,Cast(DateDiff(day,MAX(E.EventTime),getdate()) as varchar) + ' Day(s) ' + convert(char(8),dateadd(second,DateDiff(second,MAX(E.EventTime),getdate()),0),14) as Duration FROM Nodes N INNER JOIN Events E ON E.NetworkNode = N.NodeID where N.status = 2 and eventtype <101 GROUP BY N.StatusLED, N.Caption, N.NodeID"
             
             SQLResource.Filter= Resource.GetProperty("Filter")
             SQLResource.Execute
            %>


            <table border="0" cellPadding="2" cellSpacing="0" width="100%">
            <tr>  
            <td class="Property" vAlign="center">Status </td>
            <td class="Property" vAlign="center">Device </td>
            <td class="Property" vAlign="center">Last Change </td>
            <td class="Property" vAlign="center">Duration </td>
            </tr>
            <% Do While Not SQLResource.EOF %>
            <tr>
             <td class="Property" vAlign="center" width="20"><%=SQLResource.GetProperty("Status;SmallIcon")%> </td>
             <td class="Property"><a <%=SQLResource.GetProperty("NodeParamString")%>  href="/NetPerfMon/View.asp?View=NodeDetails&NetObject=N:<%=SQLResource.GetProperty("NodeID")%>"><%=SQLResource.GetProperty("Device")%></a> </td>
             <td class="Property"><%=SQLResource.GetProperty("Downtime")%> </td>
             <td class="Property"><%=SQLResource.GetProperty("Duration")%> </td>
            </tr>
            <%  
              SQLResource.MoveNext
             Loop
            %>
            </table>
            <br>