Cactiusers.org


It is currently Mon May 21, 2012 5:29 pm




Post new topic Reply to topic  [ 12 posts ] 
 problems using cacti after plugin installation 
Author Message
New User

Joined: Fri Sep 23, 2005 10:30 am
Posts: 4
Post problems using cacti after plugin installation
Hi,

I am using cacti 0.8.6g on Windows 2000 for the past few weeks. Previously i had been using cacti 0.8.6d with thold 2.1 a with no problems. All worked perfectly. Now i am trying to install thold module...but i have just too many problems.

First i try to install the modular version of thold...
1. As many users here and at forums.cacti.net have pointed out, i am not able to view the current values of data sources for which threshold have been activated. The current value is always zero (0).

2. Whenever i try to create the threshold for new rrd sources, i get an error message as "undefined offset 0 in <cactipath to thold-funtions.php> at line 38"

For both of these two problems i have tried all turn-around propsed as tweaking 'rrd_last_entry' values etc but to no effect.


Secondly, i tried to install the plugin version of thold...

1. I removed the earlier modular version of thold (both files and mysql tables)

2. Installed the plugin architecture by replacing files as suggested and changing teh config.php. But as soon as i login after installation of plugin...i get a skeleton html (see attachment) page of cacti's index.php file with no image gifs of console/graphs/threshld etc. When i click on any hyperlink on the left hand side like the devices/datasources/threshold...i get a error webpage like 'Page not found'


Could anybody kindly explain what is going wrong here and is there any solution to this problem?


Attachments:
plugin.jpg
plugin.jpg [ 53.47 KiB | Viewed 1827 times ]
Fri Sep 23, 2005 10:47 am
Site Admin

Joined: Thu Nov 11, 2004 11:12 am
Posts: 2007
Post Re: problems using cacti after plugin installation
danviv wrote:
Hi,

I am using cacti 0.8.6g on Windows 2000 for the past few weeks. Previously i had been using cacti 0.8.6d with thold 2.1 a with no problems. All worked perfectly. Now i am trying to install thold module...but i have just too many problems.

First i try to install the modular version of thold...
1. As many users here and at forums.cacti.net have pointed out, i am not able to view the current values of data sources for which threshold have been activated. The current value is always zero (0).

2. Whenever i try to create the threshold for new rrd sources, i get an error message as "undefined offset 0 in <cactipath to thold-funtions.php> at line 38"

For both of these two problems i have tried all turn-around propsed as tweaking 'rrd_last_entry' values etc but to no effect.


Secondly, i tried to install the plugin version of thold...

1. I removed the earlier modular version of thold (both files and mysql tables)

2. Installed the plugin architecture by replacing files as suggested and changing teh config.php. But as soon as i login after installation of plugin...i get a skeleton html (see attachment) page of cacti's index.php file with no image gifs of console/graphs/threshld etc. When i click on any hyperlink on the left hand side like the devices/datasources/threshold...i get a error webpage like 'Page not found'


Could anybody kindly explain what is going wrong here and is there any solution to this problem?


This usually happens if you haven't setup your $config["url_path"] correctly in your config.php. If your cacti install accessible like this
Code:
http://DOMAIN.com/cacti/

then you would set it like this
Code:
$config["url_path"] = '/cacti/';


If its in the root like this
Code:
http://DOMAIN.com

then you would set it like this
Code:
$config["url_path"] = '/';


I would double check that value first, and if thats not it then we will figure it out one way or the other.


Fri Sep 23, 2005 10:58 am
New User

Joined: Fri Sep 23, 2005 10:30 am
Posts: 4
Post 
thanks for your suggestions ...i will try them out and let you know.


For the problem of current values displayed as zero, i luckily stumbled upon a post in forums.cacti.net by [asm] (Posted: Mon May 23, 2005 3:41 am ) which solved that problem...
Basically it was suggested to replace the function 'get_current_value' in thold-functions.php with the following lines of code:

function get_current_value($rra, $ds)
{
global $config;
$last_time_entry = rrd_last($rra, "MAX");
$last_needed = $last_time_entry + 900;

$result = rrdtool_function_fetch($rra, time() - 900, time());
// Return 0 if the data source is not found (Newly created?)
if (!isset( $result["data_source_names"])) return false;

$idx = array_search($ds, $result["data_source_names"]);

// Return 0 if the value was not found (Cache Cleared?)
if (!isset($result["values"][$idx][0])) return false;

return round($result["values"][$idx][0]);
}


I did that and it solved all my problems with the modular version of threshold.


Now i will try to get working the plugin version as ii can see its huge usefullness.
Thanks all of you for your wonderfull contributions.


Fri Sep 23, 2005 11:45 am
New User

Joined: Fri Sep 23, 2005 10:30 am
Posts: 4
Post 
Jimmy, Thank you very much for the config url suggestion for correctly viewing plugins...It worked...Thanks a million....you are a champ number 1.


Fri Sep 23, 2005 12:27 pm
New User

Joined: Thu Dec 01, 2005 2:22 am
Posts: 4
Post Re: problems using cacti after plugin installation
if mine is

http://ipaddress/cacti


how?
i have changed the $config["url_path"] = '/'; to $config["url_path"] = '/cacti/';


but it still show that error


Thu Dec 01, 2005 3:02 am
Site Admin

Joined: Thu Nov 11, 2004 11:12 am
Posts: 2007
Post Re: problems using cacti after plugin installation
alan_ding wrote:
if mine is

http://ipaddress/cacti


how?
i have changed the $config["url_path"] = '/'; to $config["url_path"] = '/cacti/';


but it still show that error


It should work by changing it to

$config["url_path"] = '/cacti/';

What exact error are you getting?


Thu Dec 01, 2005 10:50 am
New User

Joined: Sun Oct 30, 2005 9:06 am
Posts: 1
Post Question for me also
Hi ,

After I modify some files ,then meet the same question,the top images of Thresholds and Monitors is broken,the graph_view and console is fine.
Someone could tell me why.
Thanks


Thu Dec 01, 2005 7:10 pm
New User

Joined: Thu Dec 01, 2005 2:22 am
Posts: 4
Post 
that's mine:

/usr/local/www/htdoc/cacti/config.php

/* This is full URL Path to the Cacti installation
For example, if your cacti was accessible by http://server/cacti/ you would user '/cacti/'
as the url path. For just http://server/ use '/'
*/

$config["url_path"] = '/cacti/';

/* ----- you probably do not need to change anything below this line ----- */

/* Files that do not need http header information - Command line scripts */
$no_http_header_files = array(
................................................................



but i still get the same error:


Create

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 478

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 482
New Graphs
Management

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 438

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 449
Graph Management

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 438

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 449

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 438

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 449

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 438

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 449

Notice: Undefined index: url_path in /usr/local/www/htdocs/cacti/lib/html.php on line 478
.
.
.
.
..
[/img]


Last edited by alan_ding on Sun Dec 04, 2005 9:19 pm, edited 1 time in total.



Thu Dec 01, 2005 8:38 pm
Post Question for me also
Hi ,

After I modify some files ,then meet the same question,the top images of Thresholds and Monitors is broken,the graph_view and console is fine.
Someone could tell me why.
Thanks


Thu Dec 01, 2005 10:27 pm
New User

Joined: Wed Feb 08, 2006 12:21 pm
Posts: 13
Post 
Hi All,

I am getting the following error after just installing THold;

Notice: Undefined offset: 0 in c:\Inetpub\wwwroot\plugins\thold\thold.php on line 92

I have installed the Plugin Architecture (which i think went ok). Then i installed the THold. This is a new installation and the only Device that was there is the localhost. I have imported the Advanced Ping Template and this is all that i am using on the localhost.

When i click the Data Sources and then the Advanced Ping for the localhost, the webpage takes forever to come up with the notice above.

I have checked the url_path variable in config.php and this is correctly set to '/'.

Anyhow and suggestions please ?

Running Windows 2003, PHP 5.1, MySQL 4.1, Latest Cacti Build (h), latest THold/Architecture off this website.

Kind Regards

Wayne


Tue Feb 14, 2006 6:34 am
User

Joined: Mon Oct 10, 2005 11:30 pm
Posts: 47
Post 
Thats kind of an odd bit of code
Code:
$sqlq = mysql_query("SELECT * FROM thold where rra='$rra'");
$total = mysql_num_rows($sqlq);
.......
$template_data_rrds = db_fetch_assoc("select id,data_source_name from data_template_rrd where local_data_id=" . $rra . " order by id");
$grapharr = db_fetch_assoc("SELECT DISTINCT local_graph_id FROM graph_templates_item WHERE task_item_id=$rrdlookup");

if ($total == 0) {
        // Take the first one available       
        $graph = $grapharr[0]["local_graph_id"]; //line 92
} else {         
        $graph = $myrow["element"];           
};

I tried replicating this by just going to the url https://blah.blah.blah/plugins/thold/thold.php so that no rra is specified and I dont get this error.

Just a guess do you have any graphs that you have assigned a threshold to or for that matter do you have any threshold templates?
try adding some graphs and see if you can autocreate thresholds.


Tue Feb 14, 2006 10:46 am
New User

Joined: Wed Feb 08, 2006 12:21 pm
Posts: 13
Post 
This is what i thought i was doing by clicking on that? Will read the instructions a little more and give it another go. I have now noticed though that my Advanced Pings are no longer doing any pings, very odd.

Anyhow, off to RTFM :)

Will be in touch

Wayne


Tue Feb 14, 2006 11:27 am
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 


Who is online

Users browsing this forum: Google [Bot] and 1 guest


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: