Re: Is it possible to change a nodes Foreign ID?
Jonathan Heard <[email protected]>
| Newsgroups | gmane.network.opennms.general |
|---|---|
| Message-ID | <[email protected]> |
Hi John,  I'm not an expert on this, but I think the database is populated based on the contents of the XML for each foreign source as defined in /etc/opennms/imports/<foreign-source>.xml I believe that if you copy this file into the /etc/opennms/imports/pending and edit one of more foreign IDs, you can then update them in the database by going to 'Configure OpenNMS' -> 'Manage Provisioning Requisitions' and click the 'Synchronize' button for your foreign source. You can select 'No' to the rescan question that pops up. If all went well, the file in the pending directory should have gone and the foreign ID should be correct in the main XML as well as the Database and the rest of OpenNMS. Good Luck Jonathan On 27/09/17 01:03, JohnD Blackburn wrote: > > I tried my sql statement in my sandpit environment, and it doesn’t > work. It initially changes the foreign ID of the node, but then once > the requisition refreshes, the foreign ID changes back. > > What am I missing? Where else is the foreign ID being stored? > > Regards, > > John. > > *From:*JohnD Blackburn [mailto:[email protected]] > *Sent:* Monday, 25 September 2017 4:02 PM > *To:* General OpenNMS Discussion <[email protected]> > *Subject:* Re: [opennms-discuss] Is it possible to change a nodes > Foreign ID? > > I’ve been poking around in the postgres database, and have found that > the NODE table has a column for foreignid. > > Is that the only reference in the database to foreignid? That is, it > is not a foreign key column? > > If so, the following statement should correct my foreign ID’s? > > update node > > set foreignid=nodelabel > > where foreignsource is not null > > and foreignid != nodelabel > > ; > > And then a restart of OpenNMS for good measure? > > Regards, > > John > > *From:*JohnD Blackburn [mailto:[email protected]] > *Sent:* Monday, 25 September 2017 2:35 PM > *To:* General OpenNMS Discussion > <[email protected] > <mailto:[email protected]>> > *Subject:* [opennms-discuss] Is it possible to change a nodes Foreign ID? > > Hi All, > > We had a bunch of nodes that due to a misunderstanding of how to > configure Provisioning Requisitions, were created with an > auto-generated Foreign ID, rather than the real foreign ID from the > foreign source. > > Is there an easy way to update the Foreign ID of these nodes without > having to delete and re-add these nodes? > > The foreign ID should have been the same as the node label, and now > that we can specify foreignSource/foreignID as parameters to > send-event.pl, we can’t actually make use of those parameters, due to > the foreign ID being incorrect. > > (even a bunch of SQL statements I could throw at the postgresql > database would be handy – this is a one off change I would be making, > as we are fixing the Provisioning process to correctly set the Foreign > ID.) > > Regards, > > John > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > _______________________________________________ > Please read the OpenNMS Mailing List FAQ: > http://www.opennms.org/index.php/Mailing_List_FAQ > > opennms-discuss mailing list > > To *unsubscribe* or change your subscription options, see the bottom of this page: > https://lists.sourceforge.net/lists/listinfo/opennms-discuss ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Please read the OpenNMS Mailing List FAQ: http://www.opennms.org/index.php/Mailing_List_FAQ opennms-discuss mailing list To *unsubscribe* or change your subscription options, see the bottom of this page: https://lists.sourceforge.net/lists/listinfo/opennms-discuss