Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph variables are not always encoded to JSON properly resulting in warnings #2911

Closed
tantantan666 opened this issue Aug 23, 2019 · 2 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@tantantan666
Copy link

When I add graph of interfaces for new added device , I got the error message below , and there isn't any rrd file created:

CMDPHP PHP ERROR WARNING Backtrace: (/graph.php[538]:rrdtool_function_graph(), /lib/rrd.php[1527]:variable_nth_percentile(), /lib/graph_variables.php[432]:nth_percentile(), /lib/graph_variables.php[33]:json_decode(), CactiErrorHandler())
2019/08/23 23:54:10 - ERROR PHP WARNING: json_decode() expects parameter 1 to be string, array given in file: /var/www/html/cacti/lib/graph_variables.php on line: 33
2019/08/23 23:54:10 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph.php[538]:rrdtool_function_graph(), /lib/rrd.php[1527]:variable_nth_percentile(), /lib/graph_variables.php[432]:nth_percentile(), /lib/graph_variables.php[33]:rrdtool_function_stats(), /lib/graph_variables.php[103]:CactiErrorHandler())
2019/08/23 23:54:10 - ERROR PHP NOTICE: Undefined offset: 152 in file: /var/www/html/cacti/lib/graph_variables.php on line: 103
2019/08/23 23:54:10 - CMDPHP PHP ERROR NOTICE Backtrace: (/graph.php[538]:rrdtool_function_graph(), /lib/rrd.php[1527]:variable_nth_percentile(), /lib/graph_variables.php[432]:nth_percentile(), /lib/graph_variables.php[33]:rrdtool_function_stats(), /lib/graph_variables.php[84]:CactiErrorHandler())
2019/08/23 23:54:10 - ERROR PHP NOTICE: Undefined variable: fetch_array in file: /var/www/html/cacti/lib/graph_variables.php on line: 84

Does anyone met this before ?

/bin/rrdtool graph -
--imgformat=PNG
--start='-86400'
--end='-300'
--pango-markup
--title='04AC15-WORK-SWITCH - Traffic - F131 '
--vertical-label='bits per second'
--slope-mode
--base=1000
--height=200
--width=700
--rigid
--alt-autoscale-max
--lower-limit='0'
COMMENT:"From 2019/08/23 00:15:24 To 2019/08/24 00:10:24\c"
COMMENT:" \n"
--color BACK#F3F3F3
--color CANVAS#FDFDFD
--color SHADEA#CBCBCB
--color SHADEB#999999
--color FONT#000000
--color AXIS#2C4D43
--color ARROW#2C4D43
--color FRAME#2C4D43
--border 1 --font TITLE:11:'Arial'
--font AXIS:8:'Arial'
--font LEGEND:8:'Courier'
--font UNIT:8:'Arial'
--font WATERMARK:6:'Arial'
--slope-mode
--watermark 'Generated by Cacti®'
DEF:a='/var/www/html/cacti/rra/04ac15-work-switch_traffic_in_152.rrd':'traffic_in':AVERAGE
DEF:b='/var/www/html/cacti/rra/04ac15-work-switch_traffic_in_152.rrd':'traffic_out':AVERAGE
CDEF:cdefa='a,8,'
CDEF:cdeff='b,8,'
LINE1:cdefa#00CF00FF:
AREA:cdefa#00CF007F:'Inbound '
GPRINT:cdefa:LAST:'Current:%8.2lf %s'
GPRINT:cdefa:AVERAGE:'Average:%8.2lf %s'
GPRINT:cdefa:MAX:'Maximum:%8.2lf %s\n'
LINE1:cdeff#002A97FF:
AREA:cdeff#002A977F:'Outbound'
GPRINT:cdeff:LAST:'Current:%8.2lf %s'
GPRINT:cdeff:AVERAGE:'Average:%8.2lf %s'
GPRINT:cdeff:MAX:'Maximum:%8.2lf %s\n'
COMMENT:' \n'
HRULE:0#FF0000FF:'95th Percentile'
COMMENT:'(0 mbit in+out)'
RRDtool Says:
ERROR: opening '/var/www/html/cacti/rra/04ac15-work-switch_traffic_in_152.rrd': no such file or directory .

Environment:
CENTOS 7
Cacti 1.2.5
RRDTOOL 1.4.8

@netniV
Copy link
Member

netniV commented Aug 23, 2019

At first I thought this was releated to #2512 but that was an undefined variable rather than your case of an array being passed instead of a string.

@cigamit cigamit added the bug Undesired behaviour label Aug 29, 2019
cigamit added a commit that referenced this issue Aug 29, 2019
No rrd file created after executed poller
@cigamit cigamit added the resolved A fixed issue label Aug 29, 2019
@cigamit
Copy link
Member

cigamit commented Aug 29, 2019

Please update lib/graph_variables.php and see if you can reproduce this error.

@netniV netniV added this to the v1.2.6 milestone Aug 31, 2019
@netniV netniV closed this as completed Aug 31, 2019
@netniV netniV changed the title No rrd file created after executed poller (cacti 1.2.5) Graph variables are not always encoded to JSON properly resulting in warnings Sep 1, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants