fix some polling things. maybe.

git-svn-id: http://www.observium.org/svn/observer/trunk@213 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-03-31 13:08:17 +00:00
parent 5499871873
commit a8a7e04f1f
7 changed files with 56 additions and 69 deletions
+7 -5
View File
@@ -29,7 +29,7 @@ while ($device = mysql_fetch_array($device_query)) {
echo("Polling " . $device['hostname'] . " ( device_id ".$device['device_id']." )\n\n");
unset($update); unset($update_query); unset($seperator); unset($version); unset($uptime); unset($features);
unset($location); unset($hardware); unset($sysDescr); unset($sysContact);
unset($sysLocation); unset($hardware); unset($sysDescr); unset($sysContact);
$pingable = isPingable($device['hostname']);
@@ -46,6 +46,8 @@ while ($device = mysql_fetch_array($device_query)) {
if($snmpable) { echo("SNMP : yes :)\n"); } else { echo("SNMP : no :(\n"); }
}
unset($snmpdata);
if ($snmpable) {
$status = '1';
@@ -177,7 +179,7 @@ while ($device = mysql_fetch_array($device_query)) {
default:
pollDevice();
}
$location = str_replace("\"","", $sysLocation);
$sysLocation = str_replace("\"","", $sysLocation);
echo("Polling temperatures\n");
include("includes/polling/temperatures.inc.php");
@@ -208,10 +210,10 @@ while ($device = mysql_fetch_array($device_query)) {
mysql_query("INSERT INTO eventlog (host, interface, datetime, message) VALUES ('" . $device['device_id'] . "', NULL, NOW(), 'sysDescr -> $sysDescr')");
}
if ( $location && $device['location'] != $location ) {
$update .= $seperator . "`location` = '$location'";
if ( $sysLocation && $device['location'] != $sysLocation ) {
$update .= $seperator . "`location` = '$sysLocation'";
$seperator = ", ";
mysql_query("INSERT INTO eventlog (host, interface, datetime, message) VALUES ('" . $device['device_id'] . "', NULL, NOW(), 'Location -> $location')");
mysql_query("INSERT INTO eventlog (host, interface, datetime, message) VALUES ('" . $device['device_id'] . "', NULL, NOW(), 'Location -> $sysLocation')");
}
if ( $version && $device['version'] != $version ) {