. ************************************************************************ */ /** * * install.php, TSM Monitor * * install php file * * @author Frank Fegert * @package tsmmonitor */ include_once "includes/global.php"; if ($_REQUEST["step"] != "50" || $_REQUEST["refresh"] != "") { include_once "includes/page_head.php"; } // allow the upgrade script to run for as long as it needs to ini_set("max_execution_time", "0"); // check if the necessary PHP extensions are loaded $exts = array("session", "sockets"); $ext_load = true; foreach ($exts as $ext) { if (!extension_loaded($ext)){ $ext_load = false; $ext_miss .= "
  • $ext
  • \n"; } } if (!$ext_load) { echo "

    Error

    The following PHP extensions are missing:

    Please install those PHP extensions and retry the installation process.

    "; exit; } $tsm_monitor_versions = array("0.1.0", "0.1.1"); $old_tsm_monitor_version = fetchCellDB("select confval from cfg_config where confkey='version'", '', $conn); // try to find current (old) version in the array $old_version_index = array_search($old_tsm_monitor_version, $tsm_monitor_versions); // do a version check if ($old_tsm_monitor_version == $config["tsm_monitor_version"]) { echo "

    Error

    This installation is already up-to-date. Click here to use TSM Monitor.

    "; exit; } elseif (empty($old_tsm_monitor_version)) { echo "

    Error

    You have created a new database, but have not yet imported the 'tsmmonitor.sql' file. At the command line, execute the following to continue:

    mysql -u $db_user -p $db_password < tsmmonitor.sql

    This error may also be generated if the TSM Monitor database user does not have correct permissions on the TSM Monitor database.
    Please ensure that the TSM Monitor database user has the ability to SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, INDEX on the TSM Monitor database.

    "; exit; } // dsmadmc binary path $input["path_dsmadmc"] = $configarray["settings"]["path_dsmadmc"]; $input["path_dsmadmc"]["name"] = "dsmadmc Binary Path"; $input["path_dsmadmc"]["desc"] = "The path to the TSM admin client binary."; $which_dsmadmc = findPath("dsmadmc", $config["search_path"]); if (isset($configarray["settings"]["path_dsmadmc"])) { $input["path_dsmadmc"]["default"] = $configarray["settings"]["path_dsmadmc"]; } else if (!empty($which_dsmadmc)) { $input["path_dsmadmc"]["default"] = $which_dsmadmc; } else { $input["path_dsmadmc"]["default"] = "dsmadmc"; } // php/php5 binary path $input["path_php"] = $configarray["settings"]["path_php"]; $input["path_php"]["name"] = "PHP Binary Path"; $input["path_php"]["desc"] = "The path to the PHP binary."; $which_php = findPath("php", $config["search_path"]); if(!isset($which_php)) { $which_php = findPath("php5", $config["search_path"]); } if (isset($configarray["settings"]["path_php"])) { $input["path_php"]["default"] = $configarray["settings"]["path_php"]; } else if (!empty($which_php)) { $input["path_php"]["default"] = $which_php; } else { $input["path_php"]["default"] = "php"; } // logfile path $input["path_tmlog"] = $configarray["settings"]["path_tmlog"]; $input["path_tmlog"]["name"] = "TSM Monitor Logfile Path"; $input["path_tmlog"]["desc"] = "The path to the TSM Monitor log file."; if (isset($configarray["settings"]["path_tmlog"])) { $input["path_tmlog"]["default"] = $configarray["settings"]["path_tmlog"]; } else { $input["path_tmlog"]["default"] = $config["base_path"] . "tsmmonitor.log"; } // default for the install type if (!isset($_REQUEST["install_type"])) { $_REQUEST["install_type"] = 0; } // defaults for the install type dropdown if ($old_tsm_monitor_version == "new_install") { $default_install_type = "10"; } else { $default_install_type = "20"; } // pre-processing that needs to be done for each step // Intro and license page if (empty($_REQUEST["step"])) { $_REQUEST["step"] = 10; } else { // Install or update chooser if ($_REQUEST["step"] == "10") { $_REQUEST["step"] = "20"; } elseif (($_REQUEST["step"] == "20") && ($_REQUEST["install_type"] == "10")) { $_REQUEST["step"] = "30"; } elseif (($_REQUEST["step"] == "20") && ($_REQUEST["install_type"] == "20")) { $_REQUEST["step"] = "40"; // Install } elseif ($_REQUEST["step"] == "30") { $_REQUEST["step"] = "50"; // Update } elseif ($_REQUEST["step"] == "40") { $_REQUEST["step"] = "50"; } elseif (($_REQUEST["step"] == "50") && ($_POST["refresh"] == "Refresh")) { $_REQUEST["step"] = "50"; // get (possibly) updated values from the forms foreach ($input as $name => $array) { if (isset($_POST[$name])) { $input[$name]["default"] = $_POST[$name]; } } } elseif ($_REQUEST["step"] == "50") { $_REQUEST["step"] = "90"; } } if ($_REQUEST["step"] == "90") { // Flush updated data to DB foreach ($input as $name => $array) { if (isset($_POST[$name])) { updateDB('cfg_config', array(confkey => "$name", confval => $_POST[$name], description => $array['name']), 'confkey', $conn); } } updateDB('cfg_config', array(confkey => 'version', confval => $config['tsm_monitor_version']), 'confkey', $conn); closeDB($conn); header("Location: index.php"); exit; } elseif (($_REQUEST["step"] == "40") && ($_REQUEST["install_type"] == "20")) { // if the version is not found, die if (!is_int($old_version_index)) { echo "

    Error

    Invalid TSM Monitor version $old_tsm_monitor_version, cannot upgrade to ".$config["tsm_monitor_version"]."

    "; exit; } // loop over all versions up to the current and perform incremental updates for ($i = ($old_version_index+1); $i < count($tsm_monitor_versions); $i++) { if ($tsm_monitor_versions[$i] == "0.1.0") { include "install/0_1_0_to_0_1_1.php"; upgrade_to_0_1_1(); } /* elseif ($tsm_monitor_versions[$i] == "0.1.1") { include "install/0_1_1_to_0_1_2.php"; upgrade_to_0_1_2(); } elseif ($tsm_monitor_versions[$i] == "0.1.2") { include "install/0_1_2_to_0_1_3.php"; upgrade_to_0_1_3(); } */ } } ?> TSM Monitor Installer
     

    Thank you for taking the time to download and install TSM Monitor.

    TSM Monitor is a web application written in PHP to help TSM administrators to quickly get reports and health status information of their TSM servers. It generates it's content dynamically so one can easily add or modify queries to adapt the application to one's own needs. Before you can start using TSM Monitor, there are a few configuration steps that need to be done.

    Make sure you have read and followed the required steps needed to install TSM Monitor before continuing. Install information can be found here http://www.tsm-monitor.org/wiki/doku.php

    TSM Monitor is licensed under the GNU General Public License, you must agree to its provisions before continuing:

    TSM Monitor is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

    TSM Monitor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along with TSM Monitor. If not, see http://www.gnu.org/licenses/.

    Please select the type of installation

    Installation stuff could be done here ...

    Upgrade stuff could be done here ...

    Please check if the following values have been correctly determined for your system and correct if necessary.

    $array) { if (isset($input[$name])) { $file = $array["default"]; $resStr = ""; $capStr = ""; if (file_exists($file)) { $resStr = "[FOUND] "; $capStr = "
    [OK: FILE FOUND]
    "; } else { $resStr = "[NOT FOUND] "; $capStr = "
    [ERROR: FILE NOT FOUND]
    "; } echo "

    " . $resStr . $array["name"]; if (!empty($array["name"])) { echo ": " . $array["desc"]; } else { echo $array["desc"] . ""; } echo "
    " . $capStr . "

    "; } } ?>

    NOTE: Once you click "Finish", the above settings will be saved "as-is" to the TSM Monitor database. No further validation will be performed, so please make sure the above settings are correct! Any of the above settings can later on be changed with the TSM Monitor admin web interface.
    If you did choose to upgrade from a previous version of TSM Monitor, the database will also be upgraded by clicking "Finish".

     

    ">