Nagios SubInstances
-
- Posts: 85
- Joined: Fri Mar 28, 2014 6:18 am
Nagios SubInstances
Is it possible to have subsets of nagios running on different machines?
I have a customer who wants to see what I am seeing from the main nagios server, but only for the machines that belong to them.
Please advise.
I have a customer who wants to see what I am seeing from the main nagios server, but only for the machines that belong to them.
Please advise.
-
- Posts: 40
- Joined: Wed Sep 25, 2013 7:01 am
Re: Nagios SubInstances
If you create a web user (set up a username/password in the htpasswd file), and you make that username match the contact name you use to send alerts, then that user will only be able to see the hosts and services they will receive alerts for. See this doc for more info.
-
- Posts: 85
- Joined: Fri Mar 28, 2014 6:18 am
Re: Nagios SubInstances
I have created user called test:
define contact{
contact_name test
alias test test
email test@mydomain.co.ke
use testtemplate
}
Added this user as contact on computer1:
define host{
use hosts_template1
host_name computer1
alias comp1
address 132.160.1.0
contacts test
}
Added authentication for test:
htpasswd /usr/local/nagios/etc/htpasswd.users test
Enable authentication is set to default:
use_authentication = 1
Restarted Nagios.
But still when I acces NAgios from web interface using test,I see all hosts rather than seeing computer1 only.
Please advise.
define contact{
contact_name test
alias test test
email test@mydomain.co.ke
use testtemplate
}
Added this user as contact on computer1:
define host{
use hosts_template1
host_name computer1
alias comp1
address 132.160.1.0
contacts test
}
Added authentication for test:
htpasswd /usr/local/nagios/etc/htpasswd.users test
Enable authentication is set to default:
use_authentication = 1
Restarted Nagios.
But still when I acces NAgios from web interface using test,I see all hosts rather than seeing computer1 only.
Please advise.
-
- Posts: 40
- Joined: Wed Sep 25, 2013 7:01 am
Re: Nagios SubInstances
Check for inheritance - do you have any "contactgroups" defined in either your base host or service templates? Is that test user a member of any contact groups?
-
- Posts: 85
- Joined: Fri Mar 28, 2014 6:18 am
Re: Nagios SubInstances
No,I just created the user test independently for this purpose.
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Nagios SubInstances
Did you add this user to cgi.cfg at all? Actually if you could post that file please.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
-
- Posts: 85
- Joined: Fri Mar 28, 2014 6:18 am
Re: Nagios SubInstances
Not sure under which section to add this user in cgi.cfg
Please advise.
See attched.
Please advise.
See attched.
- Attachments
-
- cfg.zip
- (4.14 KiB) Downloaded 117 times
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Nagios SubInstances
Yep, you will essentially want to make them "read only," and then attach their contact to the hosts you wish them to view, the following are explanations of the different authorization levels directly from the cgi.cfg:
Once you have made your changes and saved the file, restart nagios.
Code: Select all
# SYSTEM/PROCESS INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# have access to viewing the Nagios process information as
# provided by the Extended Information CGI (extinfo.cgi). By
# default, *no one* has access to this unless you choose to
# not use authorization. You may use an asterisk (*) to
# authorize any user who has authenticated to the web server.
authorized_for_system_information=paynet
# CONFIGURATION INFORMATION ACCESS
# This option is a comma-delimited list of all usernames that
# can view ALL configuration information (hosts, commands, etc).
# By default, users can only view configuration information
# for the hosts and services they are contacts for. You may use
# an asterisk (*) to authorize any user who has authenticated
# to the web server.
authorized_for_configuration_information=paynet
# SYSTEM/PROCESS COMMAND ACCESS
# This option is a comma-delimited list of all usernames that
# can issue shutdown and restart commands to Nagios via the
# command CGI (cmd.cgi). Users in this list can also change
# the program mode to active or standby. By default, *no one*
# has access to this unless you choose to not use authorization.
# You may use an asterisk (*) to authorize any user who has
# authenticated to the web server.
authorized_for_system_commands=paynet
# GLOBAL HOST/SERVICE VIEW ACCESS
# These two options are comma-delimited lists of all usernames that
# can view information for all hosts and services that are being
# monitored. By default, users can only view information
# for hosts or services that they are contacts for (unless you
# you choose to not use authorization). You may use an asterisk (*)
# to authorize any user who has authenticated to the web server.
authorized_for_all_services=paynet
authorized_for_all_hosts=paynet
# GLOBAL HOST/SERVICE COMMAND ACCESS
# These two options are comma-delimited lists of all usernames that
# can issue host or service related commands via the command
# CGI (cmd.cgi) for all hosts and services that are being monitored.
# By default, users can only issue commands for hosts or services
# that they are contacts for (unless you you choose to not use
# authorization). You may use an asterisk (*) to authorize any
# user who has authenticated to the web server.
authorized_for_all_service_commands=paynet
authorized_for_all_host_commands=paynet
# READ-ONLY USERS
# 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=user1,user2
Once you have made your changes and saved the file, restart nagios.
-
- Posts: 85
- Joined: Fri Mar 28, 2014 6:18 am
Re: Nagios SubInstances
Thanks alot,it worked.
Re: Nagios SubInstances
Good to hear! I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee