PNP Graph Template issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

PNP Graph Template issue

Post by Eurocash »

Hi,

I have issue with check_iftraffic64 plugin and PNP Graph template downloaded from here:
https://exchange.nagios.org/directory/P ... 64/details

Our nagios version: Nagios XI 5.4.13

Check command:
check_band_usage3_copy_1
/usr/local/nagios/libexec/check_iftraffic64.pl -H $HOSTADDRESS$ -C $ARG1$ -i $ARG2$ -M $ARG3$ -I $ARG3$ -O $ARG4$ -u m -b $ARG5$ -B

Template is named check_band_usage3_copy_1.php ( which is a requirement for it to work )

Everything seems to be working fine inside nagvis, template works ( pleas see attached file nagvis-working template.JPG )
The problem is when i click on link and graph is displayed inside nagios, its empty ( see attached file nagios-empty graph template.JPG)
There is more info in attached graphapi.log and Gi0_0_2_-_link_do_MPLS_Netia_copy6.rrd file.

What goes wrong here ?
You do not have the required permissions to view the files attached to this post.
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

Re: PNP Graph Template issue

Post by Eurocash »

Another post, because of max 3 attachments.
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: PNP Graph Template issue

Post by cdienger »

This is just a guess since I haven't been able to fully reproduce the problem and this was developed by a third party, but the command seems to have a problem with not escaping the parentheses around time and usageIN. Try changing line 122 and 123 in the template.

From:

Code: Select all

	# Determine time increments used in graph
	$def[1] .= "CDEF:time=PREV(usageIN),POP,TIME ";
	$def[1] .= "CDEF:prevtime=PREV(time) ";
to:

Code: Select all

	# Determine time increments used in graph
	$def[1] .= "CDEF:time=PREV\(usageIN\),POP,TIME ";
	$def[1] .= "CDEF:prevtime=PREV\(time\) ";
Restart the httpd service(service httpd restart) and refresh the browser.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

Re: PNP Graph Template issue

Post by Eurocash »

After this change graph is working in Nagios, but in Nagvis is blank. Maybe you can recommend some other template with similar functionality?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: PNP Graph Template issue

Post by cdienger »

Well dang.

Another possible option disabling the highchart which may be having problems with the escaping. Do this under Admin > System Config > System Settings > Theme & Display, and uncheck the "Use Highcharts for Performance Graphs page and host/service detail pages (host/service popup graph always uses Highcharts)" option. You then would want to revert the template file to its initial state.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

Re: PNP Graph Template issue

Post by Eurocash »

We have this option already unchecked, it was necessary for template to work. On modified template - Nagios graph OK, Nagvis graph empty, on origianl template - Nagios graph empty, Nagvis graph OK.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: PNP Graph Template issue

Post by cdienger »

Is there anything logged in the apache logs(/var/log/httpd/) when it's broken in either Nagios or Nagvis?

I'd also like to get a fresh copy of the rrd and its respective xml to try and reproduce this again.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

Re: PNP Graph Template issue

Post by Eurocash »

All files attached to post.
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: PNP Graph Template issue

Post by cdienger »

The Nagios graphs worked right off the bat using the unaltered template on my test system(CentOS 6.8 php 5.3.3). What OS is your system and php version? I know that some older php versions have had issues with nested quotes. Supported php versions are 5.3, 5.4, 5.5, and 5.6. You can try upgrading to a newer version using "yum upgrade php".
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Eurocash
Posts: 29
Joined: Wed Dec 27, 2017 6:15 am

Re: PNP Graph Template issue

Post by Eurocash »

All good:

Code: Select all

[ec@nagios ~]$ cat /etc/*elease
CentOS Linux release 7.3.1611 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.3.1611 (Core)
CentOS Linux release 7.3.1611 (Core)
[ec@nagios ~]$ php -v
PHP 5.4.16 (cli) (built: Nov  6 2016 00:29:02)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
It have to be something else...
Locked