Remove all unneeded if($debug)-statements and replace them with d_echo

This commit is contained in:
Mark Schouten
2015-08-20 15:02:40 +02:00
parent e0edeab13f
commit 55a2e0423d
24 changed files with 47 additions and 142 deletions

View File

@@ -23,9 +23,7 @@ function poll_sensor($device, $class, $unit) {
else {
// Try 5 times to get a valid temp reading
for ($i = 0; $i < 5; $i++) {
if ($debug) {
echo "Attempt $i ";
}
d_echo("Attempt $i ");
$sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib")));
preg_match('/[\d\.]+/', $sensor_value, $temp_response);
@@ -280,9 +278,7 @@ function poll_device($device, $options) {
// echo("$device_end - $device_start; $device_time $device_run");
echo "Polled in $device_time seconds\n";
if ($debug) {
echo 'Updating '.$device['hostname'].' - '.print_r($update_array)." \n";
}
d_echo('Updating '.$device['hostname'].' - '.print_r($update_array)." \n");
$updated = dbUpdate($update_array, 'devices', '`device_id` = ?', array($device['device_id']));
if ($updated) {