4 Replies Latest reply on Jan 4, 2019 1:19 AM by wfriesn1

    IPAM Search - Extensions For You


      OK - so IPAM, for some crazy reason, doesn't search the Display Name or Description of a subnet or supernet.  It only searches for nodes.  Which, in my opinion, is completely useless and is a major, major flaw in this software.


      Before we moved forward in combining two organizations, I was tasked with coming up with a solution for IPAM software.  We settled on SW (we already use it) but we had to get this flaw fixed before we moved forward.  So - I had to figure out how to do this...


      I present to you, my fellow Thwackers - a basic search function for solarwinds that allow you to search Display Names and Descriptions - and also click on those links and take you right to the source in IPAM.


      Hopefully you're somewhat familiar with ASPX coding and able to follow along.  On the second page (OfficeSearchResults.aspx) you will need to make a databind to the IPAM database.  


      I'm no coder, and I'm not sure I can be of much help, but I can tell you this works very well, and has allowed us to get the software to function as it should.  I can search for "10.176." and it will show me all the subnets and supernets that have 10.176. in them.. which is waaay more helpful than showing me all the nodes with 10.176 in them.  I realize this may be very sloppy code for professionals, but hey.. I'm a network guy, not a coder.


      Anyway, hopefully this will translate for everyone and you can get this to work on your side and you can extend it.  I have broken this down to the basic parts here, but I've used it to include searching for extra custom fields, like State, Country, etc.  Searching in the country field for "France" -- gives me all the subnets in France.  Quite nice.  The demo below is only for Display name and Description.





      First is the search page - very basic - you can add whatever you want... here I am only searching Display Name and Description (Office Name)



      <form id="form1"  method="get" action="/OfficeSearchResults.aspx" style="width: 436px">



             <td>Display Name<br />

                  <input type="text" class="tb5"  style="width: 198px; height: 33px" name="DisplayName" title="DisplayName" id="DisplayName" tabindex="1" />


             <td>Office Name<br />

                  <input type="text" class="tb5"  style="width: 198px; height: 33px" name="OfficeName" title="Comments" id="OfficeName" tabindex="2"/>




             <td colspan="2"> </td>



             <td style="height: 30px" colspan="2" class="auto-style1"><input type="submit" value="Search"  tabindex="3" class="Reportbutton"></td>







      Next - the office search results page:


      This page name is referenced above as "OfficeSearchResults.aspx"



      <meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />

        <title>Office Portal</title>

        <script language="javascript">

        function GoToIPAM(groupID){

            var newURL = "http://IPAM.Mycompany.com/Orion/IPAM/Subnets.aspx?opento=" + groupID;








      <div style="position: absolute;visibility:visible;  left: 141px; top: 57px; right: 77px; height: 413px;" >


         <asp:SqlDataSource ID="SqlDataSource1" runat="server" CancelSelectOnNullParameter="False"

            ConnectionString="<%$ ConnectionStrings:IPAM_ConnectionString %>"


            SelectCommand="SELECT IPAM_GroupReportView.FriendlyName AS [Display Name],  IPAM_GroupAttrData.Common_Name as Office_Name,  IPAM_GroupReportView.GroupID

            FROM IPAM_GroupReportView LEFT OUTER JOIN IPAM_GroupAttrData ON (IPAM_GroupReportView.GroupId = IPAM_GroupAttrData.GroupId)    

            WHERE ( IPAM_GroupReportView.friendlyname like '%' + @DisplayName + '%' ) or (  IPAM_GroupAttrData.Common_Name like '%' + @OfficeName + '%')" >



                <asp:QueryStringParameter Name="DisplayName" QueryStringField="DisplayName" DefaultValue="" Type="String"  ConvertEmptyStringToNull="True"   />

                <asp:QueryStringParameter Name="OfficeName" QueryStringField="OfficeName" DefaultValue="" Type="String"  ConvertEmptyStringToNull="True"   />





        <table class="tableboarders"  style="width: 658px; height: 197px; cellpadding=5px; ">



          Dim OfficeSearchCriteria

          If (request.querystring("Displayname")) <> "" Then

              OfficeSearchCriteria = (request.querystring("DisplayName"))


              OfficeSearchCriteria = (request.querystring("OfficeName"))

          End If


        <td  class="HeaderStyle" colspan="2" style="height: 23px; width: 1141px;">Office Search: <% response.write(OfficeSearchCriteria) %> </td>



        <td colspan="2" style="width: 1141px">

        <form id=Form1 runat="server">

          <asp:GridView runat="server" id="GridView1" DataSourceID="SqlDataSource1"  CellPadding="4"








              AlternatingItemStyle-BackColor="#dddddd"  GridLines="None" Width="634px" Font-Names="Verdana" ForeColor="#333333">

              <AlternatingRowStyle BackColor="White" />


                <asp:TemplateField HeaderText="IP Addressing" >


                     <a href='javascript:GoToIPAM(<%#Eval("GroupID")%>)'><%#Eval("Display Name")%></a>



                <asp:TemplateField HeaderText="Office Name" >







          <EditRowStyle BackColor="#2461BF" />

                             <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />


        <HeaderStyle HorizontalAlign="Center" BackColor="#507CD1" Font-Bold="True" ForeColor="White"></HeaderStyle>

                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />

                             <RowStyle BackColor="#EFF3FB" />

                             <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />

                             <SortedAscendingCellStyle BackColor="#F5F7FB" />

                             <SortedAscendingHeaderStyle BackColor="#6D95E1" />

                             <SortedDescendingCellStyle BackColor="#E9EBEF" />

                             <SortedDescendingHeaderStyle BackColor="#4870BE" />