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?
Asked
Active
Viewed 2.0k times
3
-
2http://serverfault.com/a/421160/59925 – quanta Oct 10 '12 at 15:32
-
Sure is and it's all covered by the documentation. I suggest you read it. – John Gardeniers Oct 10 '12 at 16:49
3 Answers
8
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 anonymous@domain.com
}
(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
}
![](../../users/profiles/59925.webp)
quanta
- 50,327
- 19
- 152
- 213
-
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. – Itai Ganot Oct 11 '12 at 10:08
-
-
that's the error i received: Running configuration check... FAILED! Restart aborted. Check your Nagios configuration. – Itai Ganot Oct 11 '12 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 – Itai Ganot Oct 11 '12 at 10:50
-
-
Append it to your original question to keep formatting instead of posting here as a comment. – quanta Oct 11 '12 at 10:58
-
while running the verification of Nagios configuration file i saw that it's checking different files than the default ones, so i've edited them and achieved my goal. Thanks! – Itai Ganot Oct 11 '12 at 12:53
0
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--