Unable to authorize read only user

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
AcidTech
Posts: 2
Joined: Mon Sep 25, 2017 2:12 am

Unable to authorize read only user

Post by AcidTech »

Hey everybody,

I try to authorize an user to see only some services/hosts that i choose. I found with Google that i need to enable "authorized_for_read_only" options, and add to the hosts/services that i want, the "contacts" options, but when i log in to the web interface, i see 0 service and host.. :(

that's my config :

cgi.cfg :

Code: Select all

authorized_for_system_information=nagiosadmin,nagios
authorized_for_configuration_information=nagiosadmin
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin,nagios
authorized_for_all_hosts=nagiosadmin,nagios
authorized_for_all_service_commands=nagiosadmin,nagios
authorized_for_all_host_commands=nagiosadmin,nagios
authorized_for_read_only=logiciel
contact.cfg :

Code: Select all

define contact{
	contact_name			logiciel_agro
	alias				Logiciel_Agro
	service_notification_period	workhours
	host_notifications_enabled	0
	host_notification_period	workhours
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           ******@******.com
        }

define contactgroup{
	contactgroup_name	logiciel
	alias			Logiciel Agro
	members			logiciel_agro
	}
A service definition :

Code: Select all

# Taille base SQL
define service {
	use generic-service
	host_name server1,server2,server3
	service_description Base_SQL
	check_command check_sql
	check_interval 60
	contacts logiciel_agro,support_agro
	contact_groups logiciel
}
Someone can help me ? Thx :)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Unable to authorize read only user

Post by scottwilkerson »

After you add the contact to the service like you did you need to restart the nagios service

Code: Select all

service nagios restart
Also, I noticed on what you posted, this

Code: Select all

authorized_for_read_only=logiciel
should be this

Code: Select all

authorized_for_read_only=logiciel_agro
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
AcidTech
Posts: 2
Joined: Mon Sep 25, 2017 2:12 am

Re: Unable to authorize read only user

Post by AcidTech »

Thank you for the fast reply, i found my mistake :D

I create an account in htpasswd named "logiciel", and my contact name in nagios were "logiciel_agro", so it can't work.. I changed my contact name and contact groups, and now it's work 8-)
kyang

Re: Unable to authorize read only user

Post by kyang »

We are glad to hear you found the mistake!

May we close this thread?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Unable to authorize read only user

Post by scottwilkerson »

Great, glad it is resolved.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked