Grafana Integration with Nagios

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Grafana Integration with Nagios

Post by Fred Kroeger »

I'm evaluating Grafana integration with the latest version of NagiosXI on a CentOS7 VM. This is also where I have installed Grafana.
I've followed the KB Article "nagios-xi-using-grafana-with-existing-performance-data-805" .
I can install the Grafana Server OK and can connect to the console on port 3000.
I run into problems installing the PNP components. They all seem to install OK. I can't however get past the "Grant localhost permission to PNP Nagios" part. After I modify the pnp4nagios.conf file as per the article, I keep getting the following message when I run the curl http://localhost/pnp4nagios command :

Code: Select all

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /pnp4nagios
on this server.</p>
</body></html>
I've even tried to configure pnp4nagios with the following options - "--with-nagios-user=nagios" & "--with-nagios-group=nagios"

Contents of the /etc/httpd/conf.d/pnp4nagios.conf file :

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER

Alias /pnp4nagios "/usr/local/pnp4nagios/share"

<Directory "/usr/local/pnp4nagios/share">
        AllowOverride None
        Order allow,deny
        #Allow from all
        Require ip 127.0.0.1 ::1
        #
        # Use the same value as defined in nagios.conf
        #
        AuthName "Nagios Access"
        # AuthType Basic
        # AuthUserFile /usr/local/nagios/etc/htpasswd.users
        # Require valid-user
        <IfModule mod_rewrite.c>
                # Turn on URL rewriting
                RewriteEngine On
                Options symLinksIfOwnerMatch
                # Installation directory
                RewriteBase /pnp4nagios/
                # Protect application and system files from being viewed
                RewriteRule "^(?:application|modules|system)/" - [F]
                # Allow any files or directories that exist to be displayed directly
                RewriteCond "%{REQUEST_FILENAME}" !-f
                RewriteCond "%{REQUEST_FILENAME}" !-d
                # Rewrite all other URLs to index.php/URL
                RewriteRule "^.*$" "index.php/$0" [PT]
        </IfModule>
</Directory>

Also another issue is that the KB article shows different Grafana Screens for configuration compared to the version I have installed - (Grafana v5.4.2)
Specifically when I try to create a PNP datasource, the KB article shows to select "Access = proxy" In my Grafana version, there are only 2 options I can select for access - " Server (default) & Browser"

Any ideas on how I can progress this installation?

thanks... Fred
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Grafana Integration with Nagios

Post by cdienger »

A small typo needs to be corrected in the pnp4nagios.conf:

Code: Select all

 Require ip 127.0.0.1 ::1
to:

Code: Select all

Allow from 127.0.0.1 ::1
and then restart the httpd service.

I see the same discrency between the GUI and what the KB shows for adding the PNP source. I'll look into getting our KB updated, but using the default option seems to work.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Grafana Integration with Nagios

Post by Box293 »

I've updated the KB article:

https://support.nagios.com/kb/article/n ... a-805.html

Specifically there were some Apache changes for EL7 that require the Order allow,deny to be commented out and the Require all granted line to be added. The existing Require ip 127.0.0.1 ::1 is correct.

Here is my working config of /etc/httpd/conf.d/pnp4nagios.conf:

Code: Select all

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER

Alias /pnp4nagios "/usr/local/pnp4nagios/share"

<Directory "/usr/local/pnp4nagios/share">
        AllowOverride None
        #Order allow,deny
        #Allow from all
        Require ip 127.0.0.1 ::1
        #
        # Use the same value as defined in nagios.conf
        #
        AuthName "Nagios Access"
        #AuthType Basic
        #AuthUserFile /usr/local/nagios/etc/htpasswd.users
        #Require valid-user
        Require all granted
        <IfModule mod_rewrite.c>
                # Turn on URL rewriting
                RewriteEngine On
                Options symLinksIfOwnerMatch
                # Installation directory
                RewriteBase /pnp4nagios/
                # Protect application and system files from being viewed
                RewriteRule "^(?:application|modules|system)/" - [F]
                # Allow any files or directories that exist to be displayed directly
                RewriteCond "%{REQUEST_FILENAME}" !-f
                RewriteCond "%{REQUEST_FILENAME}" !-d
                # Rewrite all other URLs to index.php/URL
                RewriteRule "^.*$" "index.php/$0" [PT]
        </IfModule>
</Directory>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: Grafana Integration with Nagios

Post by Fred Kroeger »

Yay - thanks Troy
Yes I figured out that I needed to change to Require IP but it was the other two changes that I missed for EL7
1) to comment out the Order line
2) Add Require all granted

With those changes it now works as expected. Thanks for updating the KB article.

Regrads... Fred
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Grafana Integration with Nagios

Post by scottwilkerson »

Fred Kroeger wrote:Yay - thanks Troy
Yes I figured out that I needed to change to Require IP but it was the other two changes that I missed for EL7
1) to comment out the Order line
2) Add Require all granted

With those changes it now works as expected. Thanks for updating the KB article.

Regrads... Fred
Great!

Glad to hear it's working

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked