Network outage view without access to all hosts

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
User avatar
marcelst
Posts: 4
Joined: Tue Jan 05, 2016 8:51 am
Location: Netherlands
Contact:

Network outage view without access to all hosts

Post 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
IT is not for the faint of heart
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Network outage view without access to all hosts

Post 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(&current_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:

Code: Select all

cd /tmp/nagios-4.1.1/
*** 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:

Code: Select all

make all
make install
Check it out and let us know if that works for you.
User avatar
marcelst
Posts: 4
Joined: Tue Jan 05, 2016 8:51 am
Location: Netherlands
Contact:

Re: Network outage view without access to all hosts

Post 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.
IT is not for the faint of heart
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Network outage view without access to all hosts

Post 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.
Former Nagios Employee.
me.
User avatar
marcelst
Posts: 4
Joined: Tue Jan 05, 2016 8:51 am
Location: Netherlands
Contact:

Re: Network outage view without access to all hosts

Post 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
IT is not for the faint of heart
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Network outage view without access to all hosts

Post 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.
Former Nagios Employee
Locked