Page 1 of 1

Nagios XI - Copy Users to a new Nagios XI

Posted: Wed Jan 29, 2020 11:52 am
by ssoliveira
Good afternoon;

I reinstalled Nagios XI on a new server; and we are working on reconfiguring the monitored services.

We have hundreds of users configured to authenticate via LDAPS (Active Directory);

Reconfiguring these users manually is taking a lot of work;

Are there any configuration files that have a list of each users that i can edit? Or even a table in MySQL that I can edit?

Re: Nagios XI - Copy Users to a new Nagios XI

Posted: Wed Jan 29, 2020 1:32 pm
by mbellerue
Probably the best route here is to use the API. If you go to Help -> System Reference, you will see a section there for Users. If you have a few users added already, you could use a GET call to grab the data on an existing user, and use that as a template for the building out the rest of the users.

Re: Nagios XI - Copy Users to a new Nagios XI

Posted: Wed Jan 29, 2020 2:00 pm
by ssoliveira
Hi @mbellerue

The suggested method does not have associations with LDAP \ Active Directory

It will not help to just create users; I need to create and already associate with the Activie Directory;

Are there other ways?

Code: Select all

curl -XGET "https://aaaaaa/nagiosxi/api/v1/system/user?apikey=bbbbb&pretty=1"

{
    "records": xxx,
    "users": [
        {
            "user_id": "7",
            "username": "xxxxx",
            "name": "xxxxxxxx",
            "email": "xxxxxxxxx",
            "enabled": "1"
        },
        {
            "user_id": "6",
            "username": "nagiosreader",
            "name": "Nagios Reader",
            "email": "root@localhost",
            "enabled": "1"
        }
        ....
    ]
}

Re: Nagios XI - Copy Users to a new Nagios XI

Posted: Wed Jan 29, 2020 2:52 pm
by mbellerue
Huh, I would have expected the GET to return all of the information on the user. Well, no matter, the POST will allow you to create an AD/LDAP associated user account. It just would have been really nice to have a template to work off of. Can you take a look at the POST system/user section, and see if that has everything you're looking for?

Re: Nagios XI - Copy Users to a new Nagios XI

Posted: Wed Jan 29, 2020 3:46 pm
by ssoliveira
Hello,

I have several LDAPs mapped; I will have to do this in parts :-(

Another problem; I can't find which attribute I use to grant access to "Core Config Manager access: FULL" permission.

The "POST system/user" documentation contains information about:

can_see_all_hs integer 0 or 1
can_control_all_hs integer 0 or 1
can_reconfigure_hs integer 0 or 1
can_control_engine integer 0 or 1
can_use_advanced integer 0 or 1
read_only integer 0 or 1 (all others won't work)

But there is no way to provide access to Core Config;

I don't want to give Admin access to all users; they need to be ordinary users; with permission to create new monitoring; etc

Re: Nagios XI - Copy Users to a new Nagios XI

Posted: Thu Jan 30, 2020 3:32 pm
by mbellerue
That is an unfortunate limitation in our API. I will see about adding a feature request for that.

Unfortunately that doesn't help you, right now. Which means the last, and personally my least favorite, course of action is diving into the database. This can be very tricky, as tables, fields, and sometimes even data are linked in various ways. However, you might be able to get away with copying the data from the ccm_access and ccm_access_list fields in the xi_usermeta table in the nagiosxi database.

Take it slowly, and test, test, test.