Page 1 of 1

Import users from one Nagios XI system to another

Posted: Tue Jun 30, 2015 12:23 pm
by gormank
Rather than manually creating users in multiple Nagios systems, I'm trying to figure out how to import them. I can import contact*.cfg and get the user's contact info in the other systems.
I see the users are in /usr/local/nagiosxi/etc/htpasswd.users, but when I copy that to another system and restart httpd or or the monitoring engine, the users still aren't there.
We also keep systems synced by dumping the DBs and importing the files into postgress and mysql. Still, users aren't restored.
Any ideas?

Re: Import users from one Nagios XI system to another

Posted: Tue Jun 30, 2015 1:47 pm
by ssax
The htpasswd.users file is for accessing the Nagios Core backend (http://yourxihost/nagios). Unfortunately there is not currently a way to import users into XI, they are stored in the postgresql database and we don't recommend that you try to interact directly with the backend databases.

I already created a feature request for this:

Code: Select all

NEW TASK ID 5766 created - Nagios XI Feature Request: Add ability to bulk import users

Re: Import users from one Nagios XI system to another

Posted: Tue Jun 30, 2015 5:03 pm
by gormank
How about a way to create users via the shell?

Re: Import users from one Nagios XI system to another

Posted: Wed Jul 01, 2015 9:15 am
by lmiltchev
Creating users via the shell is not impossible, but again, you will need to query the postgres database... As ssax said:
Unfortunately there is not currently a way to import users into XI, they are stored in the postgresql database and we don't recommend that you try to interact directly with the backend databases.

Re: Import users from one Nagios XI system to another

Posted: Thu Jul 02, 2015 10:07 am
by gormank
I'm not sure "don't do that" is the level of support I'm paying for.

Re: Import users from one Nagios XI system to another

Posted: Thu Jul 02, 2015 10:24 am
by tmcdonald
There is a difference between "Don't do that" and "We do not recommend doing that". There is a very good reason we recommend against direct database manipulation, and it's because people can easily break their installs if they try to do database manipulation outside of what the software does natively. I will certainly ask the developers for a safe way to do this, but we would need to test in-house before we could post instructions here. Even then, it would be wise to take proper backups (or preferably VM snapshots) before attempting the import.

As ssax pointed out, there is not currently a way to export/import users, so he created a feature request for such functionality. If this is something you need done on a timeline, we do offer custom development and our Sales team would be happy to assist you with this.