On Thu, Sep 04, 2008 at 10:52:14AM +0200, Morten Brekkevold wrote:
On Thu, 28 Aug 2008 15:31:01 +0100 Tim Chown tjc@ecs.soton.ac.uk wrote:
Regarding the database change offer, we'd be up for trying it if you can provide the magic incantation :)
Sure, these two statements should reset the sysname of all CAM/ARP entried related to devices which are registered in your NAV at the moment:
UPDATE arp SET sysname=n.sysname FROM netbox n WHERE n.netboxid=arp.netboxid; UPDATE cam SET sysname=n.sysname FROM netbox n WHERE n.netboxid=cam.netboxid;
You can connect to the database using the psql command line tool, e.g. "psql manage nav" to connect to the manage database as the nav user. Use the password from NAV's db.conf.
I must warn you that these statements can be quite slow, depending on the number of records you have in the two tables. If you have made any actual device renames during NAV's runtime, these devices' records will also be falsified by these statements.
We have only been running for a month or so on 15 stacks, so it was actually very quick :)
manage=> UPDATE arp SET sysname=n.sysname FROM netbox n WHERE n.netboxid=arp.netboxid; UPDATE 12824 manage=> UPDATE cam SET sysname=n.sysname FROM netbox n WHERE n.netboxid=cam.netboxid; UPDATE 68724
As far as we can see, all the old historic IP-names are now updated to names, which has added consistency to the searches and machine tracker. Many thanks :)
If you want to use this essentially as a way to test how you'd add a conversion option to NAV, we're happy to test.
I don't think we want that. We value the historic accuracy of cam and arp records; we'd rather make sure the machine tracker can search records across name changes.
I agree - the above fix is a useful tip for when a new site like us doesn't have reverse DNS capability in place before firing up NAV, to 'clean' the data.