Page 1 of 1

Bulk User Creation

Posted: Tue Jan 16, 2018 5:27 pm
by TCBeekley
I have a couple hundred users to create in Fusion 4. Is there a shortcut? I don't mind scripting the input if the calls user.php are using to create the user are available. This would be helpful down the road to automate user creation as well.

Thanks!

Tim Beekley

Re: Bulk User Creation

Posted: Tue Jan 16, 2018 5:51 pm
by dwhitfield
Are these users AD/LDAP users by chance? An AD/LDAP component is coming in Fusion 4.1. Unfortunately, I do not have an ETA on when that might be out except that the roadmap says
around Q1 2018
It's not up on our internal QA board though, so Q1 may not happen.

Re: Bulk User Creation

Posted: Thu Jan 18, 2018 9:47 am
by TCBeekley
They are AD/LDAP, as they'll link to the AD/LDAP users we already have in Nagios XI. Would it be possible to get the SQL calls? I could script it, otherwise, we're looking at A LOT of hours to create the users, then re-create them when AD/LDAP integration comes on-line.

Re: Bulk User Creation

Posted: Thu Jan 18, 2018 1:20 pm
by cdienger
To connect to the databas:

mysql -ufusion -pfusion -Dfusion

and an example of adding a user:

INSERT INTO users (username, password, name, email, enabled, level) VALUES ("bob", "password", "Robert", "[email protected]", 1, 0);

The level0 is for a user and 1 is for an admin. There are additional functions for the other settings that can be found in /usr/local/nagiosfusion/html/includes/utils/users.inc.php if needed. I haven't had a chance to test them out.

Also, ***BIG WARNING***, modifying the database directly is not something we usually recommend and can be dangerous if not careful. The above was tested on a lab machine and minimally tested.

Re: Bulk User Creation

Posted: Thu Jan 18, 2018 5:05 pm
by TCBeekley
Thanks!

I accept the risks associated with trying this out. We'll try on a dev box for sure. This is a huge help!

Re: Bulk User Creation

Posted: Thu Jan 18, 2018 5:19 pm
by cdienger
Glad to help! :)