I have a Nagios Core 4.4.5 and I am triying that one member/user belongs to multiple contactgroups/departments to isolate determinate services to several users.
For example: One user that belongs to Securiry department only see the Hosts of this department and I want that this user belongs also to System department and he will can see the Hosts of System Department.
My nagios is installed in the path /opt/nagios and the contacts groups are in the path /opt/nagios//etc/deparments/:
[root@s503pro01sc2 /opt/nagios/etc/departaments]# ll
total 36
drwxrwxr-x+ 2 sistemas nagios@admin.consejeria.jda 4096 may 5 12:18 Apps
drwxrwxr-x+ 2 sistemas nagios@admin.consejeria.jda 4096 may 5 12:18 BBDD
drwxrwxr-x+ 2 sistemas nagios@admin.consejeria.jda 4096 may 7 15:03 Sys
drwxrwxr-x+ 2 sistemas nagios@admin.consejeria.jda 4096 may 7 15:05 Sec
In each group we have the c_user.cfg where the data of the user is described. Also in the group is the file gc_NameOfDepartment.cfg we put the name of the user. If I do this in two Department's directories I can't reload the nagios service. Only If I have the user in one contact group I can reload nagios with the new configuration...
Do you know the way to have One user in two contacts groups?? Thanks
Nagios - One user in multiple contacts groups
Re: Nagios - One user in multiple contacts groups
You should not redefine the user. That's not possible.
You should have the user data in separate directory or file and then add this username to the groups you want this user to be in.
You should have the user data in separate directory or file and then add this username to the groups you want this user to be in.
Code: Select all
define contact {
contact_name sec_officer
alias Security Officer
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r
service_notification_options w,u,c,r
host_notification_commands host-notify-by-email,host-notify-by-sms
service_notification_commands notify-by-email,notify-by-sms
retain_status_information 1
retain_nonstatus_information 1
email security@company.com
pager 180123123456
register 1
}
Code: Select all
define contactgroup {
contactgroup_name Apps
alias Apps
members sec_officer
register 1
}
define contactgroup {
contactgroup_name BBDD
alias BBDD
members sec_officer
register 1
}
define contactgroup {
contactgroup_name Sys
alias Sys
members sec_officer
register 1
}
Rob Hassing
Re: Nagios - One user in multiple contacts groups
rhassing wrote:You should not redefine the user. That's not possible.
You should have the user data in separate directory or file and then add this username to the groups you want this user to be in.
Code: Select all
define contact { contact_name sec_officer alias Security Officer host_notifications_enabled 1 service_notifications_enabled 1 host_notification_period 24x7 service_notification_period 24x7 host_notification_options d,u,r service_notification_options w,u,c,r host_notification_commands host-notify-by-email,host-notify-by-sms service_notification_commands notify-by-email,notify-by-sms retain_status_information 1 retain_nonstatus_information 1 email security@company.com pager 180123123456 register 1 }
Code: Select all
define contactgroup { contactgroup_name Apps alias Apps members sec_officer register 1 } define contactgroup { contactgroup_name BBDD alias BBDD members sec_officer register 1 } define contactgroup { contactgroup_name Sys alias Sys members sec_officer register 1 }
Yes, it works! I didn't know it works this way... Thanks
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios - One user in multiple contacts groups
Locking thread