API & LDAP Users

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bomahony
Posts: 133
Joined: Wed Jul 04, 2018 10:46 am

API & LDAP Users

Post by bomahony »

Hey folks

I will need to add/remove users on a regular basis. However this is a PITA on 6 isolated environments, each hooked into their own LDAP server [rhel IDM]. The current process is to import the users each time from the "Add users from LDAP/AD" button. I put in my username as the dn string for myself, my password and it pops up the ldap tree.
I thought I would try via the API, and this option doesnt work in the API calls as there is no import. Thats fair enough.

So I thought i would use the documentation and try it, however this is what I get: [The auth-id i got from the authserver XGET referenced from the docs]
curl -k -XPOST "https://X.X.X.X/nagiosxi/api/v1/system/ ... y&pretty=1" -d 'auth_type=ldap&auth_server_id=5bacb57bc9d00&&ad_username=eddy&ldap_dn="cn=users,cn=accounts,dc=ref,dc=company,dc=net"&username=eddy&name=Electric Eddy&email=ed'
{
"success": "User account eddy was added successfully!",
"user_id": null
}
bomahony
Posts: 133
Joined: Wed Jul 04, 2018 10:46 am

Re: API & LDAP Users

Post by bomahony »

Turns out the issue was the missing @ in the email address [i didnt have to fill in name & email previously when doing it via GUI]

However cant seem to get the "User's Full DN:" in, as it appears blank every time.
bomahony
Posts: 133
Joined: Wed Jul 04, 2018 10:46 am

Re: API & LDAP Users

Post by bomahony »

Never mind, it was the " i had in there......
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: API & LDAP Users

Post by scottwilkerson »

bomahony wrote:Never mind, it was the " i had in there......
Ok great, glad it is resolved.

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked