mirror of
https://github.com/Cacti/cacti.git
synced 2026-12-05 22:54:19 +09:00
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
This commit is contained in:
1 parent
395307f432
commit
ee28d397eb
1 file changed
+22
-7
+22
-7
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in new issue
Block a user