From ee28d397ebe21b8f5a85bd19729dea9feb6cce3d Mon Sep 17 00:00:00 2001 From: Ian Berry Date: Mon, 25 Apr 2005 01:11:14 +0000 Subject: [PATCH] add rrdtool version detection support git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/branches/BRANCH_0_8_6/cacti@2715 860744bd-22fc-0310-8c96-e9fe5004b5ca --- install/index.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/install/index.php b/install/index.php index 6156c0dcac..dcc08c81fe 100644 --- a/install/index.php +++ b/install/index.php @@ -165,6 +165,23 @@ if ($config["cacti_server_os"] == "unix") { $input["snmp_version"]["default"] = "net-snmp"; } +/* RRDTool Version */ +if ((file_exists($input["path_rrdtool"]["default"])) && (is_executable($input["path_rrdtool"]["default"]))) { + $input["rrdtool_version"] = $settings["general"]["rrdtool_version"]; + + $out_array = array(); + + exec($input["path_rrdtool"]["default"], $out_array); + + if (sizeof($out_array) > 0) { + if (ereg("^RRDtool 1\.2\.", $out_array[0])) { + $input["rrdtool_version"]["default"] = "rrd-1.2.x"; + }else if (ereg("^RRDtool 1\.0\.", $out_array[0])) { + $input["rrdtool_version"]["default"] = "rrd-1.0.x"; + } + } +} + /* default value for this variable */ if (!isset($_REQUEST["install_type"])) { $_REQUEST["install_type"] = 0; @@ -217,7 +234,11 @@ if ($_REQUEST["step"] == "4") { kill_session_var("sess_host_cache_array"); /* just in case we have hard drive graphs to deal with */ - run_data_query(db_fetch_cell("select id from host where hostname='127.0.0.1'"), 6); + $host_id = db_fetch_cell("select id from host where hostname='127.0.0.1'"); + + if (!empty($host_id)) { + run_data_query($host_id, 6); + } /* it's always a good idea to re-populate the poller cache to make sure everything is refreshed and up-to-date */ @@ -270,12 +291,6 @@ if ($_REQUEST["step"] == "4") { upgrade_to_0_8_6d(); } } - - /* there are no (visible) database changes between these version(s) and the current version. - * that means we can skip the "upgrade results" page altogether */ - if (($old_cacti_version == "0.8.6") || ($old_cacti_version == "0.8.6a") || ($old_cacti_version == "0.8.6b")) { - $_REQUEST["step"] = "3"; - } } ?>