From ed6ffa606798428aaedc407c58d41666bc338c4c Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Thu, 5 Apr 2012 16:17:41 +0000 Subject: [PATCH] syntaxer run git-svn-id: http://www.observium.org/svn/observer/trunk@2964 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/common.php | 14 +++--- includes/discovery/arp-table.inc.php | 2 +- includes/discovery/cisco-vrf.inc.php | 17 +++---- includes/discovery/current/apc.inc.php | 50 ++++++++----------- includes/discovery/entity-sensor.inc.php | 3 +- includes/discovery/mempools/junos.inc.php | 2 +- includes/discovery/power/ipoman.inc.php | 2 - .../discovery/processors/netscaler.inc.php | 3 +- includes/discovery/q-bridge-mib.inc.php | 2 +- includes/discovery/sensors-netscaler.inc.php | 6 +-- includes/discovery/sensors.inc.php | 2 +- .../temperatures/powerconnect.inc.php | 2 +- includes/discovery/vlans.inc.php | 12 ++--- includes/discovery/voltages/apc.inc.php | 4 -- includes/snmp.inc.php | 1 - irc.php | 9 ++-- poll-billing.php | 2 +- 17 files changed, 56 insertions(+), 77 deletions(-) diff --git a/includes/common.php b/includes/common.php index 42460a7a2..1de9c3e75 100644 --- a/includes/common.php +++ b/includes/common.php @@ -2,14 +2,14 @@ ## Common Functions -function format_number_short($number, $sf) +function format_number_short($number, $sf) { // This formats a number so that we only send back three digits plus an optional decimal point. // Example: 723.42 -> 723 72.34 -> 72.3 2.23 -> 2.23 list($whole, $decimal) = explode (".", $number); - if(strlen($whole) >= $sf || !is_numeric($decimal)) + if (strlen($whole) >= $sf || !is_numeric($decimal)) { $number = $whole; } elseif(strlen($whole) < $sf) { @@ -460,7 +460,7 @@ function formatStorage($value, $round = '2', $sf = '3') function format_si($value, $round = '2', $sf = '3') { - if($value < "0") + if ($value < "0") { $neg = 1; $value = $value * -1; @@ -479,14 +479,14 @@ function format_si($value, $round = '2', $sf = '3') for ($i = 1; (($i < count($sizes)) && ($value != 0) && ($value <= 0.1)); $i++) { $value = $value * 1000; $ext = $sizes[$i]; } } - if($neg) { $value = $value * -1; } + if ($neg) { $value = $value * -1; } return format_number_short(round($value, $round),$sf).$ext; } function format_bi($value, $round = '2', $sf = '3') { - if($value < "0") + if ($value < "0") { $neg = 1; $value = $value * -1; @@ -495,14 +495,14 @@ function format_bi($value, $round = '2', $sf = '3') $ext = $sizes[0]; for ($i = 1; (($i < count($sizes)) && ($value >= 1024)); $i++) { $value = $value / 1024; $ext = $sizes[$i]; } - if($neg) { $value = $value * -1; } + if ($neg) { $value = $value * -1; } return format_number_short(round($value, $round), $sf).$ext; } function format_number($value, $base = '1000', $round=2, $sf=3) { - if($base == '1000') + if ($base == '1000') { return format_si($value, $round, $sf); } else { diff --git a/includes/discovery/arp-table.inc.php b/includes/discovery/arp-table.inc.php index 9037bab89..014f0c0d1 100644 --- a/includes/discovery/arp-table.inc.php +++ b/includes/discovery/arp-table.inc.php @@ -21,7 +21,7 @@ foreach (explode("\n", $ipNetToMedia_data) as $data) $m_a = zeropad($m_a);$m_b = zeropad($m_b);$m_c = zeropad($m_c);$m_d = zeropad($m_d);$m_e = zeropad($m_e);$m_f = zeropad($m_f); $md_a = hexdec($m_a);$md_b = hexdec($m_b);$md_c = hexdec($m_c);$md_d = hexdec($m_d);$md_e = hexdec($m_e);$md_f = hexdec($m_f); $mac = "$m_a:$m_b:$m_c:$m_d:$m_e:$m_f"; - + $mac_table[$if][$mac]['ip'] = $ip; $mac_table[$if][$mac]['ciscomac'] = "$m_a$m_b.$m_c$m_d.$m_e$m_f"; $clean_mac = $m_a . $m_b . $m_c . $m_d . $m_e . $m_f; diff --git a/includes/discovery/cisco-vrf.inc.php b/includes/discovery/cisco-vrf.inc.php index 80f05da8d..e21354d3d 100755 --- a/includes/discovery/cisco-vrf.inc.php +++ b/includes/discovery/cisco-vrf.inc.php @@ -7,20 +7,19 @@ if ($config['enable_vrfs']) unset($vrf_count); echo("VRFs : "); - - /* + + /* There are 2 MIBs for VPNs : MPLS-VPN-MIB (oldest) and MPLS-L3VPN-STD-MIB (newest) Unfortunately, there is no simple way to find out which one to use, unless we reference all the possible devices and check what they support. Therefore we start testing the MPLS-L3VPN-STD-MIB that is prefered if available. */ - // Grab all the info first, then use it in the code. // It removes load on the device and makes things much faster $rds = snmp_walk($device, "mplsL3VpnVrfRD", "-Osqn", "MPLS-L3VPN-STD-MIB", NULL); - + if (empty($rds)) { $rds = snmp_walk($device, "mplsVpnVrfRouteDistinguisher", "-Osqn", "MPLS-VPN-MIB", NULL); @@ -34,13 +33,13 @@ if ($config['enable_vrfs']) { $vpnmib = "MPLS-L3VPN-STD-MIB"; $rds = str_replace(".1.3.6.1.2.1.10.166.11.1.2.2.1.4.", "", $rds); - + $descrs_oid = ".1.3.6.1.2.1.10.166.11.1.2.2.1.3"; $ports_oid = ".1.3.6.1.2.1.10.166.11.1.2.1.1.2"; } - - if ($debug) - { + + if ($debug) + { echo("\n[DEBUG]\nUsing $vpnmib\n[/DEBUG]\n"); echo("\n[DEBUG OIDS]\n$rds\n[/DEBUG]\n"); } @@ -48,7 +47,7 @@ if ($config['enable_vrfs']) $descrs = snmp_walk($device, $descrs_oid, "-Osqn", $vpnmib, NULL); $ports = snmp_walk($device, $ports_oid, "-Osqn", $vpnmib, NULL); - + $descrs = trim(str_replace("$descrs_oid.", "", $descrs)); $ports = trim(str_replace("$ports_oid.", "", $ports)); diff --git a/includes/discovery/current/apc.inc.php b/includes/discovery/current/apc.inc.php index d8b395247..1077b007a 100644 --- a/includes/discovery/current/apc.inc.php +++ b/includes/discovery/current/apc.inc.php @@ -40,6 +40,7 @@ if ($device['os'] == "apc") { $descr = "Output"; } + discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current); } } @@ -83,11 +84,11 @@ if ($device['os'] == "apc") if ($index == "1") { $descr = "Bank Total"; } } - $current_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.".$index; #rPDULoadStatusLoad - $bank_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.5.".$index; #rPDULoadStatusBankNumber - $limit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.4.".$index; #rPDULoadBankConfigOverloadThreshold - $lowlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.2.".$index; #rPDULoadBankConfigLowLoadThreshold - $warnlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.3.".$index; #rPDULoadBankConfigNearOverloadThreshold + $current_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.".$index; #rPDULoadStatusLoad + $bank_oid = "1.3.6.1.4.1.318.1.1.12.2.3.1.1.5.".$index; #rPDULoadStatusBankNumber + $limit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.4.".$index; #rPDULoadBankConfigOverloadThreshold + $lowlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.2.".$index; #rPDULoadBankConfigLowLoadThreshold + $warnlimit_oid = "1.3.6.1.4.1.318.1.1.12.2.4.1.1.3.".$index; #rPDULoadBankConfigNearOverloadThreshold $bank = snmp_get($device, $bank_oid, "-Oqv", ""); $current = snmp_get($device, $current_oid, "-Oqv", "") / $precision; @@ -124,35 +125,28 @@ if ($device['os'] == "apc") $index = $split_oid[count($split_oid)-1]; - $voltage_oid = "1.3.6.1.4.1.318.1.1.26.6.3.1.6"; #rPDU2PhaseStatusVoltage + $voltage_oid = "1.3.6.1.4.1.318.1.1.26.6.3.1.6"; #rPDU2PhaseStatusVoltage - $current_oid = "1.3.6.1.4.1.318.1.1.26.9.4.3.1.6.".$index; #rPDU2OutletMeteredStatusCurrent - $limit_oid = "1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.".$index; # rPDU2OutletMeteredConfigOverloadCurrentThreshold - $lowlimit_oid = "1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.".$index; #rPDU2OutletMeteredConfigLowLoadCurrentThreshold - $warnlimit_oid = "1.3.6.1.4.1.318.1.1.26.9.4.1.1.6.".$index; #rPDU2OutletMeteredConfigNearOverloadCurrentThreshold - $name_oid = "1.3.6.1.4.1.318.1.1.26.9.4.3.1.3.".$index; #rPDU2OutletMeteredStatusName + $current_oid = "1.3.6.1.4.1.318.1.1.26.9.4.3.1.6.".$index; #rPDU2OutletMeteredStatusCurrent + $limit_oid = "1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.".$index; #rPDU2OutletMeteredConfigOverloadCurrentThreshold + $lowlimit_oid = "1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.".$index; #rPDU2OutletMeteredConfigLowLoadCurrentThreshold + $warnlimit_oid = "1.3.6.1.4.1.318.1.1.26.9.4.1.1.6.".$index; #rPDU2OutletMeteredConfigNearOverloadCurrentThreshold + $name_oid = "1.3.6.1.4.1.318.1.1.26.9.4.3.1.3.".$index; #rPDU2OutletMeteredStatusName - - $voltage = snmp_get($device, $voltage_oid, "-Oqv", ""); + $voltage = snmp_get($device, $voltage_oid, "-Oqv", ""); $current = snmp_get($device, $current_oid, "-Oqv", "") / $precision; $limit = snmp_get($device, $limit_oid, "-Oqv", "") / $voltage; $lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", "") / $voltage; $warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", "") / $voltage; - $descr = "Outlet " . $index . " - " . snmp_get($device, $name_oid, "-Oqv", ""); + $descr = "Outlet " . $index . " - " . snmp_get($device, $name_oid, "-Oqv", ""); discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current); - } } - } - - - unset($oids); - - + unset($oids); # ATS $oids = snmp_walk($device, "atsConfigPhaseTableIndex", "-OsqnU", "PowerNet-MIB"); @@ -162,16 +156,16 @@ if ($device['os'] == "apc") if ($debug) { print_r($oids); } $oids = trim($oids); if ($oids) echo("APC PowerNet-MIB ATS "); - $current_oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1"; #atsOutputCurrent - $limit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.5.1"; #atsConfigPhaseOverLoadThreshold - $lowlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.3.1"; #atsConfigPhaseLowLoadThreshold - $warnlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.4.1"; #atsConfigPhaseNearOverLoadThreshold + $current_oid = "1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1"; #atsOutputCurrent + $limit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.5.1"; #atsConfigPhaseOverLoadThreshold + $lowlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.3.1"; #atsConfigPhaseLowLoadThreshold + $warnlimit_oid = "1.3.6.1.4.1.318.1.1.8.4.16.1.4.1"; #atsConfigPhaseNearOverLoadThreshold $index = 1; $current = snmp_get($device, $current_oid, "-Oqv", "") / $precision; - $limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! - $lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! - $warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! + $limit = snmp_get($device, $limit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! + $lowlimit = snmp_get($device, $lowlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! + $warnlimit = snmp_get($device, $warnlimit_oid, "-Oqv", ""); # No / $precision here! Nice, APC! $descr = "Output Feed"; discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, NULL, $warnlimit, $limit, $current); diff --git a/includes/discovery/entity-sensor.inc.php b/includes/discovery/entity-sensor.inc.php index 6df920d55..33c022ccc 100644 --- a/includes/discovery/entity-sensor.inc.php +++ b/includes/discovery/entity-sensor.inc.php @@ -31,8 +31,7 @@ $entitysensor['hertz'] = "freq"; $entitysensor['percentRH'] = "humidity"; $entitysensor['rpm'] = "fanspeed"; $entitysensor['celsius'] = "temperature"; -$entitysensor['dBm'] = "dbm"; - +$entitysensor['dBm'] = "dbm"; if (is_array($oids)) { diff --git a/includes/discovery/mempools/junos.inc.php b/includes/discovery/mempools/junos.inc.php index 22afb9eeb..4cdd9e94d 100755 --- a/includes/discovery/mempools/junos.inc.php +++ b/includes/discovery/mempools/junos.inc.php @@ -16,7 +16,7 @@ if ($device['os'] == "junos") { if ($entry['jnxOperatingDRAMSize'] || $entry['jnxOperatingMemory']) { - if (stripos($entry['jnxOperatingDescr'], "sensor") || stripos($entry['jnxOperatingDescr'], "fan")) continue; + if (stripos($entry['jnxOperatingDescr'], "sensor") || stripos($entry['jnxOperatingDescr'], "fan")) continue; if ($debug) { echo($index . " " . $entry['jnxOperatingDescr'] . " -> " . $entry['jnxOperatingBuffer'] . " -> " . $entry['jnxOperatingDRAMSize'] . "\n"); } $usage_oid = ".1.3.6.1.4.1.2636.3.1.13.1.8." . $index; $descr = $entry['jnxOperatingDescr']; diff --git a/includes/discovery/power/ipoman.inc.php b/includes/discovery/power/ipoman.inc.php index d2db11bb8..adfb2608e 100644 --- a/includes/discovery/power/ipoman.inc.php +++ b/includes/discovery/power/ipoman.inc.php @@ -20,7 +20,6 @@ if ($device['os'] == "ipoman") # $oids_in = array(); $oids_out = array(); - # echo("inletStatusWH "); # $oids_in = snmpwalk_cache_multi_oid($device, "inletStatusWH", $oids_in, "IPOMANII-MIB"); echo("outletStatusWH "); @@ -77,7 +76,6 @@ if ($device['os'] == "ipoman") # $oids_in = array(); $oids_out = array(); - # echo("inletStatusWH "); # $oids_in = snmpwalk_cache_multi_oid($device, "inletStatusWH", $oids_in, "IPOMANII-MIB"); echo("outletStatusWH "); diff --git a/includes/discovery/processors/netscaler.inc.php b/includes/discovery/processors/netscaler.inc.php index 761aa69ef..d95a94e12 100644 --- a/includes/discovery/processors/netscaler.inc.php +++ b/includes/discovery/processors/netscaler.inc.php @@ -4,7 +4,6 @@ #NS-ROOT-MIB::nsCPUname."cpu0" = STRING: "cpu0" #NS-ROOT-MIB::nsCPUusage."cpu0" = Gauge32: 0 - if($device['os'] == "netscaler") { echo(" NetScaler "); @@ -18,7 +17,7 @@ if($device['os'] == "netscaler") $nsarray = snmpwalk_cache_multi_oid($device, "nsCPUTable", $nsarray, "NS-ROOT-MIB"); } - foreach($nsarray as $descr => $data) + foreach ($nsarray as $descr => $data) { $current = $data['nsCPUusage']; diff --git a/includes/discovery/q-bridge-mib.inc.php b/includes/discovery/q-bridge-mib.inc.php index 7b7a3e6ce..63c45ba96 100644 --- a/includes/discovery/q-bridge-mib.inc.php +++ b/includes/discovery/q-bridge-mib.inc.php @@ -11,7 +11,7 @@ if ($vlanversion == 'version1') $vlans = snmp_walk($device, "dot1qVlanFdbId", "-Oqn", "Q-BRIDGE-MIB"); $vlan_array = snmpwalk_cache_multi_oid($device, "dot1qVlanStaticName", $vlan_array, "Q-BRIDGE-MIB"); - + foreach (explode("\n", $vlans) as $vlan_oid) { list($oid,$vlan_index) = explode(' ',$vlan_oid); diff --git a/includes/discovery/sensors-netscaler.inc.php b/includes/discovery/sensors-netscaler.inc.php index 90923bf24..c7705b250 100644 --- a/includes/discovery/sensors-netscaler.inc.php +++ b/includes/discovery/sensors-netscaler.inc.php @@ -1,6 +1,5 @@ $data) +foreach ($ns_sensor_array as $descr => $data) { $current = $data['sysHealthCounterValue']; @@ -24,13 +23,12 @@ foreach($ns_sensor_array as $descr => $data) elseif (strpos($descr, "Volt") !== FALSE) { $divisor = 1000; $multiplier = 0; $type = "voltage"; } elseif (strpos($descr, "Vtt") !== FALSE) { $divisor = 1000; $multiplier = 0; $type = "voltage"; } - if($divisor) { $current = $current / $divisor; }; + if ($divisor) { $current = $current / $divisor; }; discover_sensor($valid['sensor'], $type, $device, $oid, $descr, 'netscaler-health', $descr, $divisor, $multiplier, NULL, NULL, NULL, NULL, $current); } - unset($ns_sensor_array); ?> diff --git a/includes/discovery/sensors.inc.php b/includes/discovery/sensors.inc.php index 976cb5fe8..e2cd160b8 100644 --- a/includes/discovery/sensors.inc.php +++ b/includes/discovery/sensors.inc.php @@ -8,7 +8,7 @@ include("includes/discovery/cisco-entity-sensor.inc.php"); include("includes/discovery/entity-sensor.inc.php"); include("includes/discovery/ipmi.inc.php"); -if($device['os'] == "netscaler"){ include("includes/discovery/sensors-netscaler.inc.php"); } +if($device['os'] == "netscaler") { include("includes/discovery/sensors-netscaler.inc.php"); } include("includes/discovery/temperatures.inc.php"); include("includes/discovery/humidity.inc.php"); diff --git a/includes/discovery/temperatures/powerconnect.inc.php b/includes/discovery/temperatures/powerconnect.inc.php index 21c07f35c..18df1f5e7 100644 --- a/includes/discovery/temperatures/powerconnect.inc.php +++ b/includes/discovery/temperatures/powerconnect.inc.php @@ -4,7 +4,7 @@ if ($device['os'] == "powerconnect") { $temps = snmp_walk($device, "boxServicesTempSensorTemperature", "-OsqnU", "FASTPATH-BOXSERVICES-PRIVATE-MIB"); if ($debug) { echo($temps."\n"); } - + $index = 0; foreach (explode("\n",$temps) as $oids) { diff --git a/includes/discovery/vlans.inc.php b/includes/discovery/vlans.inc.php index 8eb0f6eb0..615a8dd12 100644 --- a/includes/discovery/vlans.inc.php +++ b/includes/discovery/vlans.inc.php @@ -7,17 +7,17 @@ $this_vlans = array(); include("includes/discovery/q-bridge-mib.inc.php"); include("includes/discovery/cisco-vlans.inc.php"); -foreach($this_vlans as $vlan) +foreach ($this_vlans as $vlan) { /// Pull Tables for this VLAN #/usr/bin/snmpbulkwalk -v2c -c kglk5g3l454@988 -OQUs -m BRIDGE-MIB -M /opt/observium/mibs/ udp:sw2.ahf:161 dot1dStpPortEntry #/usr/bin/snmpbulkwalk -v2c -c kglk5g3l454@988 -OQUs -m BRIDGE-MIB -M /opt/observium/mibs/ udp:sw2.ahf:161 dot1dBasePortEntry - if(is_numeric($vlan) && ($vlan <1002 || $vlan > 1105)) /// Ignore reserved VLAN IDs + if (is_numeric($vlan) && ($vlan <1002 || $vlan > 1105)) /// Ignore reserved VLAN IDs { - if($device['os_group'] == "cisco" || $device['os'] == "ios") /// This shit only seems to work on IOS + if ($device['os_group'] == "cisco" || $device['os'] == "ios") /// This shit only seems to work on IOS { $vlan_device = array_merge($device, array('community' => $device['community']."@".$vlan)); $vlan_data = snmpwalk_cache_oid($vlan_device, "dot1dStpPortEntry", array(), "BRIDGE-MIB:Q-BRIDGE-MIB"); @@ -32,7 +32,7 @@ foreach($this_vlans as $vlan) str_pad("Priority", 10).str_pad("State", 15).str_pad("Cost", 10)."\n"); } - foreach($vlan_data as $vlan_port_id => $vlan_port) + foreach ($vlan_data as $vlan_port_id => $vlan_port) { $port = get_port_by_index_cache($device, $vlan_port['dot1dBasePortIfIndex']); echo(str_pad($vlan_port_id, 10).str_pad($vlan_port['dot1dBasePortIfIndex'], 10). @@ -50,7 +50,7 @@ foreach($this_vlans as $vlan) $from_db = dbFetchRow("SELECT * FROM `ports_vlans` WHERE device_id = ? AND interface_id = ? AND `vlan` = ?", array($device['device_id'], $port['interface_id'], $vlan)); - if($from_db['port_vlan_id']) + if ($from_db['port_vlan_id']) { dbUpdate($db_a, 'ports_vlans', "`port_vlan_id` = ?", $from_db['port_vlan_id']); echo("Updated"); @@ -68,7 +68,6 @@ foreach($this_vlans as $vlan) } - $device_vlans = mysql_query("SELECT * FROM `vlans` WHERE `device_id` = '" . $device['device_id'] . "'"); while ($dev_vlan = mysql_fetch_assoc($device_vlans)) { @@ -87,5 +86,4 @@ while ($dev_vlan = mysql_fetch_assoc($device_vlans)) unset($this_vlans); - ?> diff --git a/includes/discovery/voltages/apc.inc.php b/includes/discovery/voltages/apc.inc.php index aa2b4fbd7..051ae4d96 100644 --- a/includes/discovery/voltages/apc.inc.php +++ b/includes/discovery/voltages/apc.inc.php @@ -87,7 +87,6 @@ if ($device['os'] == "apc") discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } - $oids = snmp_walk($device, "1.3.6.1.4.1.318.1.1.26.6.3.1.6", "-OsqnU", "PowerNet-MIB"); if ($debug) { echo($oids."\n"); } if ($oids) @@ -102,9 +101,6 @@ if ($device['os'] == "apc") discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', NULL, NULL, NULL, NULL, $current); } - - - } ?> diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index faf6dc7d2..8353d6897 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -1,6 +1,5 @@ message(SMARTIRC_TYPE_CHANNEL, $data->channel, "Error: Bad or Missing hostname, use .listdevices to show all devices."); } else { @@ -132,7 +131,7 @@ if (!$device) { } } ### -# PORT Function +# PORT Function ### function port_info(&$irc, &$data) { diff --git a/poll-billing.php b/poll-billing.php index 2ad270cf1..3f1ac1a68 100755 --- a/poll-billing.php +++ b/poll-billing.php @@ -17,7 +17,7 @@ foreach (dbFetchRows("SELECT * FROM `bills`") as $bill_data) # replace old bill_gb with bill_quota (we're now storing bytes, not gigabytes) - if($bill_data['bill_type'] == "quota" && !is_numeric($bill_data['bill_quota'])) + if ($bill_data['bill_type'] == "quota" && !is_numeric($bill_data['bill_quota'])) { $bill_data['bill_quota'] = $bill_data['bill_gb'] * $config['billing']['base'] * $config['billing']['base']; dbUpdate(array('bill_quota' => $bill_data['bill_quota']), 'bills', '`bill_id` = ?', array($bill_data['bill_id']));