Page 1 of 2
PNP Graph Template issue
Posted: Wed May 09, 2018 1:04 am
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 ?
Re: PNP Graph Template issue
Posted: Wed May 09, 2018 1:06 am
by Eurocash
Another post, because of max 3 attachments.
Re: PNP Graph Template issue
Posted: Wed May 09, 2018 2:07 pm
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.
Re: PNP Graph Template issue
Posted: Thu May 10, 2018 2:21 am
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?
Re: PNP Graph Template issue
Posted: Thu May 10, 2018 12:03 pm
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.
Re: PNP Graph Template issue
Posted: Fri May 11, 2018 2:55 am
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.
Re: PNP Graph Template issue
Posted: Fri May 11, 2018 12:54 pm
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.
Re: PNP Graph Template issue
Posted: Tue May 15, 2018 1:31 am
by Eurocash
All files attached to post.
Re: PNP Graph Template issue
Posted: Tue May 15, 2018 4:18 pm
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".
Re: PNP Graph Template issue
Posted: Wed May 16, 2018 2:06 am
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...