We have Nagios Core 3.2.1 installed and my current task is to allow non-admin users access to the Nagios UI. Is that even possible? or would i need to install some add-on?
3 Answers
Is it possible to create “view only” users?
Sure, you can do it by using the authorized_for_read_only
variable:
/usr/local/nagios/etc/cgi.cfg
# A comma-delimited list of usernames that have read-only rights in
# the CGIs. This will block any service or host commands normally shown
# on the extinfo CGI pages. It will also block comments from being shown
# to read-only users.
authorized_for_read_only=anonymous
and let them view only specific services/servers?
Create a contact definition with the same contact_name
:
/usr/local/nagios/etc/objects/contacts.cfg
define contact{
contact_name anonymous
use generic-contact
alias No Name
service_notifications_enabled 1
host_notifications_enabled 1
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,w,r
host_notification_options d,u,r
email [email protected]
}
(that's called a authenticated contact)
then make him is the contact of the hosts/services which you want to allow to view:
define host{
use linux-server
host_name localhost
address 127.0.0.1
contacts anonymous
contact_groups admin
}
-
I've edited the cgi.cfg and the contacts.cfg files but when i add the contacts contact_name in the services file i'm getting an error while trying to restart nagios service. Oct 11, 2012 at 10:08
-
-
that's the error i received: Running configuration check... FAILED! Restart aborted. Check your Nagios configuration. Oct 11, 2012 at 10:24
-
-
That's the error: Error: Contact 'it' specified in service 'MS Terminal server' for host 'xp-ams-2' is not defined anywhere! even though i've added the user to the cgi.cfg and contacts.cfg.. define contact{ contact_name it alias IT host_notification_period 24x7 service_notification_period 24x7 host_notification_options d,r service_notification_options w,u,c,r host_notification_commands host-notify-by-email service_notification_commands notify-by-email Oct 11, 2012 at 10:50
Well I have tried changing the authorized_for_read_only
property as well. but in order to view the services and hosts following configuration changes needed to be done as well. After that restart the apache server.
authorized_for_all_services=nagiosadmin,--your user--
authorized_for_all_hosts=nagiosadmin,--your user--