- Database changes:

- Fixed wrong beta release version.
  - Changed 'archives_24h' query from append to update to match 'backups_24h'.
  - Removed example server entries.
- Workaround for cases where PHP-option 'magic_quotes_gpc = on' messes up
  quoted data in POSTs.
- Workaround for truncated single line input fields. If strlen > 150, use
  textbox instead of input/text. Might be browser dependent, adjust limit
  as needed.
This commit is contained in:
Frank Fegert 2009-06-19 21:40:25 +00:00
parent 252b04ad95
commit 8071794ae2
3 changed files with 24 additions and 22 deletions

View File

@ -163,7 +163,6 @@ if ($_POST["css"] != "") {
echo "<table class='zebra'>";
echo "<tr><th>Key</th><th>Value</th></tr>";
foreach ($sqlresth as $col) {
echo "TEST: ".$col['Field']." -> $colval<br>\n";
if ($col['Field'] != "id") {
if ($i == 0) {
echo "<tr class='d0'>";
@ -201,12 +200,18 @@ if ($_POST["css"] != "") {
$i = 0;
}
if ($keycell == "password") {
echo "<td><b>".$keycell."</b></td><td><input type='password' name='txt".$keycell."' value='' /></td></tr>";
echo "<td><b>".$keycell."</b></td><td><input type='password' name='txt".$keycell."' value='' /></td></tr>\n";
} else if ($keycell == "id") {
$id = $valcell;
} else {
echo "<td><b>".$keycell."</b></td><td><input type='text' size='50' name='txt".$keycell."' value='".$valcell."' /></td></tr>";
}
echo "<td><b>".$keycell."</b></td><td>";
if (strlen($valcell) < 150) {
echo "<input type='text' size='50' maxlength='150' name='txt".$keycell."' value='".$valcell."' />";
} else {
echo "<textarea name='txt".$keycell."' cols='60' rows='5'>$valcell</textarea>";
}
echo "</td></tr>\n";
}
}
}
echo "<tr><td colspan=2 class='footer'>";
@ -239,6 +244,9 @@ if ($_POST["css"] != "") {
// get all table fields to be selected
foreach ($sqlresth as $col) {
if (get_magic_quotes_gpc() != 0) {
$_POST["txt".$col['Field']] = stripslashes($_POST["txt".$col['Field']]);
}
if ($col['Field'] != "id") {
if ($col['Field'] == "password") {
if ($_POST["txt".$col['Field']] != "") {
@ -249,17 +257,15 @@ if ($_POST["css"] != "") {
} else {
$val = $_POST["txt".$col['Field']];
}
// if ($val != "") {
if ($_POST['AddSave'] == "Save") {
$colarray["`".$col['Field']."`"] = $val;
$val = "'".$val."'";
array_push($sqlcols, $col['Field']);
array_push($sqlvals, $val);
} else if ($_POST['EditSave'] == "Save") {
$colarray["`".$col['Field']."`"] = $val;
array_push($set, $col['Field']."='".$val."'");
}
// }
if ($_POST['AddSave'] == "Save") {
$colarray["`".$col['Field']."`"] = $val;
$val = "'".$val."'";
array_push($sqlcols, $col['Field']);
array_push($sqlvals, $val);
} else if ($_POST['EditSave'] == "Save") {
$colarray["`".$col['Field']."`"] = $val;
array_push($set, $col['Field']."='".$val."'");
}
}
}
if ($_POST['AddSave'] == "Save") {

View File

@ -55,7 +55,7 @@ include(dirname(__FILE__) . "/config.php");
$config = array();
// ** Current TSM Monitor version ** //
$config["tsm_monitor_version"] = '0.1.0';
$config["tsm_monitor_version"] = '0.0.1';
// ** Set TSM Monitor server OS to a general value (only 'unix' or 'win32') ** //
$config["server_os"] = (strstr(PHP_OS, "WIN")) ? "win32" : "unix";

View File

@ -56,7 +56,7 @@ CREATE TABLE IF NOT EXISTS `cfg_config` (
INSERT INTO `cfg_config` (`id`, `confkey`, `confval`, `description`) VALUES
(1, 'timeout', '200', 'change this value to your desired php timeout'),
(2, 'version', '0.1.0', 'TSM Monitor version'),
(2, 'version', 'new_install', 'TSM Monitor version'),
(3, 'path_tmlog', '', 'TSM Monitor Logfile Path'),
(4, 'path_polldlog', '', 'PollD Logfile Path');
@ -232,7 +232,7 @@ INSERT INTO `cfg_queries` (`id`, `name`, `label`, `tsmquery`, `fields`, `timetab
(21, 'backups_24h', 'Backup Times / 24h', 'SELECT entity AS "Node_name", CAST(sum(bytes/1024/1024/1024) AS decimal(8,3)) AS "GB_xfer", start_time, end_time, END_TIME-START_TIME as duration, comm_wait, Affected, Failed, Successful FROM summary WHERE activity=''BACKUP'' AND start_time>=current_timestamp - 24 hours group by start_time, end_time, Successful,Examined,Affected,Failed,entity,comm_wait', '`timestamp` int(11), `Node Name` varchar(64), `TX/GB` varchar(30), `Start Time` varchar(26), `End Time` varchar(26), `Duration` varchar(30), `Comm Wait` int(11), `Files` int(11), `Failed` int(11), `OK?` varchar(3) ', '`Node Name`, `Start Time`, `End Time`, `OK?`', 'This query gives you an overview over all backups performed during the last 24 hours.', 'Start Time', 'equal', 'NO', 'Successful', 'alarm', 0, 'update', 15, 'backup', 30),
(23, 'archivestatus_24h', 'Archive Status / 24h', 'select Entity, Successful, cast(float(sum(bytes))/1024/1024/1024 as dec(8,3)) as GB, Examined, Affected, Failed from summary where activity=''ARCHIVE'' and cast((current_timestamp-start_time)hours as decimal(8,0)) LESS 24 group by Entity,Successful,Examined,AFFECTED,Failed', '`timestamp` int(11), `Entity` varchar(64), `Successful` varchar(3), `GB` varchar(30), `Examined` int(11), `Affected` int(11), `Failed` int(11), UNIQUE KEY `Entity` (`Entity`,`GB`,`Examined`,`Affected`,`Failed`) ', NULL, 'A list of all archives that have been started during the last 24 hours', 'Successful', 'equal', 'NO', 'Successful', 'alarm', 0, 'update', 15, 'backup', 60),
(24, 'archives_all', 'Archive Times', 'SELECT entity AS "Node_name", CAST(sum(bytes/1024/1024/1024) AS decimal(8,3)) AS "GB_xfer", start_time, end_time, END_TIME-START_TIME as duration, comm_wait, Affected, Failed, Successful FROM summary WHERE activity=''ARCHIVE'' group by start_time, end_time, Successful,Examined,Affected,Failed,entity,comm_wait', '`timestamp` int(11), `Node Name` varchar(64), `TX/GB` varchar(30), `Start Time` varchar(26), `End Time` varchar(26), `Duration` varchar(30), `Comm Wait` int(11), `Files` int(11), `Failed` int(11), `OK?` varchar(3), UNIQUE KEY `Node Name` (`Node Name`,`Start Time`,`End Time`,`Comm Wait`) ', '`Node Name`, `Start Time`, `End Time`, `OK?`', 'Search for a node name and get a list of all archives performed on this node', 'Start Time', 'equal', 'NO', 'Successful', 'alarm', 0, 'append', 15, 'backup', 70),
(25, 'archives_24h', 'Archive Times / 24h', 'SELECT entity AS "Node_name", CAST(sum(bytes/1024/1024/1024) AS decimal(8,3)) AS "GB_xfer", start_time, end_time, END_TIME-START_TIME as duration, comm_wait, Affected, Failed, Successful FROM summary WHERE activity=''ARCHIVE'' AND start_time>=current_timestamp - 24 hours group by start_time, end_time, Successful,Examined,Affected,Failed,entity,comm_wait', '`timestamp` int(11), `Node Name` varchar(64), `TX/GB` varchar(30), `Start Time` varchar(26), `End Time` varchar(26), `Duration` varchar(30), `Comm Wait` int(11), `Files` int(11), `Failed` int(11), `OK?` varchar(3), UNIQUE KEY `Node Name` (`Node Name`,`Start Time`,`End Time`,`Comm Wait`) ', '`Node Name`, `Start Time`, `End Time`, `OK?`', 'This query gives you an overview over all archives performed during the last 24 hours.', 'Start Time', 'equal', 'NO', 'Successful', 'alarm', 0, 'append', 15, 'backup', 80),
(25, 'archives_24h', 'Archive Times / 24h', 'SELECT entity AS "Node_name", CAST(sum(bytes/1024/1024/1024) AS decimal(8,3)) AS "GB_xfer", start_time, end_time, END_TIME-START_TIME as duration, comm_wait, Affected, Failed, Successful FROM summary WHERE activity=''ARCHIVE'' AND start_time>=current_timestamp - 24 hours group by start_time, end_time, Successful,Examined,Affected,Failed,entity,comm_wait', '`timestamp` int(11), `Node Name` varchar(64), `TX/GB` varchar(30), `Start Time` varchar(26), `End Time` varchar(26), `Duration` varchar(30), `Comm Wait` int(11), `Files` int(11), `Failed` int(11), `OK?` varchar(3), UNIQUE KEY `Node Name` (`Node Name`,`Start Time`,`End Time`,`Comm Wait`) ', '`Node Name`, `Start Time`, `End Time`, `OK?`', 'This query gives you an overview over all archives performed during the last 24 hours.', 'Start Time', 'equal', 'NO', 'Successful', 'alarm', 0, 'update', 15, 'backup', 80),
(27, 'clientscheddef', 'Client Schedules Definitions', 'select schedule_name, domain_name, description, action, priority, starttime, period, perunits, dayofweek, sched_style from client_schedules', '`timestamp` int(11), `Schedule Name` varchar(30), `Domain` varchar(30), `Description` varchar(255), `Action` varchar(30), `Prio` int(2), `Start` varchar(26), `Period` int(2), `Unit` varchar(30), `Day of Week` varchar(30), `Style` varchar(30) ', NULL, 'A list of all client schedules defined in the current tsm server.', 'Schedule Name', '', '', '', '', 0, 'snapshot', 15, 'schedules', 10),
(28, 'clientschedules', 'Client Schedules Results', 'select node_name, schedule_name, scheduled_start, ACTUAL_START,COMPLETED, status, result, reason from events where scheduled_start >= current_timestamp - 24 hours and node_name != '''' and status != ''Future'' and status != ''Started''', '`timestamp` int(11), `Node Name` varchar(64), `Schedule Name` varchar(30), `Scheduled Start` varchar(26), `Actual Start` varchar(26), `End Time` varchar(26), `Status` varchar(30), `Result` int(11), `Reason` int(11), UNIQUE KEY `Node Name` (`Node Name`,`Schedule Name`,`Scheduled Start`,`Actual Start`,`End Time`)', '`Node Name`,`Actual Start`, `End Time`, `Status`', 'This query shows the start times and results of all client schedule that were scheduled during the last 24 hours.', 'Node Name', 'notequal', 'Completed', 'Status', 'alarm', 0, 'append', 15, 'schedules', 20),
(30, 'adminscheddef', 'Admin Schedules Definitions', 'select schedule_name, command, description, active, priority, starttime, period, perunits, dayofweek, sched_style from admin_schedules', '`timestamp` int(11), `Schedule Name` varchar(30), `Command` varchar(255), `Description` varchar(255), `Active?` varchar(3), `Prio` int(2), `Start` varchar(26), `Period` int(30), `Unit` varchar(30), `Day of Week` varchar(30), `Style` varchar(30) ', NULL, 'A list of all administrative schedules defined in the current tsm server.', 'Schedule Name', '', '', '', '', 0, 'snapshot', 15, 'schedules', 40),
@ -279,10 +279,6 @@ CREATE TABLE IF NOT EXISTS `cfg_servers` (
-- Dumping data for table `cfg_servers`
--
INSERT INTO `cfg_servers` (`id`, `servername`, `description`, `ip`, `port`, `username`, `password`, `libraryclient`, `default`) VALUES
(1, 'TSMSRV1', 'AIX', '172.18.111.1', 1500, 'tsmmon', 'tsmmon', 0, 1),
(2, 'TSMSRV2', 'YYY', '172.16.111.2', 1500, 'tsmmon', 'tsmmon', 1, 0),
(3, 'TSMSRV3', 'XXX', '172.16.111.3', 1500, 'tsmmon', 'tsmmon', 1, 0);
-- --------------------------------------------------------