DSSTATS: Uninitialized string offset ?

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
henkwiedig
Posts: 8
Joined: Thu Aug 06, 2009 1:32 pm
Location: Germany

DSSTATS: Uninitialized string offset ?

Post by henkwiedig »

Code: Select all

PHP Notice:  Uninitialized string offset:  26 in xxx/cacti/plugins/dsstats/functions.php on line 275
From functions.php

Code: Select all

                        /* create the command syntax to get data */
                        /* assume that an RRDfile has not more than 26 data sources */
                        $defs  = "abcdefghijklmnopqrstuvwzyz";
                        $i     = 0;
                        $def   = "";
                        $xport = "";

                        /* escape the file name if on Windows */
                        if ($config["cacti_server_os"] != "unix") {
                                $rrdfile = str_replace(":", "\\:", $rrdfile);
                        }

                        /* setup the export command by parsing throught the internal data source names */
                        if (sizeof($dsnames)) {
                                foreach ($dsnames as $dsname => $present) {
                                        if ($average) {
                                                $def .= "DEF:" . $defs[$i] . "=\"" . $rrdfile . "\":" . $dsname . ":AVERAGE ";
                                                $xport .= " XPORT:" . $defs[$i];
                                                $i++;
                                        }

                                        if ($max) {
                                                $def .= "DEF:" . $defs[$i] . "=\"" . $rrdfile . "\":" . $dsname . ":MAX ";
                                                $xport .= " XPORT:" . $defs[$i];
                                                $i++;
                                        }
                                }
                        }
What happens if $i grows to 26 ?
Graphing a whole lot of Siebel stuff !
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

How many data sources do you have in that RRDfile? 26 is a lot. Do two things. I "assumed" no one would have more than 26 ;)

1) Answer that question.
2) Increase the array size by adding 0-9 to the list
3) Open a bug report here: http://bugs.cacti.net

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 7 guests