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

Graphs all show "nan" values #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Today i've been busy setting up the mysql graphs you kindly created but until a 
few minutes ago 
all graphs showed "nan" values after searching and trying and comparing for a 
while i found out 
what the problem was.

When running the script on the commandline myself it gave back an error before 
the suspected 
output:

---- ERROR ----
PHP Notice:  Undefined variable: config in /usr/local/share/cacti/lib/snmp.php 
on line 33
PHP Stack trace:
PHP   1. {main}() /usr/local/share/cacti/scripts/ss_get_mysql_stats.php:0
PHP   2. include_once() /usr/local/share/cacti/scripts/ss_get_mysql_stats.php:73
---- ERROR ----

it seems you include config.php while other scripts all use global.php which 
itself includes 
config.php and creates the required config variable.
i've changed this in ss_get_mysql_stats.php (see part of diff below) and now my 
graphs actually 
start showing things. 

The diff with the changes made:

---- DIFF ----

@@ -69,7 +69,7 @@
 # 
===========================================================
=================
 # Set up the stuff we need to be called by the script server.
 # 
===========================================================
=================
-include_once(dirname(__FILE__) . "/../include/config.php");
+include_once(dirname(__FILE__) . "/../include/global.php");
 include_once(dirname(__FILE__) . "/../lib/snmp.php");

 # 
===========================================================
=================

---- DIFF ----

I don't know if i'm the only one with this problem but maybe it helps solve 
some in the future.

With regards,

Lammert Hellinga

Original issue reported on code.google.com by kogel...@gmail.com on 8 May 2008 at 9:32

GoogleCodeExporter commented 9 years ago
Thanks for the bug report.  I'm not sure if this change is 
backwards-compatible.  I
will use file_exists() and include global.php if it exists; otherwise I will use
config.php.  If this is not backwards-compatible, I assume someone will file a 
bug
report.  All the scripts included with my version of Cacti use config.php.

This fix is included in revision 38.

Original comment by baron.schwartz on 13 May 2008 at 3:18