Undefined offset: 1 in rrd.php

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
decals74
Posts: 6
Joined: Sat Jun 09, 2007 4:37 pm

Undefined offset: 1 in rrd.php

Post by decals74 »

Hi,

I'm having some probs trying to create traffic graphs for a Foundry Fastiron FESX424 switch. Here's my setup:

rhel 3
cacti-0.8.6j (unpatched)
php 5.2.3
apache 2.0.46
mysql 5.0.41-community

Cacti is currently graphing localhost and memcached data just fine so the instance seems to be ok otherwise.

I've tried creating the fastiron device as a generic snmp-enabled host and the rrd files are successfully being created by poller.php and rrdtool shows valid data but no graphs are being displayed. graph debug shows the following:

RRDTool Command:

Notice: Undefined offset: 1 in /var/www/html/cacti-0.8.6j/lib/rrd.php on line 1123

/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="gsw01 - Traffic - ethernet1" \
--rigid \
--base=1000 \
--height=150 \
--width=500 \
--alt-autoscale \
--vertical-label="bits per second" \
--slope-mode \
DEF:a="/var/www/html/cacti-0.8.6j/rra/gsw01_traffic_in_83.rrd":traffic_in:AVERAGE \
DEF:b="/var/www/html/cacti-0.8.6j/rra/gsw01_traffic_in_83.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefe=b,-8,* \
CDEF:cdeff=b,8,* \
AREA:cdefa#00CF00:"Inbound" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
AREA:cdefe#96E78A:"Outbound" \
GPRINT:cdeff:LAST:"Current\:%8.2lf %s" \
GPRINT:cdeff:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdeff:MAX:"Maximum\:%8.2lf %s" \
HRULE:0#FF0000:"" \
VRULE:1181372400#9FA4EE:""

RRDTool Says:

Notice: Undefined offset: 1 in /var/www/html/cacti-0.8.6j/lib/rrd.php on line 1123

OK

I've seen a couple other posts here with the same errmsg but didn't see any resolution. Googling around indicates that this errmsg is related to an out of scope array member but I'm no PHP pundit and don't want to hack at it. Anyone else have this prob or perhaps a good template?? Thanks.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

add the following to lib/rrd.php on line 1119 for debugging and post your results.

echo $graph_items["value"];

Thanks,

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
decals74
Posts: 6
Joined: Sat Jun 09, 2007 4:37 pm

Post by decals74 »

Hi witness, here's the graph debug output after adding the echo:

RRDTool Command:

Notice: Undefined index: value in /var/www/html/cacti-0.8.6j/lib/rrd.php on line 1121

Notice: Undefined offset: 1 in /var/www/html/cacti-0.8.6j/lib/rrd.php on line 1126
Last edited by decals74 on Sun Jun 10, 2007 1:43 pm, edited 1 time in total.
decals74
Posts: 6
Joined: Sat Jun 09, 2007 4:37 pm

Post by decals74 »

hmm, did you mean 'echo $graph_item["value"];' ??

i added a couple more echos to identify $value_array[0] and $value_array[1] as such:
#########################################################

1118 $value_array = explode(":", $graph_item["value"]);
1119
1120 ##
1121 echo $graph_items["value"] . "\n";
1122
1123 if ($value_array[0] < 0) {
1124 $value = date("U") - (-3600 * $value_array[0]) - 60 * $value_array[1];
1125 }else{
1126 ##
1127 echo "val_arr0 $value_array[0]";
1128 echo "val_arr1 $value_array[1]";
1129 $value = date("U", mktime($value_array[0],$value_array[1],0));

#########################################################
and graph debug is now:

Notice: Undefined index: value in /var/www/html/cacti-0.8.6j/lib/rrd.php on line 1121


val_arr0 00

Notice: Undefined offset: 1 in /var/www/html/cacti-0.8.6j/lib/rrd.php on line 1128

val_arr1

Notice: Undefined offset: 1 in /var/www/html/cacti-0.8.6j/lib/rrd.php on line 1129
Last edited by decals74 on Sun Jun 10, 2007 12:50 pm, edited 1 time in total.
decals74
Posts: 6
Joined: Sat Jun 09, 2007 4:37 pm

Post by decals74 »

and with 'echo $graph_item["value"];'

#rrd.php#################################################

1118 $value_array = explode(":", $graph_item["value"]);
1119
1120 ##
1121 echo $graph_item["value"] . "\n";
1122
1123 if ($value_array[0] < 0) {
1124 $value = date("U") - (-3600 * $value_array[0]) - 60 * $value_array[1];
1125 }else{
1126 ##
1127 echo "val_arr0 $value_array[0]";
1128 echo "val_arr1 $value_array[1]";
1129 $value = date("U", mktime($value_array[0],$value_array[1],0));

#debug###################################################

RRDTool Command:

00
val_arr0 00

Notice: Undefined offset: 1 in /var/www/html/cacti-0.8.6j/lib/rrd.php on line 1128

val_arr1

Notice: Undefined offset: 1 in /var/www/html/cacti-0.8.6j/lib/rrd.php on line 1129

#########################################################

thanks again for your assistance.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

There may either be a bug in the VRULE code, or you have incorrectly defined it in your graph template. It's pretty late/early though. I have more information, you should avoid the VRULE code.

TheWitness
Last edited by TheWitness on Tue Jun 19, 2007 2:24 am, edited 1 time in total.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

What version of RRDtool are you using? Please advise. This may be an escaping issue.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

In order to help you with the VRULE issue, you must "Edit" your graph template, edit the VRULE item, take a screen shot and post it here. Also, perform the following in the code:

print_r($graph_item);

Thanks,

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests