- Some pre-release cleanup and format beautification.

This commit is contained in:
Frank Fegert 2009-06-19 21:34:23 +00:00
parent 6f9003206b
commit 252b04ad95
3 changed files with 9 additions and 42 deletions

View File

@ -82,7 +82,6 @@ class PollD {
$this->servers = $this->getServers();
$this->queries = $this->getQueries();
$this->overviewqueries = $this->getOverviewQueries();
//$this->controlPollD("off");
}
@ -125,8 +124,6 @@ class PollD {
}
/**
* setDebuglevel
*
@ -179,8 +176,6 @@ class PollD {
}
/**
* getOverviewQueries - returns an array filled with all configured TSM overview queries
*
@ -213,9 +208,6 @@ class PollD {
}
/**
* execute - executes a TSM query on a TSM server and returns an array containing SQL insert statements including the results
*
@ -312,7 +304,6 @@ class PollD {
}
/**
* checkFreq - checks if configured checking frequency is reached
*
@ -336,7 +327,6 @@ class PollD {
}
/**
* getSleeptime - searches for the smallest polling frequency and returns the time to sleep
*
@ -463,8 +453,6 @@ class PollD {
}
/**
* cleanupDatabase - cleans up database (single result tables and/or hash entry)
*
@ -505,8 +493,6 @@ class PollD {
}
/**
* setPollDStatus
*
@ -525,7 +511,6 @@ class PollD {
}
/**
* isEnabled - returns true if PollD is enabled
*
@ -541,7 +526,6 @@ class PollD {
} else {
return FALSE;
}
}
@ -575,8 +559,6 @@ class PollD {
$result = $this->adodb->fetchArrayDB($sql);
return $result[0]["status"];
}
@ -587,31 +569,23 @@ class PollD {
*/
function poll() {
$sleeptime = $this->getSleeptime();
$this->writeMSG("Sleeptime will be ".$sleeptime." seconds\n", "WARN");
// infinite loop
while(true) {
if ($this->isEnabled()) {
$timestamp = time();
$this->writeMSG("running!\ntimestamp for this run is ".$timestamp."\n", "WARN");
$this->setPollDStatus("running", "", "");
foreach ($this->servers as $server) {
$this->log_timeneeded = time();
$this->log_unchangedresult = 0;
$this->log_pollfreqnoreached = 0;
$this->log_updated = 0;
// go through all queries defined in xml file
$this->writeMSG("---querying server ".$server["servername"]."\n", "WARN");
$this->writeMSG("------querying normal queries\n", "WARN");
foreach ($this->queries as $query) {
@ -628,7 +602,6 @@ class PollD {
$this->writeMSG("needed ".(time()-$timestamp)." seconds for this run.\n", "INFO");
//$tempsleeptime = $sleeptime-(time()-$timestamp);
$tempsleeptime = 900 -(time()-$timestamp);
if ($tempsleeptime < 0) {
$tempsleeptime = 0;
@ -647,10 +620,7 @@ class PollD {
}
}
}
}
?>

View File

@ -777,7 +777,6 @@ class TSMMonitor {
$i++;
} else {
$outp = $this->adodb->fetchArrayDB($sql);
//var_dump($outp);
}
}
return $outp;

View File

@ -35,9 +35,7 @@
include_once("../includes/global.php");
$tmonpolld = new PollD($adodb, $config["server_os"]);
//$tmonpolld->setDebuglevel("WARN");
$tmonpolld->controlPollD("on");
$tmonpolld->poll();