added style orange3d, horizon, grey3d

fixed problems with empty dsmadmc resultsets
This commit is contained in:
Michael Clemens 2009-05-13 09:50:39 +00:00
parent d1bb95bdcb
commit a02490e0d8
12 changed files with 675 additions and 42 deletions

217
css/grey3d.css Normal file
View File

@ -0,0 +1,217 @@
/* - - - - - - - - - - - - - - - - - - - - */
/* BODY */
/* - - - - - - - - - - - - - - - - - - - - */
body, html {
background: #F5F6F8;
font-family: Verdana, Arial, sans-serif;
font-size: 12px;
color: #000000;
margin: 0 0 5px 0;
padding: 0;
}
/* - - - - - - - - - - - - - - - - - - - - */
/* OUTER CONTENTBOX */
/* - - - - - - - - - - - - - - - - - - - - */
#inhalt {
margin:10px auto;
text-align:left;
width: 90%;
padding: 2px;
background: #ffffff;
border: 1px solid #849e99;
}
.calendar * { margin: 0; padding: 0; border: 0; font-family: Tahoma, serif; font-weight: normal; color: #000; }
.calendar .invalidday a, .calendar .invalidday a:hover { color: #ccc; background: #fff; cursor: default; }
.calendar .selectedday { background: #ddd; }
.calendar .today { font-weight: bold; color: #f00; }
.calendar a { padding: 0 2px; color: #000; text-decoration: none; }
.calendar a:hover { background: #bbb; }
.calendar table { border-collapse: collapse; font-size: 90%; }
.calendar tbody td { width: 20px; }
.calendar td, .calendar th { padding: 1px; text-align: center; }
.calendar thead td { border-bottom: 1px solid #aaa; }
.calendar thead td { font-weight: bold; }
.calendar thead th a { font-size: 95%; font-weight: bold; }
.calendar thead th { padding: 2px 0; vertical-align: middle; background: #ddd; }
.calendar { padding-bottom: 2px; border: 1px solid #aaa; font-size: small; background: #fff; }
.calendaricon { cursor: pointer; }
.calendarlink, .calendaricon { margin: 0 3px; }
a.nav:link { color:#000000; text-decoration:underline; }
a.nav:visited { color:#000000; text-decoration:underline; }
a.nav:active { color:#cccccc; text-decoration:underline; }
a.nav:hover { color:#555555; text-decoration:underline; }
a.navhead:link { color:#000000; text-decoration:none; }
a.navhead:visited { color:#000000; text-decoration:none; }
a.navhead:active { color:#000000; text-decoration:none; }
a.navhead:hover { color:#555555; text-decoration:none; }
a.tablefooter:link { color:#000000; text-decoration:underline; }
a.tablefooter:visited { color:#000000; text-decoration:underline; }
a.tablefooter:active { color:#000000; text-decoration:none; }
a.tablefooter:hover { color:#555555; text-decoration:underline; }
a.navheader:link { color:#FFFFFF; text-decoration:none; }
a.navheader:visited { color:#FFFFFF; text-decoration:none; }
a.navheader:active { color:#FFFFFF; text-decoration:none; }
a.navheader:hover { color:#FFFFFF; text-decoration:none; }
/* - - - - - - - - - - - - - - - - - - - - */
/* TABLE*/
/* - - - - - - - - - - - - - - - - - - - - */
#design {
width: 100%;
background: #ffffff;
}
#head {
height: 75px;
text-align: center;
color: #ffffff;
font-size: 24px;
font-weight: bold;
background-image:url(../images/bg-grey-3d-5x75.jpg);
background-repeat:repeat-x;
}
#tnleft {
background: #ffffff;
height: 30px;
padding: 3px;
color: #000000;
font-size: 11px;
background-image:url(../images/bg-grey-3d-5x35.jpg);
background-repeat:repeat-x;
}
#tnright {
background: #ffffff;
height: 30px;
padding: 3px;
color: #000000;
font-size: 11px;
background-image:url(../images/bg-grey-3d-5x35.jpg);
background-repeat:repeat-x;
}
#tnbox1 {
float:left;
}
#tnbox2 {
float:right;
}
#printpreviewheader {
background: #cacaca;
padding: 3px;
color: #FFFFFF;
font-size: 16px;
}
#menue {
background: #ffffff;
padding: 0px;
color: #000000;
vertical-align: top;
}
.menuelinks a {
display: block;
width: auto;
background: #bac9c5;
margin-bottom: 2px;
padding: 3px 0px 3px 4px;
color: #000000;
font-size: 11px;
font-weight: bold;
text-decoration: none;
border: 1px solid #849e99;
}
.menuelinks a:hover {
background: #d8e0de;
text-decoration: none;
color: #000000;
}
.menuelinks .aktuell {
display: block;
width: auto;
background: #343d3b;
color: #dedede;
margin-bottom: 2px;
padding: 3px 0px 3px 4px;
font-size: 11px;
font-weight: bold;
border: 1px solid #010101;
}
.menuelinks .sidebarinfo {
display: block;
width: auto;
background: #fafafa;
margin-bottom: 2px;
padding: 3px 0px 3px 4px;
font-size: 11px;
text-decoration: none;
border: 1px solid #849e99;
}
#content {
background: #ffffff;
padding: 0px;
color: #000000;
vertical-align: top;
}
#footer {
background: #eaeaea;
padding: 3px;
color: #222222;
text-align: center;
background-image:url(../images/bg-grey-3d-5x35.jpg);
background-repeat:repeat-x;
}
#sysinfo {
background: #f4f4f4;
padding: 3px;
color: #999999;
text-align: center;
}
#table {
background: #dadada;
padding: 3px;
color: #ffffff;
text-align: center;
}
td { font-family: Tahoma, Geneva, Arial, helvetica, sans-serif; font-size: 10pt }
th { font-family: Tahoma, Geneva, Arial, helvetica, sans-serif; font-size: 10pt }
table.zebra {background-color: #849e99; border-spacing: 1px;margin-left: auto; margin-right: auto; width: 100%;}
table.zebra th { background-color: #bac9c5; }
table.zebra td.footer { background-color: #bac9c5; }
table.zebra td { padding: 4px;}
table.zebra tr.d0 { background-color: #fff; }
table.zebra tr.d1 { background-color: #f2f2f2; }
table.timetable {background-color: #849e99; border-spacing: 1px;margin-left: 1px; margin-right: auto;}
table.timetable th { background-color: #bac9c5; }
table.timetable th.content { background-color: #bac9c5; background-image:url(../images/tablebg.gif); }
table.timetable td { padding: 2px; font-size: 10px; }
table.timetable td.content { padding: 2px; font-size: 10px; background-image:url(../images/tablebg.gif); }
table.timetable tr.d0 { background-color: #fff; color: #dddddd;}
table.timetable tr.d1 { background-color: #f2f2f2; color: #ffffff;}
table.login {background-color: #eaeaea; border-spacing: 1px;margin-left: auto; margin-right: auto;}
table.login th { background-color: #eaeaea; text-align: center; }
table.login td { padding: 4px;}
table.login tr { background-color: #fff; text-align: center; }
.button { background-color: #bac9c5; background-image:url(../images/bg-grey-3d-5x35.jpg); }
.textfield { background-color: #bac9c5; background-image:url(../images/bg-grey-3d-5x35.jpg); }

217
css/horizon.css Normal file
View File

@ -0,0 +1,217 @@
/* - - - - - - - - - - - - - - - - - - - - */
/* BODY */
/* - - - - - - - - - - - - - - - - - - - - */
body, html {
background: #F5F6F8;
font-family: Verdana, Arial, sans-serif;
font-size: 12px;
color: #000000;
margin: 0 0 5px 0;
padding: 0;
}
/* - - - - - - - - - - - - - - - - - - - - */
/* OUTER CONTENTBOX */
/* - - - - - - - - - - - - - - - - - - - - */
#inhalt {
margin:10px auto;
text-align:left;
width: 90%;
padding: 2px;
background: #ffffff;
border: 1px solid #1f304e;
}
.calendar * { margin: 0; padding: 0; border: 0; font-family: Tahoma, serif; font-weight: normal; color: #000; }
.calendar .invalidday a, .calendar .invalidday a:hover { color: #ccc; background: #fff; cursor: default; }
.calendar .selectedday { background: #ddd; }
.calendar .today { font-weight: bold; color: #f00; }
.calendar a { padding: 0 2px; color: #000; text-decoration: none; }
.calendar a:hover { background: #bbb; }
.calendar table { border-collapse: collapse; font-size: 90%; }
.calendar tbody td { width: 20px; }
.calendar td, .calendar th { padding: 1px; text-align: center; }
.calendar thead td { border-bottom: 1px solid #aaa; }
.calendar thead td { font-weight: bold; }
.calendar thead th a { font-size: 95%; font-weight: bold; }
.calendar thead th { padding: 2px 0; vertical-align: middle; background: #ddd; }
.calendar { padding-bottom: 2px; border: 1px solid #aaa; font-size: small; background: #fff; }
.calendaricon { cursor: pointer; }
.calendarlink, .calendaricon { margin: 0 3px; }
a.nav:link { color:#eaeff4; text-decoration:underline; }
a.nav:visited { color:#eaeff4; text-decoration:underline; }
a.nav:active { color:#cccccc; text-decoration:underline; }
a.nav:hover { color:#555555; text-decoration:underline; }
a.navhead:link { color:#eaeff4; text-decoration:none; }
a.navhead:visited { color:#eaeff4; text-decoration:none; }
a.navhead:active { color:#eaeff4; text-decoration:none; }
a.navhead:hover { color:#555555; text-decoration:none; }
a.tablefooter:link { color:#eaeff4; text-decoration:underline; }
a.tablefooter:visited { color:#eaeff4; text-decoration:underline; }
a.tablefooter:active { color:#eaeff4; text-decoration:none; }
a.tablefooter:hover { color:#555555; text-decoration:underline; }
a.navheader:link { color:#FFFFFF; text-decoration:none; }
a.navheader:visited { color:#FFFFFF; text-decoration:none; }
a.navheader:active { color:#FFFFFF; text-decoration:none; }
a.navheader:hover { color:#FFFFFF; text-decoration:none; }
/* - - - - - - - - - - - - - - - - - - - - */
/* TABLE*/
/* - - - - - - - - - - - - - - - - - - - - */
#design {
width: 100%;
background: #ffffff;
}
#head {
height: 75px;
text-align: center;
color: #ffffff;
font-size: 24px;
font-weight: bold;
background-image:url(../images/bg-horizon-5x75.jpg);
background-repeat:repeat-x;
}
#tnleft {
background: #ffffff;
height: 30px;
padding: 3px;
color: #000000;
font-size: 11px;
background-image:url(../images/bg-horizon-5x35.jpg);
background-repeat:repeat-x;
}
#tnright {
background: #ffffff;
height: 30px;
padding: 3px;
color: #000000;
font-size: 11px;
background-image:url(../images/bg-horizon-5x35.jpg);
background-repeat:repeat-x;
}
#tnbox1 {
float:left;
}
#tnbox2 {
float:right;
}
#printpreviewheader {
background: #cacaca;
padding: 3px;
color: #FFFFFF;
font-size: 16px;
}
#menue {
background: #ffffff;
padding: 0px;
color: #000000;
vertical-align: top;
}
.menuelinks a {
display: block;
width: auto;
background: #3880af;
margin-bottom: 2px;
padding: 3px 0px 3px 4px;
color: #eaeff4;
font-size: 11px;
font-weight: bold;
text-decoration: none;
border: 1px solid #1f304e;
}
.menuelinks a:hover {
background: #bdd6e6;
text-decoration: none;
color: #000000;
}
.menuelinks .aktuell {
display: block;
width: auto;
background: #1f304e;
color: #eaeff4;
margin-bottom: 2px;
padding: 3px 0px 3px 4px;
font-size: 11px;
font-weight: bold;
border: 1px solid #010101;
}
.menuelinks .sidebarinfo {
display: block;
width: auto;
background: #fafafa;
margin-bottom: 2px;
padding: 3px 0px 3px 4px;
font-size: 11px;
text-decoration: none;
border: 1px solid #1f304e;
}
#content {
background: #ffffff;
padding: 0px;
color: #000000;
vertical-align: top;
}
#footer {
background: #eaeaea;
padding: 3px;
color: #eaeff4;
text-align: center;
background-image:url(../images/bg-horizon-5x35.jpg);
background-repeat:repeat-x;
}
#sysinfo {
background: #f4f4f4;
padding: 3px;
color: #999999;
text-align: center;
}
#table {
background: #dadada;
padding: 3px;
color: #ffffff;
text-align: center;
}
td { font-family: Tahoma, Geneva, Arial, helvetica, sans-serif; font-size: 10pt }
th { font-family: Tahoma, Geneva, Arial, helvetica, sans-serif; font-size: 10pt }
table.zebra {background-color: #1f304e; border-spacing: 1px;margin-left: auto; margin-right: auto; width: 100%;}
table.zebra th { background-color: #3880af; }
table.zebra td.footer { background-color: #3880af; }
table.zebra td { padding: 4px;}
table.zebra tr.d0 { background-color: #fff; }
table.zebra tr.d1 { background-color: #f2f2f2; }
table.timetable {background-color: #1f304e; border-spacing: 1px;margin-left: 1px; margin-right: auto;}
table.timetable th { background-color: #3880af; }
table.timetable th.content { background-color: #3880af; background-image:url(../images/tablebg.gif); }
table.timetable td { padding: 2px; font-size: 10px; }
table.timetable td.content { padding: 2px; font-size: 10px; background-image:url(../images/tablebg.gif); }
table.timetable tr.d0 { background-color: #fff; color: #dddddd;}
table.timetable tr.d1 { background-color: #f2f2f2; color: #ffffff;}
table.login {background-color: #eaeaea; border-spacing: 1px;margin-left: auto; margin-right: auto;}
table.login th { background-color: #eaeaea; text-align: center; }
table.login td { padding: 4px;}
table.login tr { background-color: #fff; text-align: center; }
.button { background-color: #3880af; color: #eaeff4; background-image:url(../images/bg-horizon-5x35.jpg); }
.textfield { background-color: #3880af; color: #eaeff4; background-image:url(../images/bg-horizon-5x35.jpg); }

216
css/orange3d.css Normal file
View File

@ -0,0 +1,216 @@
/* - - - - - - - - - - - - - - - - - - - - */
/* BODY */
/* - - - - - - - - - - - - - - - - - - - - */
body, html {
background: #F5F6F8;
font-family: Verdana, Arial, sans-serif;
font-size: 12px;
color: #000000;
margin: 0 0 5px 0;
padding: 0;
}
/* - - - - - - - - - - - - - - - - - - - - */
/* OUTER CONTENTBOX */
/* - - - - - - - - - - - - - - - - - - - - */
#inhalt {
margin:10px auto;
text-align:left;
width: 90%;
padding: 2px;
background: #ffffff;
border: 1px solid #ff7f03;
}
.calendar * { margin: 0; padding: 0; border: 0; font-family: Tahoma, serif; font-weight: normal; color: #000; }
.calendar .invalidday a, .calendar .invalidday a:hover { color: #ccc; background: #fff; cursor: default; }
.calendar .selectedday { background: #ddd; }
.calendar .today { font-weight: bold; color: #f00; }
.calendar a { padding: 0 2px; color: #000; text-decoration: none; }
.calendar a:hover { background: #bbb; }
.calendar table { border-collapse: collapse; font-size: 90%; }
.calendar tbody td { width: 20px; }
.calendar td, .calendar th { padding: 1px; text-align: center; }
.calendar thead td { border-bottom: 1px solid #aaa; }
.calendar thead td { font-weight: bold; }
.calendar thead th a { font-size: 95%; font-weight: bold; }
.calendar thead th { padding: 2px 0; vertical-align: middle; background: #ddd; }
.calendar { padding-bottom: 2px; border: 1px solid #aaa; font-size: small; background: #fff; }
.calendaricon { cursor: pointer; }
.calendarlink, .calendaricon { margin: 0 3px; }
a.nav:link { color:#000000; text-decoration:underline; }
a.nav:visited { color:#000000; text-decoration:underline; }
a.nav:active { color:#cccccc; text-decoration:underline; }
a.nav:hover { color:#555555; text-decoration:underline; }
a.navhead:link { color:#000000; text-decoration:none; }
a.navhead:visited { color:#000000; text-decoration:none; }
a.navhead:active { color:#000000; text-decoration:none; }
a.navhead:hover { color:#555555; text-decoration:none; }
a.tablefooter:link { color:#000000; text-decoration:underline; }
a.tablefooter:visited { color:#000000; text-decoration:underline; }
a.tablefooter:active { color:#000000; text-decoration:none; }
a.tablefooter:hover { color:#555555; text-decoration:underline; }
a.navheader:link { color:#FFFFFF; text-decoration:none; }
a.navheader:visited { color:#FFFFFF; text-decoration:none; }
a.navheader:active { color:#FFFFFF; text-decoration:none; }
a.navheader:hover { color:#FFFFFF; text-decoration:none; }
/* - - - - - - - - - - - - - - - - - - - - */
/* TABLE*/
/* - - - - - - - - - - - - - - - - - - - - */
#design {
width: 100%;
background: #ffffff;
}
#head {
height: 75px;
text-align: center;
color: #ffffff;
font-size: 24px;
font-weight: bold;
background-image:url(../images/bg-orange3d-5x75.jpg);
background-repeat:repeat-x;
}
#tnleft {
background: #ffffff;
height: 30px;
padding: 3px;
color: #000000;
font-size: 11px;
background-image:url(../images/bg-orange3d-5x35.jpg);
background-repeat:repeat-x;
}
#tnright {
background: #ffffff;
height: 30px;
padding: 3px;
color: #000000;
font-size: 11px;
background-image:url(../images/bg-orange3d-5x35.jpg);
background-repeat:repeat-x;
}
#tnbox1 {
float:left;
}
#tnbox2 {
float:right;
}
#printpreviewheader {
background: #cacaca;
padding: 3px;
color: #FFFFFF;
font-size: 16px;
}
#menue {
background: #ffffff;
padding: 0px;
color: #000000;
vertical-align: top;
}
.menuelinks a {
display: block;
width: auto;
background: #fccd4e;
margin-bottom: 2px;
padding: 3px 0px 3px 4px;
color: #000000;
font-size: 11px;
font-weight: bold;
text-decoration: none;
border: 1px solid #ff7f03;
}
.menuelinks a:hover {
background: #fceabb;
text-decoration: none;
color: #000000;
}
.menuelinks .aktuell {
display: block;
width: auto;
background: #f8b602;
margin-bottom: 2px;
padding: 3px 0px 3px 4px;
font-size: 11px;
font-weight: bold;
border: 1px solid #336e9e;
}
.menuelinks .sidebarinfo {
display: block;
width: auto;
background: #fafafa;
margin-bottom: 2px;
padding: 3px 0px 3px 4px;
font-size: 11px;
text-decoration: none;
border: 1px solid #ff7f03;
}
#content {
background: #ffffff;
padding: 0px;
color: #000000;
vertical-align: top;
}
#footer {
background: #eaeaea;
padding: 3px;
color: #222222;
text-align: center;
background-image:url(../images/bg-orange3d-5x35.jpg);
background-repeat:repeat-x;
}
#sysinfo {
background: #f4f4f4;
padding: 3px;
color: #999999;
text-align: center;
}
#table {
background: #dadada;
padding: 3px;
color: #ffffff;
text-align: center;
}
td { font-family: Tahoma, Geneva, Arial, helvetica, sans-serif; font-size: 10pt }
th { font-family: Tahoma, Geneva, Arial, helvetica, sans-serif; font-size: 10pt }
table.zebra {background-color: #ff7f03; border-spacing: 1px;margin-left: auto; margin-right: auto; width: 100%;}
table.zebra th { background-color: #fccd4e; }
table.zebra td.footer { background-color: #fccd4e; }
table.zebra td { padding: 4px;}
table.zebra tr.d0 { background-color: #fff; }
table.zebra tr.d1 { background-color: #f2f2f2; }
table.timetable {background-color: #ff7f03; border-spacing: 1px;margin-left: 1px; margin-right: auto;}
table.timetable th { background-color: #fccd4e; }
table.timetable th.content { background-color: #fccd4e; background-image:url(../images/tablebg.gif); }
table.timetable td { padding: 2px; font-size: 10px; }
table.timetable td.content { padding: 2px; font-size: 10px; background-image:url(../images/tablebg.gif); }
table.timetable tr.d0 { background-color: #fff; color: #dddddd;}
table.timetable tr.d1 { background-color: #f2f2f2; color: #ffffff;}
table.login {background-color: #eaeaea; border-spacing: 1px;margin-left: auto; margin-right: auto;}
table.login th { background-color: #eaeaea; text-align: center; }
table.login td { padding: 4px;}
table.login tr { background-color: #fff; text-align: center; }
.button { background-color: #fccd4e; background-image:url(../images/bg-orange3d-5x35.jpg); }
.textfield { background-color: #fccd4e; background-image:url(../images/bg-orange3d-5x35.jpg); }

BIN
images/bg-grey-3d-5x35.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

BIN
images/bg-grey-3d-5x75.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

BIN
images/bg-horizon-5x35.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

BIN
images/bg-horizon-5x75.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

BIN
images/bg-orange3d-5x35.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

BIN
images/bg-orange3d-5x75.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

View File

@ -43,10 +43,10 @@
<td width=100% id="footer">TSM Monitor 2 v<?php echo $config["tsm_monitor_version"]?> &copy; 2008 - <?php echo date('Y'); ?> TSM Monitor Development Team (<a class='nav' href="http://www.tsm-monitor.org">www.tsm-monitor.org</a>)</td>
<td>
<?php
/**
#/**
echo " <form action=".$_SERVER['PHP_SELF']."?q=".$GETVars['qq']."&m=".$GETVars['menu']."&s=".$GETVars['server']." method='post'>\n";
echo " <select name='css' size=1 onChange='submit();' class='button'>\n";
$styles = array('default.css', 'blue.css', 'dark.css');
$styles = array('default.css', 'blue.css', 'dark.css', 'grey3d.css', 'horizon.css', 'orange3d');
foreach ($styles as $style) {
echo ' <option value="'.$style.'"';
if ($_SESSION['stylesheet'] == $style){ echo "SELECTED"; }
@ -54,7 +54,7 @@ foreach ($styles as $style) {
}
echo " </select>\n";
echo " </form>\n";
**/
#**/
?>
</td>
</tr>

View File

@ -129,7 +129,6 @@ class PollD {
$servers[$val["servername"]] = (array)$val;
}
return $servers;
//return $rows;
}
@ -172,16 +171,23 @@ class PollD {
$stop = strstr($read, 'ANR2034E');
$stop = strstr($read, 'ANS1017E');
$stop = strstr($read, 'ANS8023E');
$blank = strstr($read, 'ANR2034E'); // dsmadmc runs correctly but result is empty (e.g. processes)
//$stop = strstr($read, 'ANS8023E');
if ($read != ' ' && $read != '' && !$stop) {
$read = preg_replace('/[\n]+/', '', $read);
if ($restable == "res_querysession_TSMSRV1") echo $read."\n";
$read = ereg_replace("\t","\",\"",$read);
if ($restable == "res_querysession_TSMSRV1") echo $read."\n";
if ($timestamp != '') {
$out[] = 'INSERT IGNORE INTO '.$restable.' values ("'.$timestamp.'", "'.$read.'")';
} else {
$out[] = 'INSERT INTO '.$restable.' (name, result) values ("'.$overviewname.'", "'.$read.'") ON DUPLICATE KEY update result="'.$read.'"';
if ($blank == "") {
$read = preg_replace('/[\n]+/', '', $read);
if ($restable == "res_querysession_TSMSRV1") echo $read."\n";
$read = ereg_replace("\t","\",\"",$read);
if ($restable == "res_querysession_TSMSRV1") echo $read."\n";
if ($timestamp != '') {
$out[] = 'INSERT IGNORE INTO '.$restable.' values ("'.$timestamp.'", "'.$read.'")';
} else {
$out[] = 'INSERT INTO '.$restable.' (name, result) values ("'.$overviewname.'", "'.$read.'") ON DUPLICATE KEY update result="'.$read.'"';
}
} else { // result is empty and it's ok
$out[0] = 'INSERT IGNORE INTO '.$restable.' (timestamp) values ("'.$timestamp.'")';
$hashstring = "";
$stop = TRUE;
}
//$out[] = $read;
}
@ -189,7 +195,7 @@ class PollD {
}
$return["sql"] = $out;
$return["md5"] = md5($hashstring);
if (!$stop){
if (!$stop || ($blank && $stop)){
return $return;
} else {
return "";
@ -210,7 +216,6 @@ class PollD {
$sql = "select count(*) from log_hashes where TABLENAME='".$tablename."' and HASH='".$hash."'";
$countobj = $this->adodb->fetchArrayDB($sql);
//$countobj = $this->fireMySQLQuery($sql, TRUE);
$countarray = (array)$countobj[0];
$count = $countarray["count(*)"];
@ -219,10 +224,9 @@ class PollD {
} else {
$sql = 'INSERT INTO log_hashes VALUES ("'.$tablename.'", "'.$hash.'")';
$colarray = array();
$colarray[$tablename] = $hash;
//echo $sql;
$colarray["tablename"] = $tablename;
$colarray["hash"] = $hash;
$this->adodb->updateDB("log_hashes", $colarray, 'tablename');
//$this->fireMySQLQuery($sql, FALSE);
return FALSE;
}
@ -242,7 +246,6 @@ class PollD {
function checkFreq($tablename, $pollfreq, $timestamp) {
$sql = "select MAX(TimeStamp) from ".$tablename;
//$res = $this->fireMySQLQuery($sql, TRUE);
$res = $this->adodb->fetchArrayDB($sql);
$resarray = $res[0];
$lastinsert = $resarray["MAX(TimeStamp)"];
@ -266,13 +269,11 @@ class PollD {
$sql = "select MIN(pollfreq) from cfg_queries";
$res = $this->adodb->fetchArrayDB($sql);
//$res = $this->fireMySQLQuery($sql, TRUE);
$resarray = (array)$res[0];
$minqueries = $resarray["MIN(pollfreq)"];
$sql = "select MIN(pollfreq) from cfg_overviewqueries";
$res = $this->adodb->fetchArrayDB($sql);
//$res = $this->fireMySQLQuery($sql, TRUE);
$resarray = (array)$res[0];
$minoverview = $resarray["MIN(pollfreq)"];
@ -297,17 +298,14 @@ class PollD {
if (!$ignorePollFreq) echo "---------".$queryname.": ";
// create table if not exists
$showsql = "SHOW TABLES LIKE '".$tablename."'";
//$res = $this->fireMySQLQuery($showsql, TRUE);
$res = $this->adodb->fetchArrayDB($showsql);
if (!isset($res[0])) {
$fieldsql = "select fields from cfg_queries where name='".$queryname."'";
//$fields = $this->fireMySQLQuery($fieldsql, TRUE);
$fields = $this->adodb->fetchArrayDB($fieldsql);
var_dump($fields);
$ctsql = "CREATE TABLE `".$tablename."` (".$fields[0]['fields'].") DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
if (!$ignorePollFreq) echo "created table ".$tablename." and ";
//$ctsql = "CREATE TABLE IF NOT EXISTS ".$tablename." LIKE smp_".$query["name"];
//$this->fireMySQLQuery($ctsql, FALSE);
$this->adodb->execDB($ctsql);
}
// execute query and store result in mysql db
@ -317,13 +315,11 @@ class PollD {
if (!$this->checkHash($tablename, $result["md5"])) {
if ($query["polltype"]=="update") {
$dropsql = "truncate table ".$tablename;
//$this->fireMySQLQuery($dropsql, FALSE);
$this->adodb->execDB($dropsql);
if (!$ignorePollFreq) echo " TRUNCATED TABLE and ";
}
foreach ($result["sql"] as $insertquery) {
if ($queryname == "querysession") echo "\n\n".$insertquery."\n\n";
//$this->fireMySQLQuery($insertquery, FALSE);
$this->adodb->execDB($insertquery);
}
if (!$ignorePollFreq) echo "inserted new rows into ".$tablename."\n";
@ -358,11 +354,9 @@ class PollD {
//$ctsql = "CREATE TABLE IF NOT EXISTS ".$tablename." LIKE smp_overview";
$ctsql = "CREATE TABLE IF NOT EXISTS ".$tablename." ( `name` varchar(35) collate utf8_unicode_ci NOT NULL, `result` varchar(255) collate utf8_unicode_ci NOT NULL, UNIQUE KEY `name` (`name`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
$this->adodb->execDB($ctsql);
//$this->fireMySQLQuery($ctsql, FALSE);
$result = $this->execute($query["query"], $server["servername"], $tablename, '', $query["name"]);
if ($result != "") {
foreach ($result["sql"] as $insertquery) {
//$this->fireMySQLQuery($insertquery, FALSE);
$this->adodb->execDB($insertquery);
echo "inserted row\n";
}
@ -384,9 +378,11 @@ class PollD {
* @param string $hashonly do not drop table, just delete entry in log_hashes
*/
function cleanupDatabase($servername = "", $queryname = "", $overviewqueryname = "", $hashonly = "yes"){
function cleanupDatabase($servername = "", $queryname = "", $overviewqueryname = "", $months = "9999" ,$hashonly = "yes"){
if ($servername != "" && $queryname != "" && $overviewqueryname != "") {
$time = time()-($months*30*24*60*60);
$wc = " WHERE `timestamp`<'".$time."'";
foreach ($this->servers as $server) {
if ($servername == "all" || $server["servername"] == $servername) {
foreach ($this->queries as $query) {
@ -394,7 +390,6 @@ class PollD {
$tablename = "res_".$query["name"]."_".$server["servername"];
if ($hashonly != "yes") {
$dropsql = "drop table ".$tablename;
//$this->fireMySQLQuery($dropsql, FALSE);
$this->adodb->execDB($dropsql);
}
$delsql = "DELETE FROM log_hashes where `tablename` = '".$tablename."'";
@ -406,7 +401,6 @@ class PollD {
if (($overviewqueryname == "all" || $query["name"] == $overviewqueryname) && $overviewqueryname != "none") {
$tablename = "res_overview_".$server["servername"];
$dropsql = "drop table ".$tablename;
//$this->fireMySQLQuery($dropsql, FALSE);
$this->adodb->execDB($dropsql);
}
}
@ -433,7 +427,6 @@ class PollD {
if ($nextrun != "") $nextrun = ", `nextrun`='".$nextrun."'";
$sql = "update log_polldstat set ".$status." ".$lastrun." ".$nextrun." WHERE `id`='1'";
//$this->fireMySQLQuery($sql, FALSE);
$this->adodb->execDB($sql);
}
@ -448,7 +441,6 @@ class PollD {
function isEnabled() {
$sql = "select enabled from log_polldstat WHERE `id`='1'";
//$result = $this->fireMySQLQuery($sql, TRUE);
$result = $this->adodb->fetchArrayDB($sql);
if ($result != "" && $result[0]["enabled"] == "1"){
@ -475,13 +467,8 @@ class PollD {
} else {
return "";
}
//$colarray = array();
//$colarray["enabled"] = $val;
$sql = "update log_polldstat set `enabled` = '".$val."' WHERE `id`='1'";
//$this->fireMySQLQuery($sql, FALSE);
echo $sql;
$this->adodb->execDB($sql);
//$this->adodb->updateDB("log_polldstat", $colarray, 'id');
}
@ -494,7 +481,6 @@ class PollD {
function getStatus() {
$sql = "select status from log_polldstat WHERE `id`='1'";
//$result = $this->fireMySQLQuery($sql, TRUE);
$result = $this->adodb->fetchArrayDB($sql);
return $result[0]["status"];
@ -511,7 +497,7 @@ class PollD {
function poll(){
//$this->controlPollD("off");
$this->controlPollD("off");
$sleeptime = $this->getSleeptime();
@ -548,7 +534,6 @@ class PollD {
$this->pollOverviewQuery($query, $server, $timestamp);
}
$sql = 'INSERT INTO log_polldlog VALUES ("'.$timestamp.'", "'.$server["servername"].'", "'.$log_updated.'", "'.$log_unchangedresult.'", "'.$log_pollfreqnoreached.'", "'.(time()-$log_timeneeded).'")';
//$this->fireMySQLQuery($sql, FALSE);
$this->adodb->execDB($sql);
}
$init = "no";

View File

@ -132,8 +132,6 @@ class TSMMonitor {
if ($_POST["Poll"] == "Poll Now!") {
$timestamp = time();
$tmonpolld = new PollD($this->adodb);
//$tmonpolld->setDBParams($this->db_host, $this->db_name, $this->db_user, $this>db_password);
//$tmonpolld->initialize();
$tmonpolld->pollQuery($tmonpolld->queries[$this->GETVars['qq']], $tmonpolld->servers[$this->GETVars['server']], TRUE, $timestamp);
$_SESSION['timemachine']['date'] = $timestamp;
$_SESSION['timemachine']['time'] = $timestamp;