I searched every-which-way for a previous topic which answered this but came up empty...
We have four Nagios XI servers (two active, two standby) and I need to sync up all the user accounts across all of them. The accounts involved are all "imported" from Active Directory, with thankfully only one base DN for all accounts. It's roughly 150 accounts total and everything is working great other than the lack of uniformity. In other words some users were created on one set but not another, and some users weren't even created on the standby server for each active one.
I can get the username for everyone from the /nagiosxi/api/v1/system/user?apikey=XYZ&pretty=1 call but that doesn't include the full DNs. There are at least three different OUs involved, sort of like this:
Code: Select all
CN=fred,OU=Employees,OU=TeamX,OU=DepartmentA,DC=mycompany
CN=barney,OU=Vendors,OU=TeamY,OU=DepartmentB,DC=mycompany
CN=wilma,OU=Employees,OU=TeamZ,OU=DepartmentC,DC=mycompany
Is there a database query you can tell me which will return the full DN for all the users / each user?
(Even some SQL for a specific user would be better than nothing. I have no problem scripting something to iterate over a list if there's a query to get just one.)
Needless to say my goal is to take the full DN and POST the creation of missing users on each XI server. If I have to do it manually it's going to be a royal pain.
Thanks!!