google-code-export / mysql-cacti-templates

Automatically exported from code.google.com/p/mysql-cacti-templates
GNU General Public License v2.0
1 stars 0 forks source link

Getting errors when debug = TRUE; #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Install the template.
2. Run it (via cacti or manually).

What is the expected output? What do you see instead?
Getting an error:
WARNING: Result from CMD not valid.  Partial Result: U

What version of the product are you using? On what operating system?
1.1.4 on ubuntu (cacti 0.8.7e)

Please provide any additional information below.

After installing the template and setting up a device with multiple graphs,
I kept having one of them failed. If I removed the offending graph, another
one would fail. Seems like it was always the latest one. 

After running the script directly, I noticed that every once in a while
(after the poller has run, I believe), I get a whole lot of output, rather
than just the array. 

Setting "$debug = FALSE;" resolved the issue for me (it was TRUE by default).

Original issue reported on code.google.com by thevedge@gmail.com on 3 Nov 2009 at 6:22

GoogleCodeExporter commented 9 years ago
That means there are some PHP errors.  The templates should not ship with 
debug=TRUE,
that is surely a build mistake -- some code committed accidentally.  But if you
would, please post the output!  I view these as something like compiler 
warnings --
they should not happen, and turning them off may just mask real errors.

The "fix" for this is as you said.

Original comment by baron.schwartz on 3 Nov 2009 at 11:35

GoogleCodeExporter commented 9 years ago
Fixed in r309.  Please post the output you saw if you can.

Original comment by baron.schwartz on 3 Nov 2009 at 11:38

GoogleCodeExporter commented 9 years ago
Seems it happens the first time the script gets called, after a poller has 
started.

Output is attached.

Original comment by thevedge@gmail.com on 4 Nov 2009 at 3:07

Attachments:

GoogleCodeExporter commented 9 years ago
OK, thanks.  I should be able to figure that out... later :)

Original comment by baron.schwartz on 4 Nov 2009 at 10:09

GoogleCodeExporter commented 9 years ago
I'm a little confused as to what is happening.  The script does this on line 
843:

 843          $results['hash_index_cells_used']
 844             = strpos($line, 'used cells') > 0 ? to_int($row[6]) : '0';   

And this appears to be calling

to_int("has");

This is because the line of input is

Hash table size 1155127, node heap has 81 buffer(s)

But the code shouldn't be calling to_int() at all.  The string 'used cells' 
doesn't
appear in that line of input, so to_int() shouldn't be called; it should skip 
that
and go to the else-condition instead.  Perhaps you're using a different version 
of
PHP that has different precedence in the ternary operator, and I should just 
update
all such occurrences to straightforward if-else, or use parens.

What happens if you change that line to add parens:

             = (strpos($line, 'used cells') > 0) ? to_int($row[6]) : '0';   

Original comment by baron.schwartz on 5 Nov 2009 at 3:36

GoogleCodeExporter commented 9 years ago
Okay, seems I might not have been using the latest version. I was using the 
1.1.4,
from the download page, when I was seeing that error.

The line you mentioned is 

         $results['hash_index_cells_used']  = to_int($row[6]);

in that version.

Getting the file from svn seems to work without a hitch though. 

I guess it was already fixed. Sorry for the headache!

Original comment by thevedge@gmail.com on 5 Nov 2009 at 2:49

GoogleCodeExporter commented 9 years ago
No problem, glad it wasn't a bug!

Original comment by baron.schwartz on 5 Nov 2009 at 3:19

GoogleCodeExporter commented 9 years ago
Issue 86 has been merged into this issue.

Original comment by baron.schwartz on 19 Nov 2009 at 3:53