Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Jun 23, 2018 6:52 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Sun Sep 01, 2013 10:44 pm 
Offline
User avatar

Joined: Tue Feb 26, 2013 10:50 pm
Posts: 22
After updating to 0.8.8b i am having thold issues. If i disable thold graphs show up fine, when debugging a graph when thold is enabled i get........

Notice: Undefined offset: 1 in /var/www/html/plugins/thold/setup.php on line 217, 218
and a
Notice: Undefined offset: 2 in /var/www/html/plugins/thold/setup.php on line 216.

I have searched high and low with no help.

also i have tried uninstalling the thold plugin and reinstalling, i have also replaced the thold plugin folder with a known working backup. Same results.

Thanks for any help

_________________
Shawn C. Peppers
http://www.directlinkadmin.com
Directlinkadmin ISP Suite - 866-680-8433


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Mon Sep 02, 2013 3:33 am 
Offline

Joined: Thu Apr 11, 2013 6:34 am
Posts: 18
I have the same problem. :( :(

Something help?


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Tue Sep 03, 2013 5:57 am 
Offline

Joined: Tue Aug 13, 2013 10:59 pm
Posts: 24
Code:
$dsname = $kdef[2];
$temp1  = str_replace(".rrd", "", basename($ddef[1]));
if (substr_count(basename($ddef[1]), "_") == 0)


Those are the lines in question. Your error seems to be because
Code:
$ddef[1]
and
Code:
$kdef[2]
have invalid offets--that is, the number in the square brackets is not indicating a valid position in those arrays. I am not very good at debugging PHP, and the Cacti codebase is kind of spaghetti IMHO, but if you could find a way to print to your page the contents of those two variables, that would be a good start.

The command to get the contents of variables in PHP is:

Code:
var_dump($ddef);
var_dump($ddef);


You may be able to get it to the Cacti log. Try changing your code at those lines to:

Code:
cacti_log('$kdef contents: ' . var_dump($kdef);
$dsname = $kdef[2];
cacti_log('$ddef contents: ' . var_dump($ddef);
$temp1  = str_replace(".rrd", "", basename($ddef[1]));
if (substr_count(basename($ddef[1]), "_") == 0)


Then check your Cacti log and report back.

I'm honestly not sure if the above code will give you the answers you need--I primarily write Perl, but what's the worst that can happen?

Good luck!

--Tyler


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Thu Sep 05, 2013 2:20 am 
Offline
User avatar

Joined: Tue Feb 26, 2013 10:50 pm
Posts: 22
This code did not work for me, spits out a parser code error. I believe it has to do with the cacti_log part.

_________________
Shawn C. Peppers
http://www.directlinkadmin.com
Directlinkadmin ISP Suite - 866-680-8433


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Fri Sep 06, 2013 5:19 am 
Offline

Joined: Thu Apr 11, 2013 6:34 am
Posts: 18
Sorry my answer was for other post
I can´t solve this problem.


Last edited by Mrys on Sun Sep 08, 2013 6:15 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Fri Sep 06, 2013 5:46 pm 
Offline
User avatar

Joined: Tue Feb 26, 2013 10:50 pm
Posts: 22
is this just a bandaid?

_________________
Shawn C. Peppers
http://www.directlinkadmin.com
Directlinkadmin ISP Suite - 866-680-8433


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Tue Sep 10, 2013 6:50 am 
Offline

Joined: Thu Apr 11, 2013 6:34 am
Posts: 18
SOLVED!!

Change this code in setup.php

foreach ($defs as $def) {
if (!substr_count($def, "CDEF") && !substr_count($def, "VDEF")) {
$ddef = explode('"', $def);
$kdef = explode(':', $def);

$dsname = $kdef[0];

$temp1 = str_replace(".rrd", "", basename($ddef[0]));

if (substr_count(basename($ddef[0]), "_") == 0) {
$local_data_id = $temp1;
:wink:


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Mon Sep 23, 2013 12:02 am 
Offline

Joined: Mon Apr 29, 2013 12:44 am
Posts: 18
Mrys wrote:
SOLVED!!

Change this code in setup.php

foreach ($defs as $def) {
if (!substr_count($def, "CDEF") && !substr_count($def, "VDEF")) {
$ddef = explode('"', $def);
$kdef = explode(':', $def);

$dsname = $kdef[0];

$temp1 = str_replace(".rrd", "", basename($ddef[0]));

if (substr_count(basename($ddef[0]), "_") == 0) {
$local_data_id = $temp1;
:wink:


That didn't work for me :cry:

After digging around it appears that in Cacti 0.8.8a DEF statements were quoted with double quotes but in 0.8.8b they are now quoted with single quotes.
Which means that on line 214 of thold/setup.php this statement no longer works properly:
Code:
$ddef   = explode('"', $def);

If you change it to split on the single quote:
Code:
$ddef   = explode("'", $def);

and leave everything else as it was in the 0.8.8b release, then it should be ok. Works for me anyway. :wink:


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Thu Dec 12, 2013 9:36 pm 
Offline

Joined: Thu Sep 20, 2007 10:09 am
Posts: 5
Location: San Angelo, TX
It's crazy how many issues thold can cause.

dvc, thank you for posting this, that fixed all the issues I had with my CactiEZ0.7 install. Now to migrate over to this new server.

_________________
Cacti Version - 0.8.8
Plugin Architecture - 3.1
Poller Type - SPINE 0.8.7g
Server Info - CactiEZ 0.6 - upgraded to CentOS5.8
Web Server - Apache 2.2.3
SNMP - NET-SNMP 5.3.2.2
RRDTool - Version 1.2.X
PHP - 5.3.10


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Sat Feb 22, 2014 7:38 am 
Offline

Joined: Sat Feb 22, 2014 7:29 am
Posts: 2
I had the same problem fixed by replacing the files from the links below

http://svn.cacti.net/viewvc/cacti/branches/0.8.8/lib/rrd.php?view=markup&pathrev=7418
http://svn.cacti.net/viewvc/cacti/branches/0.8.8/rra.php?view=log

I just did a
find /var/www | grep rra.php and rrd.php

to locate them and dropped them in and overwrote the originals.


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Thu Jul 10, 2014 6:48 pm 
Offline

Joined: Thu Jul 10, 2014 6:45 pm
Posts: 1
dvc wrote:

After digging around it appears that in Cacti 0.8.8a DEF statements were quoted with double quotes but in 0.8.8b they are now quoted with single quotes.
Which means that on line 214 of thold/setup.php this statement no longer works properly:
Code:
$ddef   = explode('"', $def);

If you change it to split on the single quote:
Code:
$ddef   = explode("'", $def);

and leave everything else as it was in the 0.8.8b release, then it should be ok. Works for me anyway. :wink:



AWESOME!! This fixed my graphs!!!!
Gracias homes!!! :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol:
for the newbs like me...

nano /var/www/html/plugins/thold/setup.php
then ctrl+w to find ddef
then simply change to
Code:
$ddef   = explode("'", $def);

ctrl+x and press enter to save


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Thu Jun 04, 2015 6:23 am 
Offline

Joined: Thu Mar 12, 2015 9:18 am
Posts: 7
still getting issues

06/04/2015 01:21:07 PM - PHPSVR: Poller[0] WARNING: Function does not exist INC: 'thold_alerts.php' FUNC: 'script_thold_alerts_count' PARMS: ''
06/04/2015 01:21:07 PM - PHPSVR: Poller[0] WARNING: PHP Script File to be included, does not exist


Top
 Profile  
 
 Post subject: Re: Trouble with Thold after upgrading to 0.8.8b
PostPosted: Thu Jul 27, 2017 5:00 am 
Offline
User avatar

Joined: Thu Nov 17, 2011 5:15 pm
Posts: 42
tylerc wrote:
Code:
$dsname = $kdef[2];
$temp1  = str_replace(".rrd", "", basename($ddef[1]));
if (substr_count(basename($ddef[1]), "_") == 0)


Those are the lines in question. Your error seems to be because
Code:
$ddef[1]
and
Code:
$kdef[2]
have invalid offets--that is, the number in the square brackets is not indicating a valid position in those arrays. I am not very good at debugging PHP, and the Cacti codebase is kind of spaghetti IMHO, but if you could find a way to print to your page the contents of those two variables, that would be a good start.

The command to get the contents of variables in PHP is:

Code:
var_dump($ddef);
var_dump($ddef);


You may be able to get it to the Cacti log. Try changing your code at those lines to:

Code:
cacti_log('$kdef contents: ' . var_dump($kdef);
$dsname = $kdef[2];
cacti_log('$ddef contents: ' . var_dump($ddef);
$temp1  = str_replace(".rrd", "", basename($ddef[1]));
if (substr_count(basename($ddef[1]), "_") == 0)


Then check your Cacti log and report back.

I'm honestly not sure if the above code will give you the answers you need--I primarily write Perl, but what's the worst that can happen?

Good luck!

--Tyler


worked on 0.8.8h

_________________
Regards,
Pizu


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group