Code: Select all
/usr/local/pnp4nagios/var/perfdata
Code: Select all
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"
Code: Select all
/usr/local/pnp4nagios/var/perfdata
Code: Select all
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"
Code: Select all
sudo apt-get install grafana
Reading package lists... Done
Building dependency tree
Reading state information... Done
grafana is already the newest version (6.5.2).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Code: Select all
t=2020-01-09T17:04:04+0000 lvl=warn msg="Plugin missing module.js" logger=plugins name=PNP warning="Missing module.js, If you loaded this plugin from git, make sure to compile it." path=/var/lib/grafana/plugins/sni-pnp-datasource/dist/src/module.js
t=2020-01-09T17:04:04+0000 lvl=eror msg="Plugins: Failed to load plugin json file: /var/lib/grafana/plugins/sni-pnp-datasource/dist/src/plugin.json, err: Failed to register plugin: Plugin with ID \"sni-pnp-datasource\" already exists"
t=2020-01-09T17:04:04+0000 lvl=warn msg="Some plugins failed to load" logger=plugins errors="[Failed to register plugin:\n github.com/grafana/grafana/pkg/util/errutil.Wrap\n /go/src/github.com/grafana/grafana/pkg/util/errutil/errors.go:18\n - Plugin with ID \"sni-pnp-datasource\" already exists]"
Code: Select all
/usr/local/pnp4nagios/var/perfdata/
Code: Select all
/usr/local/nagios/share/perfdata
Code: Select all
lvl=warn msg="Plugin missing module.js" logger=plugins name=PNP warning="Missing module.js, If you loaded this plugin from git, make sure to compile it." path=/var/lib/grafana/plugins/sni-pnp-datasource/dist/src/module.js
Code: Select all
/usr/local/nagios/share/perfdata/
Code: Select all
response:"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Installation</title> <style type="text/css"> body { width: 42em; margin: 0 auto; font-family: sans-serif; font-size: 90%; } #tests table { border-collapse: collapse; width: 100%; } #tests table th, #tests table td { padding: 0.2em 0.4em; text-align: left; vertical-align: top; } #tests table th { width: 12em; font-weight: normal; font-size: 1.2em; } #tests table tr:nth-child(odd) { background: #eee; } #tests table td.pass { color: #191; } #tests table td.fail { color: #911; } #tests table td.warn { background: #ff3; } #tests #results { color: #fff; } #tests #results p { padding: 0.8em 0.4em; } #tests #results p.pass { background: #191; } #tests #results p.fail { background: #911; } #tests #results p.warn { background: #ff3; } </style> </head> <body> <h1>PNP4Nagios Environment Tests</h1> <p>The following options are determined by "configure". If any of the tests have failed, consult the <a href="http://docs.pnp4nagios.org/pnp-0.6/install">documentation</a> for more information on how to correct the problem.</p> <div id="tests"> <table cellspacing="0"> <tr> <th>PNP4Nagios Version</th> <td class="pass">pnp4nagios-0.6.26</td> </tr> <tr> <th>Prefix</th> <td class="pass">/usr/local/pnp4nagios</td> </tr> <tr> <th>Configure Arguments</th> <td class="pass">./configure '--with-perfdata-dir=/usr/local/nagios/share/perfdata' '--with-httpd-conf=/etc/apache2/sites-enabled'</td> </tr> <tr> <th>RRD Storage</th> <td class="pass">/usr/local/nagios/share/perfdata is readable.</td> </tr> <tr> <th>RRDtool Binary</th> <td class="pass">/usr/bin/rrdtool is executable by PHP</td> </tr> <tr> <th>PHP GD extension</th> <td class="pass">Pass</td> </tr> <tr> <th>PHP function proc_open()</th> <td class="pass">Pass</td> </tr> <tr> <th>PHP zlib extension</th> <td class="pass">Pass</td> </tr> <tr> <th>PHP session extension</th> <td class="pass">Pass</td> </tr> <tr> <th>PHP JSON extension</th> <td class="pass">Pass</td> </tr> <th>PHP magic_quotes_gpc</th> <td class="pass">Off</td> </tr> <th>PHP socket extension</th> <td class="pass">Pass</td> </tr> <th>Apache Rewrite Module</th> <td class="warn"><a href="http://docs.pnp4nagios.org/faq/i9">Apache mod_rewrite</a> is not enabled</td> </tr> </tr> </table> </div> <h1>Kohana Environment Tests</h1> <p>The following tests have been run to determine if Kohana will work in your environment. If any of the tests have failed, consult the <a href="http://docs.pnp4nagios.org/pnp-0.6/install">documentation</a> for more information on how to correct the problem.</p> <div id="tests"> <table cellspacing="0"> <tr> <th>PHP Version</th> <td class="pass">7.2.24-0ubuntu0.18.04.1</td> </tr> <tr> <th>System Directory</th> <td class="pass">/usr/local/pnp4nagios/lib/kohana/system/</td> </tr> <tr> <th>Application Directory</th> <td class="pass">/usr/local/pnp4nagios/share/application/</td> </tr> <tr> <th>Reflection Enabled</th> <td class="pass">Pass</td> </tr> <tr> <th>Iconv Extension Loaded</th> <td class="pass">Pass</td> <tr> </tr> <tr> <th>URI Determination</th> <td class="pass">Pass</td> </tr> </table> <div id="results"> <p class="pass">Your environment passed all requirements. Remove or rename the <code>/usr/local/pnp4nagios/share/install.php</code> file now.</p> </div> </div> </body> </html> "
Code: Select all
/usr/local/pnp4nagios</td> </tr> <tr> <th>Configure Arguments</th> <td class="pass">./configure '--with-perfdata-dir=/usr/local/nagios/share/perfdata' '--with-httpd-conf=/etc/apache2/sites-enabled'</td> </tr> <tr> <th>RRD Storage</th> <td class="pass">/usr/local/nagios/share/perfdata is readabl
Code: Select all
/usr/local/nagios/share/perfdata
Code: Select all
/usr/local/pnp4nagios/var/perfdata/
Code: Select all
/usr/local/pnp4nagios/libexec/
-rwxr-xr-x 1 nagios nagios 8119 Jan 7 16:58 check_pnp_rrds.pl*
-rwxr-xr-x 1 nagios nagios 55045 Jan 9 19:50 process_perfdata.pl*
-rwxr-xr-x 1 nagios nagios 14988 Jan 7 16:58 rrd_convert.pl*
-rwxr-xr-x 1 nagios nagios 7855 Jan 7 16:58 rrd_modify.pl*
root@XXXXXXXX:/usr/local/pnp4nagios/libexec# vi
Code: Select all
/etc/grafana/grafana.ini
Code: Select all
If any of the tests have failed, consult the <a href="http://docs.pnp4nagios.org/pnp-0.6/install">documentation</a> for more information on how to correct the problem.</p> <div id="tests"> <table cellspacing="0"> <tr> <th>PNP4Nagios Version</th> <td class="pass">pnp4nagios-0.6.26</td> </tr> <tr> <th>Prefix</th> <td class="pass">/usr/local/pnp4nagios</td> </tr> <tr> <th>Configure Arguments</th> <td class="pass">./configure '--with-nagios-user=nagios' '--with-nagios-group=nagios'</td> </tr> <tr> <th>RRD Storage</th> <td class="pass">/usr/local/pnp4nagios/var/perfdata is readable.</td>
Code: Select all
/usr/local/pnp4nagios/var/perfdata
Code: Select all
PNP4Nagios Version 0.6.26
Please check the documentation for information about the following error.
Call to undefined function simplexml_load_file()
file [line]:
application/models/data.php [270]:
Code: Select all
sudo apt-get install php7.2-simplexml
sudo systemctl restart npcd.service
sudo systemctl restart apache2
Code: Select all
sizeof(): Parameter must be an array or an object that implements Countable
file [line]:
application/models/data.php *[979]:*
Code: Select all
go to /usr/local/pnp4nagios/share/application/models
sudo vi data.php
Code: Select all
if(sizeof($pages) > 0 ){
Code: Select all
if(is_arrary($pages) && sizeof($pages) > 0 ){
great!cybergene wrote:I solved the problems with Grafana, it was pnp4nagios that had errors.
1. When I try to browse to http://nagios_ip/pnp4nagios/graph?host=hostname, I was gettingand to solve, there was a thread about it in the forum:Code: Select all
PNP4Nagios Version 0.6.26 Please check the documentation for information about the following error. Call to undefined function simplexml_load_file() file [line]: application/models/data.php [270]:
https://support.nagios.com/forum/viewto ... =7&t=53095 and the solution is2. Now, the 2nd error appeared:Code: Select all
sudo apt-get install php7.2-simplexml sudo systemctl restart npcd.service sudo systemctl restart apache2
Also from that same thread, to solve this error one need to fix the data.php modelCode: Select all
sizeof(): Parameter must be an array or an object that implements Countable file [line]: application/models/data.php *[979]:*
Replace it (in two places)Code: Select all
go to /usr/local/pnp4nagios/share/application/models sudo vi data.php
withCode: Select all
if(sizeof($pages) > 0 ){
Source: https://github.com/lingej/pnp4nagios/issues/148Code: Select all
if(is_arrary($pages) && sizeof($pages) > 0 ){
and restart apache2,
sudo systemctl restart npcd.service
sudo systemctl restart apache2
Test it by browsing to http://nagios_ip/pnp4nagios/graph?host=hostname, and the graphs should show up If you try the Grafana visualizations , they will work. Thank you for the help and you can close this thread !