Code Monkey home page Code Monkey logo

Comments (13)

sni avatar sni commented on May 29, 2024

Have you installed the pnp api extension as mentioned here in the Readme? Afaik it is still not included in the latest pnp4nagios release.

from grafana-pnp-datasource.

wosiek21 avatar wosiek21 commented on May 29, 2024

I just make:

wget "https://github.com/lingej/pnp-metrics-api/raw/master/application/controller/api.php"
-O /usr/local/pnp4nagios/share/application/controllers/api.php

restart all and still have problem:

image

from grafana-pnp-datasource.

sni avatar sni commented on May 29, 2024

If there is an internal server error, there should be something logged anywhere. Most probably in the apache error log

from grafana-pnp-datasource.

wosiek21 avatar wosiek21 commented on May 29, 2024

image

from grafana-pnp-datasource.

wosiek21 avatar wosiek21 commented on May 29, 2024

Meaby something is wrong here?
image

from grafana-pnp-datasource.

sni avatar sni commented on May 29, 2024

not really helpful. You could have a look at the chrome dev tools or the firefox web developer toolbar while testing the datasource and see if there are any hints in the response.

from grafana-pnp-datasource.

wosiek21 avatar wosiek21 commented on May 29, 2024

image
I found someting here

from grafana-pnp-datasource.

sni avatar sni commented on May 29, 2024

good, thats something to fix. Just make sure the api.php has the same permissions and owner/group as the other controller php files in that folder.

from grafana-pnp-datasource.

wosiek21 avatar wosiek21 commented on May 29, 2024

Done this:
image

But sill have something like:

image

from grafana-pnp-datasource.

sni avatar sni commented on May 29, 2024

here are some curl commands to manually test the api: https://github.com/lingej/pnp-metrics-api
Make sure the api works. Thats nothing this datasource can do about it.

from grafana-pnp-datasource.

wosiek21 avatar wosiek21 commented on May 29, 2024

Meaby problem is here?

image

I will try the curls commands

from grafana-pnp-datasource.

tatref avatar tatref commented on May 29, 2024

Same issue here. I think related to SELinux. Check /var/log/audit/audit.log

type=AVC msg=audit(1596038131.954:1851): avc:  denied  { getattr } for  pid=29839 comm="httpd" path="/usr/local/monitoring/addons/pnp/share/application/controllers/api.php" dev="dm-0" ino=74720090 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0

from grafana-pnp-datasource.

algorux avatar algorux commented on May 29, 2024

In my case there were two roots for that problem, try to set selinux permissive (temporal solution) with

sudo setenforce 0

Consider that i'm using centOS 7

Also, I added a Require policy in /etc/httpd/conf.d/pnp4nagios.conf "Require host localhost"

# 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
        #
        # Use the same value as defined in nagios.conf
        #
        Require host localhost
        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>

from grafana-pnp-datasource.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.