mirror of
https://codeberg.org/mclemens/tsmmonitor2.git
synced 2024-12-22 12:36:32 -05:00
- Some pre-release cleanup and format beautification.
This commit is contained in:
parent
6f9003206b
commit
252b04ad95
@ -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 {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
@ -777,7 +777,6 @@ class TSMMonitor {
|
||||
$i++;
|
||||
} else {
|
||||
$outp = $this->adodb->fetchArrayDB($sql);
|
||||
//var_dump($outp);
|
||||
}
|
||||
}
|
||||
return $outp;
|
||||
|
@ -35,9 +35,7 @@
|
||||
|
||||
include_once("../includes/global.php");
|
||||
|
||||
|
||||
$tmonpolld = new PollD($adodb, $config["server_os"]);
|
||||
//$tmonpolld->setDebuglevel("WARN");
|
||||
$tmonpolld->controlPollD("on");
|
||||
$tmonpolld->poll();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user