User permissions

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
eFusion
Posts: 33
Joined: Wed Jan 29, 2014 9:52 am

User permissions

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: User permissions

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
eFusion
Posts: 33
Joined: Wed Jan 29, 2014 9:52 am

Re: User permissions

Post by eFusion »

Thank you for the answer.
How to bind generic-user2 template to the some host?
In nagiosQL on create/edit?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: User permissions

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
eFusion
Posts: 33
Joined: Wed Jan 29, 2014 9:52 am

Re: User permissions

Post by eFusion »

I will try.
Thanks a lot
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: User permissions

Post by scottwilkerson »

eFusion wrote:I will try.
Thanks a lot
Sounds good. Let us know how it works out
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked