Page 1 of 1

User permissions

Posted: Mon Jan 14, 2019 5:04 am
by eFusion
First of all - sorry for my english :D
I looked for the answer to this question on the forum but found nothing.
I have Nagios Core with big numbers of objects.
I need set user permissions to monitoring only a part of all objects.
I have 3 users:
  • nagiosadmin - admin permissions
    user1 - admin permissions
    user2 - need not full access
I think that i need to create a new group of hosts and bind user2 to it. After that move in new group some objects.
I tried next:

In nagios/objects/contacts.cfg i create this blocks:

Code: Select all

define contact{
        contact_name             user2; 
        use                             generic-contact; 
        alias                           user2; 
        email                         user2@domain.com;
        }
define contactgroup{
       contactgroup_name user2
       alias user2
       members user2
}
In nagios/objects/templates.cfg i create this block:

Code: Select all

define host{
        name generic-user2;
        use generic-switch >;
        contact_groups user2;
        hostgroups user2_switches;
        register 0;
}
In directives authorized_for_* i don't see restrictions for group of hosts.

I am totally confused.
What i'am forget to configure or modify.
Thanks for help

Re: User permissions

Posted: Mon Jan 14, 2019 8:30 am
by scottwilkerson
In your example the user2 contact would have access to the hosts that the generic-user2 template was applies as long as the contactgroup directive wasn't overwritten by another contactgroup directive in the host you applied the template to.

The authorized_for_* are only for broad access to everything

Re: User permissions

Posted: Mon Jan 14, 2019 12:14 pm
by eFusion
Thank you for the answer.
How to bind generic-user2 template to the some host?
In nagiosQL on create/edit?

Re: User permissions

Posted: Mon Jan 14, 2019 12:28 pm
by scottwilkerson
If you are using nagiosql you would add generic-user2 as a template to the specific host

then write config files, verify and restart nagios

Re: User permissions

Posted: Mon Jan 14, 2019 2:31 pm
by eFusion
I will try.
Thanks a lot

Re: User permissions

Posted: Mon Jan 14, 2019 2:36 pm
by scottwilkerson
eFusion wrote:I will try.
Thanks a lot
Sounds good. Let us know how it works out