Problem install PA 2.8 using patch

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
long
Posts: 45
Joined: Tue Oct 12, 2010 9:27 pm
Location: Canada

Problem install PA 2.8 using patch

Post by long »

Hi,

I followed the instruction here http://docs.cacti.net/manual:087:1_installation.9_pia to install the Plugin Architecture v2.8 using the Patch and I have some rejected patch.

My Cacti is a clean 0.8.7g RPM from DAG repository (http://rpmfind.net/linux/RPM/dag/redhat ... oarch.html) and the official patches
http://www.cacti.net/downloads/patches/ ... ping.patch
http://www.cacti.net/downloads/patches/ ... rval.patch

patch -p1 -N < cacti-plugin-arch/cacti-plugin-0.8.7g-PA-v2.8.diff
patching file auth_changepassword.php
patching file auth_login.php
patching file data_sources.php
Hunk #6 FAILED at 1323.
1 out of 6 hunks FAILED -- saving rejects to file data_sources.php.rej
patching file graph_image.php
patching file graph.php
patching file graphs_new.php
patching file graphs.php
patching file host.php
patching file images/disable_icon.png
patching file images/enable_icon_disabled.png
patching file images/enable_icon.png
patching file images/install_icon_disabled.png
patching file images/install_icon.png
patching file images/uninstall_icon.gif
patching file images/view_none.gif
patching file include/auth.php
patching file include/bottom_footer.php
patching file include/config.php
patching file include/global_arrays.php
patching file include/global_constants.php
patching file include/global_form.php
patching file include/global.php
patching file include/global_settings.php
patching file include/plugins.php
patching file include/top_graph_header.php
patching file include/top_header.php
patching file index.php
patching file lib/api_device.php
patching file lib/auth.php
patching file lib/functions.php
patching file lib/html_form.php
patching file lib/html.php
patching file lib/plugins.php
patching file lib/poller.php
patching file lib/rrd.php
patching file lib/variables.php
patching file plugins/index.php
patching file plugins.php
patching file poller.php
Hunk #1 succeeded at 108 with fuzz 2.
Hunk #2 succeeded at 305 (offset -1 lines).
Hunk #3 FAILED at 449.
Hunk #4 succeeded at 500 (offset -1 lines).
1 out of 4 hunks FAILED -- saving rejects to file poller.php.rej
patching file user_admin.php
patching file utilities.php

Here are the content of the 2 .rej files

Code: Select all

cat data_sources.php.rej 
***************
*** 1310,1315 ****
  	$i = 0;
  	if (sizeof($data_sources) > 0) {
  		foreach ($data_sources as $data_source) {
  			$data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
  			$data_input_name    = ((empty($data_source["data_input_name"])) ? "<em>External</em>" : $data_source["data_input_name"]);
  			$poller_interval    = ((isset($poller_intervals[$data_source["local_data_id"]])) ? $poller_intervals[$data_source["local_data_id"]] : 0);
--- 1323,1329 ----
  	$i = 0;
  	if (sizeof($data_sources) > 0) {
  		foreach ($data_sources as $data_source) {
+ 			$data_source = api_plugin_hook_function('data_sources_table', $data_source);
  			$data_template_name = ((empty($data_source["data_template_name"])) ? "<em>None</em>" : $data_source["data_template_name"]);
  			$data_input_name    = ((empty($data_source["data_input_name"])) ? "<em>External</em>" : $data_source["data_input_name"]);
  			$poller_interval    = ((isset($poller_intervals[$data_source["local_data_id"]])) ? $poller_intervals[$data_source["local_data_id"]] : 0);
and

Code: Select all

cat poller.php.rej 
***************
*** 445,453 ****
  
  		/* sleep the appripriate amount of time */
  		if ($poller_runs_completed < $poller_runs) {
  			db_close();
  			usleep($sleep_time * 1000000);
  			db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
  		}
  	}else if (read_config_option('log_verbosity') >= POLLER_VERBOSITY_MEDIUM || $debug) {
  		cacti_log("WARNING: Cacti Polling Cycle Exceeded Poller Interval by " . $loop_end-$loop_start-$poller_interval . " seconds", TRUE, "POLLER");
--- 449,459 ----
  
  		/* sleep the appripriate amount of time */
  		if ($poller_runs_completed < $poller_runs) {
+ 			api_plugin_hook('poller_bottom');
  			db_close();
  			usleep($sleep_time * 1000000);
  			db_connect_real($database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port);
+ 			api_plugin_hook('poller_top');
  		}
  	}else if (read_config_option('log_verbosity') >= POLLER_VERBOSITY_MEDIUM || $debug) {
  		cacti_log("WARNING: Cacti Polling Cycle Exceeded Poller Interval by " . $loop_end-$loop_start-$poller_interval . " seconds", TRUE, "POLLER");
Can someone help?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Problem install PA 2.8 using patch

Post by gandalf »

Please enter those flagged lines into the code at the appropriate place.
Or use 087g along with PIA2.9 which include all known patches
R.
long
Posts: 45
Joined: Tue Oct 12, 2010 9:27 pm
Location: Canada

Re: Problem install PA 2.8 using patch

Post by long »

Where to download PIA2.9?

From this page http://docs.cacti.net/manual:087:1_installation.9_pia, there's a link to http://cactiusers.org/downloads/patches/ but only PIA2.8 is available for download.

Thanks,
Long
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Problem install PA 2.8 using patch

Post by gandalf »

PIA 2.9 has been "published" in the Announcement Forum (which is indeed to the preferred way to do so)
R.
long
Posts: 45
Joined: Tue Oct 12, 2010 9:27 pm
Location: Canada

Re: Problem install PA 2.8 using patch

Post by long »

Oh, didn't think about looking up in the Announcement Forum, thanks.

Could you put a message some where visible in the docs for plugins that to download the latest version of PA, see the Announcement forum. Cacti newbies like me will greatly appreciate.

Long
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Problem install PA 2.8 using patch

Post by gandalf »

long wrote:Oh, didn't think about looking up in the Announcement Forum, thanks.

Could you put a message some where visible in the docs for plugins that to download the latest version of PA, see the Announcement forum. Cacti newbies like me will greatly appreciate.

Long
This is quite correct and will change soon
R.
y3rff3j
Posts: 4
Joined: Mon Mar 28, 2011 9:10 pm

Re: Problem install PA 2.8 using patch

Post by y3rff3j »

As suggested, I've download PA v2.9 and I'm still getting the following error on a new Cacti install using v0.8.7g.

# patch -p1 -N --dry-run < cacti-plugin-0.8.7g-PA-v2.9.diff

patching file data_sources.php
Hunk #6 FAILED at 1323.
1 out of 6 hunks FAILED -- saving rejects to file data_sources.php.rej

patching file poller.php
Hunk #1 succeeded at 108 with fuzz 2.
Hunk #2 succeeded at 306 (offset 1 line).
Hunk #3 FAILED at 432.
Hunk #4 FAILED at 451.
Hunk #5 succeeded at 500 (offset 1 line).
2 out of 5 hunks FAILED -- saving rejects to file poller.php.rej

Any suggestions?
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Problem install PA 2.8 using patch

Post by noname »

You should apply 7 official patches for Cacti 0.8.7g before installing PIA 2.9.
(Different from 2.8, PIA 2.9 is created after official patches were released..)
y3rff3j
Posts: 4
Joined: Mon Mar 28, 2011 9:10 pm

Re: Problem install PA 2.8 using patch

Post by y3rff3j »

Thanks. I've figured that out after a bit of trial and error. :-)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests