Import users from one Nagios XI system to another

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Import users from one Nagios XI system to another

Post 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?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Import users from one Nagios XI system to another

Post 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
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Import users from one Nagios XI system to another

Post by gormank »

How about a way to create users via the shell?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Import users from one Nagios XI system to another

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Import users from one Nagios XI system to another

Post by gormank »

I'm not sure "don't do that" is the level of support I'm paying for.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Import users from one Nagios XI system to another

Post 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.
Former Nagios employee
Locked