Page 1 of 1
Network outage view without access to all hosts
Posted: Tue Jan 05, 2016 9:41 am
by marcelst
Hi Guys,
i'm looking for a way to use the network outages view on the tactical overview without providing my users rights to view all hosts.
However i can't seem to find the right solution on how to do this.
Anybody have any suggestions?
Thanks in advance!,
Marcel
Re: Network outage view without access to all hosts
Posted: Tue Jan 05, 2016 4:19 pm
by ssax
You would have to modify the C code and then recompile.
*** Note: This will get reverted if you upgrade and will need to be reimplemented.
*** Make sure that you have known-good backups/vm snapshots before making any modifications
Using Nagios Core 4.1.1 as an example:
Code: Select all
cd /tmp
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
tar zxf /tmp/nagios-4.1.1.tar.gz
Edit
/tmp/nagios-4.1.1/cgi/outages.c and around line 283 remove this code:
Code: Select all
/* user must be authorized for all hosts.. */
if(is_authorized_for_all_hosts(¤t_authdata) == FALSE) {
printf("<P><DIV CLASS='errorMessage'>It appears as though you do not have permission to view information you requested...</DIV></P>\n");
printf("<P><DIV CLASS='errorDescription'>If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI<br>");
printf("and check the authorization options in your CGI configuration file.</DIV></P>\n");
return;
}
Then:
*** Note: You may need to tailor these commands to your system
For RHEL/CentOS users:
Code: Select all
./configure --with-command-group=nagcmd
For Ubuntu users:
Code: Select all
./configure --with-nagios-group=nagios --with-command-group=nagcmd -–with-mail=/usr/bin/sendmail
Finally:
Check it out and let us know if that works for you.
Re: Network outage view without access to all hosts
Posted: Wed Jan 06, 2016 2:37 am
by marcelst
ah sorry, my bad. I should have mentioned that i'm using Nagios Core 3.51 from the CentOS EPEL repository.
However your explanation is very clear. It's a bit strange to me that the coders decided to put this in the sourcecode instead of creating an option in the configuration files for it.
In my specific case it would mean that i would have to switch from using my Nagios installation as multi-tenant to setting up a Nagios installation per customer.
Re: Network outage view without access to all hosts
Posted: Wed Jan 06, 2016 10:33 am
by hsmith
The epel version is pretty outdated at this point. Source installations are usually the cleanest method. If you would like to make an enhancement request, you can post something
here and it will be looked at by our active core developer. Not everything is going to be added that gets posted, but it does help a lot to get feedback from our users. Please note that the changes made will only be in future versions.
Re: Network outage view without access to all hosts
Posted: Wed Jan 06, 2016 11:02 am
by marcelst
hsmith wrote:The epel version is pretty outdated at this point. Source installations are usually the cleanest method. If you would like to make an enhancement request, you can post something
here and it will be looked at by our active core developer. Not everything is going to be added that gets posted, but it does help a lot to get feedback from our users. Please note that the changes made will only be in future versions.
You're right that it's outdated. I'll look into upgrading to Nagios 4.
I don't really like compiling from source, since it's most often a drag in dependencies and updating.
I'll put it up in my lab setup
Also, i'll write up a feature request
Thanks!,
Marcel
Re: Network outage view without access to all hosts
Posted: Wed Jan 06, 2016 2:41 pm
by rkennedy
It isn't too hard to hard to compile from source, and if you do run into issues - feel free to open a new thread at that point and we can help you.
For now, I'm going to close this thread out. As I said above, feel free to open a new thread if you ever need assistance in the future.