4 Replies Latest reply on Jun 13, 2013 10:38 AM by mar1

    MANUALLY ENTERED HOSTNAMES CLEARED AFTER SUBNET SCAN

    mar1

      I upgraded to IPAM 3.1.1, and now all my Cisco devices that are not in DNS, have had their manually entered host names have been overwritten/blanked out. I called support and after waiting for a half hour, I spoke with a technician that told me this is normal and this field has always been dynamic, use custom field for my host names. First off, It was not always like this, second, why would you be able to change a dynamic field if it is just going to be erased on the next scan?

       

      I found this thread that was answered but it was with some file support sent the user. How would I get that file? http://thwack.solarwinds.com/message/146764#146764

        • Re: MANUALLY ENTERED HOSTNAMES CLEARED AFTER SUBNET SCAN
          dstratton

          I would like to know how to get this file as well.

          • Re: MANUALLY ENTERED HOSTNAMES CLEARED AFTER SUBNET SCAN
            mar1

            I opened a case on this and the technician (Matthew) was VERY helpful. This was the explanation:

             

            The hostname section of IPAM has always had it's information populated from the scan results, this much is true. Any information contained in there will be overwritten with the results of the scan to reflect the changing of the environment. What the difference between what you see now and what you see before is this reaction has been made much more aggressive in how it conducts it's data input.

             

            Before, if there was no DNS response for the hostname, but something was input into the field, it would leave the information present. This was great for those who used it for such, but it did cause problems down the road if the actual endpoint did change and this new host using the same IP could not reflect it's different hostname. Since a majority of people do not enable SNMP on workstations by default, this wouldn't be noticeable if the MAC could not be obtained. For SNMP devices it would still be dependent on identifying the MAC.

             

            Now, it will constantly place what it finds from the DNS lookup regardless of what it is. This doesn't mean the boat is sinking however as there is another, simple way in which to resolve this without a application regression. All you will need to do is go to IPAM Settings\Manage IPAM Custom Fields and create a custom field for the host name section you want. This field will be placed in the subnet\ip section and can be edited in the same way you would any other field. The difference however is this field is not subjected to scan results and will not be written. The only time it should change is if the IP becomes Available or you manually change it. Also make sure you edit the subnet and select Update, but not erase manually entered information as well.

             

            This information unfortunately is not very well documented and has been a long running fight of mine here to more clearly define what exactly is going on with this situation.

              • Re: MANUALLY ENTERED HOSTNAMES CLEARED AFTER SUBNET SCAN
                mar1

                I replied:

                 

                Thank you for clarifying the situation. This is a major issue for us due to the fact that I am the network administrator, and all of our network devices are not in DNS for security. They are in host files in our management servers. Because of this, undocumented change to the new version (at least not a WELL documented change) of IPAM, I have lost hostname information on 400 management interfaces, and countless VLAN interfaces.

                 

                Is there a way to extract the information from the hostname field in the backed up database (we created before the upgrade), and import to the active database in the new custom field?

                 

                Matthews answer:

                 

                Understood, I know the frustration. What I have may work for you as it was created for a similar bug that was removing hostname information from IPs. It's a number of queries that you would run in the database to pull the information from the ip history, then incorporating into a custom field of your creation.

                 

                As always, before any modifications are done to your database, it is recommend that it be backed up before hand. Here are the steps below you need to do for the implementation of these queries:

                 

                Steps:

                 

                1) Set the transient interval period to unlimited (safety purposes for now)

                 

                2) Automatic Scanning has been disabled for all subnets. You can do so by selecting all the subnets, hitting Edit and disabling automatic scanning. This can be enabled after all is completed.

                 

                3) Run the script to retrieve the hostnames from IP History. (Hostname retrieval.sql)

                 

                4) For all those ip nodes the status is set to used.

                 

                5) Created a Custom field where you want the hostname information to be populated to. You will first need to modify the query Insert missing rows (Custom Field - Missing rows.sql) to place the custom hostname field in. Please replace 'Assigned_Hostname' with the Custom Field Name created in IPAM

                 

                6) Modify the query update 'CustomHostname' in rows (Custom Field - Update CustomHostname in rows.sql) for the custom hostname as well. Please replace 'Assigned_Hostname' with the Custom Field Name created in IPAM

                 

                7) Once you do this run the script to insert the missing rows followed by updating the custom hostname. (Custom Field - Missing rows.sql followed by Custom Field - Update CustomHostname in rows.sql)

                 

                8) As the scanning is disabled, we have provided the script to re-calculate the subnet usage counts. Run the recalculate subnet usage script.

                 

                The scripts themselves are attached, but I have also included them within the email body itself. I recommend having the database backed up as always and engaging your DBA. If you have any questions, please let me know.

                 

                ************************************************Hostname retrieval.sql************************************************************************************

                IF EXISTS (SELECT * FROM sys.objects WHERE [name]='IPAM_HostnamesBackup' AND [type]='u')

                 

                    DROP TABLE [IPAM_HostnamesBackup]

                 

                GO

                 

                WITH [Hostnames] AS

                 

                (

                 

                    SELECT ROW_NUMBER() OVER (PARTITION BY [IPNodeId] ORDER BY [Time] DESC) AS [RowNumber], [IPNodeId], [Time], [FromValue],[IntoValue]

                 

                    FROM [IPAM_IPHistory]

                 

                    WHERE [HistoryType]='3' AND [ModifiedBy] < 1000 AND [FromValue] IS NOT NULL AND [FromValue]<>'' AND

                 

                          [IntoValue] IS NOT NULL AND [IntoValue]=''

                 

                )

                 

                SELECT [IPNodeId], [Time], [FromValue]

                 

                INTO [IPAM_HostnamesBackup]

                 

                FROM [Hostnames] WHERE [RowNumber] = 1

                 

                GO

                 

                 

                 

                SELECT host.[IPNodeId], host.[FromValue] FROM [IPAM_HostnamesBackup] host

                 

                WHERE NOT EXISTS(SELECT 1 FROM [IPAM_NodeAttrData] attr WHERE attr.[IPNodeId]=host.[IPNodeId])

                **************************************************************************************************************************************************************

                 

                ************************************************Update CustomHoastname in rows.sql******************************************************************

                UPDATE [IPAM_NodeAttrData] SET [Assigned_Hostname] = host.[FromValue]

                 

                FROM [IPAM_NodeAttrData] attr

                 

                INNER JOIN [IPAM_HostnamesBackup] host ON attr.[IPNodeId] = host.[IPNodeId]

                **************************************************************************************************************************************************************

                 

                ************************************************Update Recalculate subnet usage.sql******************************************************************

                DECLARE @sid int

                DECLARE subnets CURSOR FOR SELECT GroupId FROM IPAM_Group WHERE GroupType IN (8)

                OPEN subnets

                FETCH NEXT FROM subnets INTO @sid 

                WHILE @@FETCH_STATUS = 0

                BEGIN

                        EXEC IPAM_spTouchSubnetCounts @sid

                        FETCH NEXT FROM subnets INTO @sid

                END

                CLOSE subnets

                DEALLOCATE subnets

                EXEC IPAM_spTouchGroupCounts 0

                **************************************************************************************************************************************************************

                 

                ************************************************Custom Field - missing rows.sql******************************************************************

                INSERT INTO [IPAM_NodeAttrData] ([IPNodeId], [Assigned_Hostname])

                 

                SELECT host.[IPNodeId], host.[FromValue] FROM [IPAM_HostnamesBackup] host

                 

                WHERE NOT EXISTS(SELECT 1 FROM [IPAM_NodeAttrData] attr WHERE attr.[IPNodeId]=host.[IPNodeId])

                **************************************************************************************************************************************************************

                 

                THIS WORKED TO RECOVER MY MISSING HOSTNAMES.

                1 of 1 people found this helpful