mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
1c997b30b5
git-svn-id: http://www.observium.org/svn/observer/trunk@1327 61d68cd4-352d-0410-923a-c4978735b2b8
31 lines
731 B
PHP
31 lines
731 B
PHP
<?php
|
|
|
|
$valid_fan = array();
|
|
|
|
echo("Fanspeeds : ");
|
|
|
|
include_dir("includes/discovery/fanspeeds");
|
|
|
|
## Delete removed sensors
|
|
|
|
if($debug) { echo("\n Checking ... \n"); print_r($valid_fan); }
|
|
|
|
$sql = "SELECT * FROM sensors WHERE sensor_class='fanspeed' AND device_id = '".$device['device_id']."'";
|
|
if ($query = mysql_query($sql))
|
|
{
|
|
while ($test_fan = mysql_fetch_array($query))
|
|
{
|
|
$fan_index = $test_fan['sensor_index'];
|
|
$fan_type = $test_fan['sensor_type'];
|
|
if($debug) { echo("$fan_type -> $fan_index\n"); }
|
|
if(!$valid_fan[$fan_type][$fan_index]) {
|
|
echo("-");
|
|
mysql_query("DELETE FROM `fanspeed` WHERE sensor_id = '" . $test_fan['sensor_id'] . "'");
|
|
}
|
|
}
|
|
}
|
|
|
|
unset($valid_fan); echo("\n");
|
|
|
|
?>
|