diff --git a/includes/discovery/cisco-vrf.inc.php b/includes/discovery/cisco-vrf.inc.php index 486e70fe94..293e9c3bb1 100755 --- a/includes/discovery/cisco-vrf.inc.php +++ b/includes/discovery/cisco-vrf.inc.php @@ -96,7 +96,7 @@ if ($config['enable_vrfs']) } else { - dbInsert(array('`vrf_oid`' => $vrf_oid, '`vrf_name`' => $vrf_name, '`mplsVpnVrfRouteDistinguisher`' => $vrf_rd,'`mplsVpnVrfDescription`' => $descr_table[$vrf_oid], '`device_id`' => $device['device_id']), 'vrfs'); + dbInsert(array('vrf_oid' => $vrf_oid, 'vrf_name' => $vrf_name, 'mplsVpnVrfRouteDistinguisher' => $vrf_rd,'mplsVpnVrfDescription' => $descr_table[$vrf_oid], 'device_id' => $device['device_id']), 'vrfs'); } $vrf_id = dbFetchCell("SELECT vrf_id FROM vrfs WHERE device_id = ? AND `vrf_oid`=?",array($device['device_id'],$vrf_oid)); diff --git a/includes/discovery/entity-physical.inc.php b/includes/discovery/entity-physical.inc.php index cd634b0796..90486e9cff 100755 --- a/includes/discovery/entity-physical.inc.php +++ b/includes/discovery/entity-physical.inc.php @@ -50,7 +50,7 @@ dbUpdate(array('entPhysicalIndex' => $entPhysicalIndex, 'entPhysicalDescr' => $entPhysicalDescr, 'entPhysicalClass' => $entPhysicalClass, 'entPhysicalName' => $entPhysicalName, 'entPhysicalModelName' => $entPhysicalModelName, 'entPhysicalSerialNum' => $entPhysicalSerialNum, 'entPhysicalContainedIn' => $entPhysicalContainedIn, 'entPhysicalMfgName' => $entPhysicalMfgName, 'entPhysicalParentRelPos' => $entPhysicalParentRelPos, 'entPhysicalVendorType' => $entPhysicalVendorType, 'entPhysicalHardwareRev' => $entPhysicalHardwareRev, 'entPhysicalFirmwareRev' => $entPhysicalFirmwareRev, 'entPhysicalSoftwareRev' => $entPhysicalSoftwareRev, 'entPhysicalIsFRU' => $entPhysicalIsFRU, 'entPhysicalAlias' => $entPhysicalAlias, 'entPhysicalAssetID' => $entPhysicalAssetID), 'entPhysical', 'device_id=? AND entPhysicalIndex=?',array($device['device_id'],$entPhysicalIndex)); echo("."); } else { - dbInsert(array('`device_id`' => $device['device_id'], '`entPhysicalIndex`' => $entPhysicalIndex, '`entPhysicalDescr`' => $entPhysicalDescr,'`entPhysicalClass`' => $entPhysicalClass, '`entPhysicalName`' => $entPhysicalName, '`entPhysicalModelName`' => $entPhysicalModelName, '`entPhysicalSerialNum`' => $entPhysicalSerialNum, '`entPhysicalContainedIn`' => $entPhysicalContainedIn, '`entPhysicalMfgName`' => $entPhysicalMfgName, '`entPhysicalParentRelPos`' => $entPhysicalParentRelPos, '`entPhysicalVendorType`' => $entPhysicalVendorType, '`entPhysicalHardwareRev`' => $entPhysicalHardwareRev, '`entPhysicalFirmwareRev`' => $entPhysicalFirmwareRev, '`entPhysicalSoftwareRev`' => $entPhysicalSoftwareRev, '`entPhysicalIsFRU`' => $entPhysicalIsFRU, '`entPhysicalAlias`' => $entPhysicalAlias, '`entPhysicalAssetID`' => $entPhysicalAssetID, '`ifIndex`' => $ifIndex), '`entPhysical`'); + dbInsert(array('device_id' => $device['device_id'], 'entPhysicalIndex' => $entPhysicalIndex, 'entPhysicalDescr' => $entPhysicalDescr,'entPhysicalClass' => $entPhysicalClass, 'entPhysicalName' => $entPhysicalName, 'entPhysicalModelName' => $entPhysicalModelName, 'entPhysicalSerialNum' => $entPhysicalSerialNum, 'entPhysicalContainedIn' => $entPhysicalContainedIn, 'entPhysicalMfgName' => $entPhysicalMfgName, 'entPhysicalParentRelPos' => $entPhysicalParentRelPos, 'entPhysicalVendorType' => $entPhysicalVendorType, 'entPhysicalHardwareRev' => $entPhysicalHardwareRev, 'entPhysicalFirmwareRev' => $entPhysicalFirmwareRev, 'entPhysicalSoftwareRev' => $entPhysicalSoftwareRev, 'entPhysicalIsFRU' => $entPhysicalIsFRU, 'entPhysicalAlias' => $entPhysicalAlias, 'entPhysicalAssetID' => $entPhysicalAssetID, 'ifIndex' => $ifIndex), 'entPhysical'); echo("+"); } @@ -66,7 +66,7 @@ $id = $test['entPhysicalIndex']; if (!$valid[$id]) { echo("-"); - dbDelete('`entPhysical`', '`entPhysical_id` = ?', array($test['entPhysical_id'])); + dbDelete('entPhysical', 'entPhysical_id = ?', array($test['entPhysical_id'])); } } diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index 708b114d26..5083520f03 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -423,14 +423,14 @@ function discover_processor(&$valid, $device, $oid, $index, $type, $descr, $prec $descr = trim(str_replace("\"", "", $descr)); if (dbFetchCell("SELECT COUNT(processor_id) FROM `processors` WHERE `processor_index` = ? AND `device_id` = ? AND `processor_type` = ?",array($index,$device['device_id'], $type)) == '0') { - $inserted = dbInsert(array('`entPhysicalIndex`' => $entPhysicalIndex, '`hrDeviceIndex`' => $hrDeviceIndex, '`device_id`' => $device['device_id'],'`processor_descr`' => $descr, '`processor_index`' => $index, '`processor_oid`' => $oid, '`processor_usage`' => $current, '`processor_type`' => $type, '`processor_precision`' => $precision), 'processors'); + $inserted = dbInsert(array('entPhysicalIndex' => $entPhysicalIndex, 'hrDeviceIndex' => $hrDeviceIndex, 'device_id' => $device['device_id'],'processor_descr' => $descr, 'processor_index' => $index, 'processor_oid' => $oid, 'processor_usage' => $current, 'processor_type' => $type, 'processor_precision' => $precision), 'processors'); echo("+"); log_event("Processor added: type ".mres($type)." index ".mres($index)." descr ". mres($descr), $device, 'processor', $inserted); } else { echo("."); - dbUpdate(array('`processor_descr`' => $descr, '`processor_oid`' => $oid, '`processor_precision`' => $precision), 'processors', '`device_id`=? AND `processor_index`=? AND `processor_type`=?',array($device['device_id'],$index,$type)); + dbUpdate(array('processor_descr' => $descr, 'processor_oid' => $oid, 'processor_precision' => $precision), 'processors', '`device_id`=? AND `processor_index`=? AND `processor_type`=?',array($device['device_id'],$index,$type)); if ($debug) { print $query . "\n"; } } $valid[$type][$index] = 1; @@ -446,14 +446,14 @@ function discover_mempool(&$valid, $device, $index, $type, $descr, $precision = { if (dbFetchCell("SELECT COUNT(mempool_id) FROM `mempools` WHERE `mempool_index` = ? AND `device_id` = ? AND `mempool_type` = ?",array($index,$device['device_id'], $type)) == '0') { - $inserted = dbInsert(array('`entPhysicalIndex`' => $entPhysicalIndex, '`hrDeviceIndex`' => $hrDeviceIndex, '`device_id`' => $device['device_id'],'`mempool_descr`' => $descr, '`mempool_index`' => $index, '`mempool_type`' => $type, '`mempool_precision`' => $precision), 'mempools'); + $inserted = dbInsert(array('entPhysicalIndex' => $entPhysicalIndex, 'hrDeviceIndex' => $hrDeviceIndex, 'device_id' => $device['device_id'],'mempool_descr' => $descr, 'mempool_index' => $index, 'mempool_type' => $type, 'mempool_precision' => $precision), 'mempools'); echo("+"); log_event("Memory pool added: type ".mres($type)." index ".mres($index)." descr ". mres($descr), $device, 'mempool', $inserted); } else { echo("."); - dbUpdate(array('`mempool_descr`' => $descr, '`entPhysicalIndex`' => $entPhysicalIndex, '`hrDeviceIndex`' => $hrDeviceIndex), '`mempools`', 'device_id=? AND mempool_index=? AND mempool_type',array($device['device_id'],$index,$type)); + dbUpdate(array('mempool_descr' => $descr, 'entPhysicalIndex' => $entPhysicalIndex, 'hrDeviceIndex' => $hrDeviceIndex), 'mempools', 'device_id=? AND mempool_index=? AND mempool_type',array($device['device_id'],$index,$type)); if ($debug) { print $query . "\n"; } } $valid[$type][$index] = 1; @@ -469,7 +469,7 @@ function discover_toner(&$valid, $device, $oid, $index, $type, $descr, $capacity } if (dbFetchCell("SELECT COUNT(toner_id) FROM `toner` WHERE device_id = ? AND toner_type = ? AND `toner_index` = ? AND `toner_capacity_oid` =?",array($device['device_id'], $type,$index,$capacity_oid)) == '0') { - $inserted = dbInsert(array('`device_id`' => $device['device_id'], '`toner_oid`' => $oid, '`toner_capacity_oid`' => $capacity_oid, '`toner_index`' => $index, '`toner_type`' => $type, '`toner_descr`' => $descr, '`toner_capacity`' => $capacity, '`toner_current`' => $current), 'toner'); + $inserted = dbInsert(array('device_id' => $device['device_id'], 'toner_oid' => $oid, 'toner_capacity_oid' => $capacity_oid, 'toner_index' => $index, 'toner_type' => $type, 'toner_descr' => $descr, 'toner_capacity' => $capacity, 'toner_current' => $current), 'toner'); echo("+"); log_event("Toner added: type ".mres($type)." index ".mres($index)." descr ". mres($descr), $device, 'toner', $inserted); } @@ -482,7 +482,7 @@ function discover_toner(&$valid, $device, $oid, $index, $type, $descr, $capacity } else { - dbUpdate(array('toner_descr' => $descr, 'toner_oid' => $oid, '`toner_capacity_oid`' => $capacity_oid, '`toner_capacity`' => $capacity), 'toner', 'device_id=? AND toner_type=? AND `toner_index`=?',array($device['device_id'],$type,$index)); + dbUpdate(array('toner_descr' => $descr, 'toner_oid' => $oid, 'toner_capacity_oid' => $capacity_oid, 'toner_capacity' => $capacity), 'toner', 'device_id=? AND toner_type=? AND `toner_index`=?',array($device['device_id'],$type,$index)); echo("U"); } } @@ -507,14 +507,14 @@ function discover_process_ipv6(&$valid, $ifIndex,$ipv6_address,$ipv6_prefixlen,$ $port_id = dbFetchCell("SELECT port_id FROM `ports` WHERE device_id = ? AND ifIndex = ?",array($device['device_id'], $ifIndex)); if (dbFetchCell("SELECT COUNT(*) FROM `ipv6_networks` WHERE `ipv6_network` = ?",array($ipv6_network)) < '1') { - dbInsert(array('`ipv6_network`' => $ipv6_network), 'ipv6_networks'); + dbInsert(array('ipv6_network' => $ipv6_network), 'ipv6_networks'); echo("N"); } // Below looks like a duplicate of the above FIXME if (dbFetchCell("SELECT COUNT(*) FROM `ipv6_networks` WHERE `ipv6_network` = ?",array($ipv6_network)) < '1') { - dbInsert(array('`ipv6_network`' => $ipv6_network), 'ipv6_networks'); + dbInsert(array('ipv6_network' => $ipv6_network), 'ipv6_networks'); echo("N"); } @@ -522,7 +522,7 @@ function discover_process_ipv6(&$valid, $ifIndex,$ipv6_address,$ipv6_prefixlen,$ if (dbFetchCell("SELECT COUNT(*) FROM `ipv6_addresses WHERE `ipv6_address` = ? AND `ipv6_prefixlen` = ? AND `port_id` = ?",array($ipv6_address, $ipv6_prefixlen, $port_id)) == '0') { - dbInsert(array('`ipv6_address`' => $ipv6_address, '`ipv6_compressed`' => $ipv6_compressed, '`ipv6_prefixlen`' => $ipv6_prefixlen,'`ipv6_origin`' => $ipv6_origin, '`ipv6_network_id`' => $ipv6_network_id, '`port_id`' => $port_id), 'ipv6_addresses'); + dbInsert(array('ipv6_address' => $ipv6_address, 'ipv6_compressed' => $ipv6_compressed, 'ipv6_prefixlen' => $ipv6_prefixlen,'ipv6_origin' => $ipv6_origin, 'ipv6_network_id' => $ipv6_network_id, 'port_id' => $port_id), 'ipv6_addresses'); echo("+"); } else diff --git a/includes/discovery/hr-device.inc.php b/includes/discovery/hr-device.inc.php index 9c53c72376..b5e4d8a6a9 100755 --- a/includes/discovery/hr-device.inc.php +++ b/includes/discovery/hr-device.inc.php @@ -18,20 +18,20 @@ if (is_array($hrDevices)) { if (dbFetchCell("SELECT COUNT(*) FROM `hrDevice` WHERE device_id = ? AND hrDeviceIndex = ?",array($device['device_id'], $hrDevice['hrDeviceIndex']))) { - $update_array = array('`hrDeviceType`' => mres($hrDevice['hrDeviceType']), - '`hrDeviceDescr`' => mres($hrDevice['hrDeviceDescr']), - '`hrDeviceStatus`' => mres($hrDevice['hrDeviceStatus']), - '`hrDeviceErrors`' => mres($hrDevice['hrDeviceErrors'])); + $update_array = array('hrDeviceType' => mres($hrDevice['hrDeviceType']), + 'hrDeviceDescr' => mres($hrDevice['hrDeviceDescr']), + 'hrDeviceStatus' => mres($hrDevice['hrDeviceStatus']), + 'hrDeviceErrors' => mres($hrDevice['hrDeviceErrors'])); if ($hrDevice['hrDeviceType'] == "hrDeviceProcessor") { $update_array['hrProcessorLoad'] = mres($hrDevice['hrProcessorLoad']); } - dbUpdate($update_array, '`hrDevice`', 'device_id=? AND hrDeviceIndex=?',array($device['device_id'],$hrDevice['hrDeviceIndex'])); + dbUpdate($update_array, 'hrDevice', 'device_id=? AND hrDeviceIndex=?',array($device['device_id'],$hrDevice['hrDeviceIndex'])); echo("."); } else { - $inserted_rows = dbInsert(array('`hrDeviceIndex`' => mres($hrDevice['hrDeviceIndex']), '`device_id`' => mres($device['device_id']), '`hrDeviceType`' => mres($hrDevice['hrDeviceType']),'`hrDeviceDescr`' => mres($hrDevice['hrDeviceDescr']), '`hrDeviceStatus`' => mres($hrDevice['hrDeviceStatus']), '`hrDeviceErrors`' => mres($hrDevice['hrDeviceErrors'])), 'hrDevice'); + $inserted_rows = dbInsert(array('hrDeviceIndex' => mres($hrDevice['hrDeviceIndex']), 'device_id' => mres($device['device_id']), 'hrDeviceType' => mres($hrDevice['hrDeviceType']),'hrDeviceDescr' => mres($hrDevice['hrDeviceDescr']), 'hrDeviceStatus' => mres($hrDevice['hrDeviceStatus']), 'hrDeviceErrors' => mres($hrDevice['hrDeviceErrors'])), 'hrDevice'); echo("+"); if ($debug) { print_r($hrDevice); echo("$inserted_rows row inserted"); } } diff --git a/includes/discovery/ipv4-addresses.inc.php b/includes/discovery/ipv4-addresses.inc.php index 1516a6425e..e5803bc5d4 100755 --- a/includes/discovery/ipv4-addresses.inc.php +++ b/includes/discovery/ipv4-addresses.inc.php @@ -19,7 +19,7 @@ foreach (explode("\n", $oids) as $data) if (dbFetchCell("SELECT COUNT(*) FROM `ipv4_networks` WHERE `ipv4_network` = ?",array($network)) < '1') { - dbInsert(array('`ipv4_network`' => $network), 'ipv4_networks'); + dbInsert(array('ipv4_network' => $network), 'ipv4_networks'); #echo("Create Subnet $network\n"); echo("S"); } @@ -28,7 +28,7 @@ foreach (explode("\n", $oids) as $data) if (dbFetchCell("SELECT COUNT(*) FROM `ipv4_addresses` WHERE `ipv4_address` = ? AND `ipv4_prefixlen` = ? AND `port_id` = ?",array($oid,$cidr,$port_id)) == '0') { - dbInsert(array('`ipv4_address`' => $oid, '`ipv4_prefixlen`' => $cidr, '`ipv4_network_id`' => $ipv4_network_id,'`port_id`' => $port_id), 'ipv4_addresses'); + dbInsert(array('ipv4_address' => $oid, 'ipv4_prefixlen' => $cidr, 'ipv4_network_id' => $ipv4_network_id,'port_id' => $port_id), 'ipv4_addresses'); #echo("Added $oid/$cidr to $port_id ( $hostname $ifIndex )\n $i_query\n"); echo("+"); } else { echo("."); } @@ -49,7 +49,7 @@ foreach (dbFetchRows($sql) as $row) $query = dbDelete('ipv4_addresses', '`ipv4_address_id` = ?', array($row['ipv4_address_id'])); if (!dbFetchCell("SELECT COUNT(*) FROM `ipv4_addresses` WHERE `ipv4_network_id` = ?",array($row['ipv4_network_id']))) { - $query = dbDelete('`ipv4_networks`', '`ipv4_network_id` = ?', array($row['ipv4_network_id'])); + $query = dbDelete('ipv4_networks', '`ipv4_network_id` = ?', array($row['ipv4_network_id'])); } } } diff --git a/includes/discovery/libvirt-vminfo.inc.php b/includes/discovery/libvirt-vminfo.inc.php index 0898227acd..d1b2f7ebbb 100755 --- a/includes/discovery/libvirt-vminfo.inc.php +++ b/includes/discovery/libvirt-vminfo.inc.php @@ -79,7 +79,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == "linux" ) $result = dbFetchRow("SELECT * FROM `vminfo` WHERE `device_id` = ? AND `vmwVmVMID` = ? AND `vm_type` = 'libvirt'",array($device['device_id'],$dom_id)); if (count($result['device_id']) == 0) { - $inserted_id = dbInsert(array('`device_id`' => $device['device_id'], '`vm_type`' => 'libvirt', '`vmwVmVMID`' => $dom_id,'`vmwVmDisplayName`' => mres($vmwVmDisplayName), '`vmwVmGuestOS`' => mres($vmwVmGuestOS), '`vmwVmMemSize`' => mres($vmwVmMemSize), '`vmwVmCpus`' => mres($vmwVmCpus), '`vmwVmState`' => mres($vmwVmState)), 'vminfo'); + $inserted_id = dbInsert(array('device_id' => $device['device_id'], 'vm_type' => 'libvirt', 'vmwVmVMID' => $dom_id,'vmwVmDisplayName' => mres($vmwVmDisplayName), 'vmwVmGuestOS' => mres($vmwVmGuestOS), 'vmwVmMemSize' => mres($vmwVmMemSize), 'vmwVmCpus' => mres($vmwVmCpus), 'vmwVmState' => mres($vmwVmState)), 'vminfo'); echo("+"); log_event("Virtual Machine added: $vmwVmDisplayName ($vmwVmMemSize MB)", $device, 'vm', $inserted_id); } else { @@ -89,7 +89,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == "linux" ) || $result['vmwVmGuestOS'] != $vmwVmGuestOS || $result['vmwVmMemSize'] != $vmwVmMemSize) { - dbUpdate(array('vmwVmState' => mres($vmwVmState), '`vmwVmGuestOS' => mres($vmwVmGuestOS), '`vmwVmDisplayName`' => mres($vmwVmDisplayName), '`vmwVmMemSize`' => mres($vmwVmMemSize), '`vmwVmCpus`' => mres($vmwVmCpus)), 'vminfo', "device_id=? AND vm_type='libvirt' AND vmwVmVMID=?",array($device['device_id'],$dom_id)); + dbUpdate(array('vmwVmState' => mres($vmwVmState), 'vmwVmGuestOS' => mres($vmwVmGuestOS), 'vmwVmDisplayName' => mres($vmwVmDisplayName), 'vmwVmMemSize' => mres($vmwVmMemSize), 'vmwVmCpus' => mres($vmwVmCpus)), 'vminfo', "device_id=? AND vm_type='libvirt' AND vmwVmVMID=?",array($device['device_id'],$dom_id)); echo("U"); // FIXME eventlog } diff --git a/includes/discovery/os.inc.php b/includes/discovery/os.inc.php index 69e32ab245..ae8321893f 100644 --- a/includes/discovery/os.inc.php +++ b/includes/discovery/os.inc.php @@ -7,7 +7,7 @@ $os = getHostOS($device); if ($os != $device['os']) { - $sql = dbUpdate(array('`os`' => $os), 'devices', 'device_id=?',array($device['device_id'])); + $sql = dbUpdate(array('os' => $os), 'devices', 'device_id=?',array($device['device_id'])); echo("Changed OS! : $os\n"); log_event("Device OS changed ".$device['os']." => $os", $device, 'system'); $device['os'] = $os; diff --git a/includes/discovery/ports-stack.inc.php b/includes/discovery/ports-stack.inc.php index eebdaade96..bc23fee796 100644 --- a/includes/discovery/ports-stack.inc.php +++ b/includes/discovery/ports-stack.inc.php @@ -22,13 +22,13 @@ foreach ($stack_poll_array as $port_id_high => $entry_high) { echo("."); } else { - dbUpdate(array('`ifStackStatus`' => $ifStackStatus), 'ports_stack', 'device_id=? AND port_id_high=? AND `port_id_low`=?',array($device['device_id'],$port_id_high,$port_id_low)); + dbUpdate(array('ifStackStatus' => $ifStackStatus), 'ports_stack', 'device_id=? AND port_id_high=? AND `port_id_low`=?',array($device['device_id'],$port_id_high,$port_id_low)); echo("U"); if ($debug) { echo(mysql_error()); } } unset($stack_db_array[$port_id_high][$port_id_low]); } else { - dbInsert(array('`device_id`' => $device['device_id'], '`port_id_high`' => $port_id_high, '`port_id_low`' => $port_id_low,'`ifStackStatus`' => $ifStackStatus), 'ports_stack'); + dbInsert(array('device_id' => $device['device_id'], 'port_id_high' => $port_id_high, 'port_id_low' => $port_id_low,'ifStackStatus' => $ifStackStatus), 'ports_stack'); echo("+"); if ($debug) { echo(mysql_error()); } } diff --git a/includes/discovery/ucd-diskio.inc.php b/includes/discovery/ucd-diskio.inc.php index 6600a86b0d..842df3b040 100644 --- a/includes/discovery/ucd-diskio.inc.php +++ b/includes/discovery/ucd-diskio.inc.php @@ -15,7 +15,7 @@ if (is_array($diskio_array)) if (dbFetchCell("SELECT COUNT(*) FROM `ucd_diskio` WHERE `device_id` = ? AND `diskio_index` = ?",array($device['device_id'], $index)) == "0") { - $inserted = dbInsert(array('`device_id`' => $device['device_id'], '`diskio_index`' => $index, '`diskio_descr`' => $entry['diskIODevice']), 'ucd_diskio'); + $inserted = dbInsert(array('device_id' => $device['device_id'], 'diskio_index' => $index, 'diskio_descr' => $entry['diskIODevice']), 'ucd_diskio'); echo("+"); if ($debug) { echo($sql . " - $inserted inserted "); } } diff --git a/includes/discovery/vmware-vminfo.inc.php b/includes/discovery/vmware-vminfo.inc.php index f81fc01e23..64b202d833 100755 --- a/includes/discovery/vmware-vminfo.inc.php +++ b/includes/discovery/vmware-vminfo.inc.php @@ -74,7 +74,7 @@ if (($device['os'] == "vmware") || ($device['os'] == "linux")) if (dbFetchCell("SELECT COUNT(id) FROM `vminfo` WHERE `device_id` = ? AND `vmwVmVMID` = ? AND vm_type='vmware'",array($device['device_id'], $oid)) == 0) { - dbInsert(array('`device_id`' => $device['device_id'], '`vm_type`' => 'vmware', '`vmwVmVMID`' => $oid,'`vmwVmDisplayName`' => mres($vmwVmDisplayName), '`vmwVmGuestOS`' => mres($vmwVmGuestOS), '`vmwVmMemSize`' => mres($vmwVmMemSize), '`vmwVmCpus`' => mres($vmwVmCpus), '`vmwVmState`' => mres($vmwVmState)), 'vminfo'); + dbInsert(array('device_id' => $device['device_id'], 'vm_type' => 'vmware', 'vmwVmVMID' => $oid,'vmwVmDisplayName' => mres($vmwVmDisplayName), 'vmwVmGuestOS' => mres($vmwVmGuestOS), 'vmwVmMemSize' => mres($vmwVmMemSize), 'vmwVmCpus' => mres($vmwVmCpus), 'vmwVmState' => mres($vmwVmState)), 'vminfo'); echo("+"); // FIXME eventlog } else { diff --git a/includes/snmptrap/linkDown.inc.php b/includes/snmptrap/linkDown.inc.php index 3b7e6a68e7..ae00adcbb8 100644 --- a/includes/snmptrap/linkDown.inc.php +++ b/includes/snmptrap/linkDown.inc.php @@ -16,7 +16,7 @@ log_event("SNMP Trap: linkDown " . $interface['ifDescr'], $device, "interface", if ($ifOperStatus != $interface['ifOperStatus']) { log_event("Interface went Down : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['port_id']); - dbUpdate(array('`ifOperStatus`' => 'down'), 'ports', 'port_id=?',array($interface['port_id'])); + dbUpdate(array('ifOperStatus' => 'down'), 'ports', 'port_id=?',array($interface['port_id'])); } ?> diff --git a/includes/snmptrap/linkUp.inc.php b/includes/snmptrap/linkUp.inc.php index bb60b065db..999b28e1d1 100644 --- a/includes/snmptrap/linkUp.inc.php +++ b/includes/snmptrap/linkUp.inc.php @@ -12,13 +12,13 @@ log_event("SNMP Trap: linkUp $ifAdminStatus/$ifOperStatus " . $interface['ifDesc if ($ifAdminStatus != $interface['ifAdminStatus']) { log_event("Interface Enabled : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['port_id']); - dbUpdate(array('`ifAdminStatus`' => 'up'), 'ports', 'port_id=?',array($interface['port_id'])); + dbUpdate(array('ifAdminStatus' => 'up'), 'ports', 'port_id=?',array($interface['port_id'])); } if ($ifOperStatus != $interface['ifOperStatus']) { log_event("Interface went Up : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['port_id']); - dbUpdate(array('`ifOperStatus`' => 'up'), 'ports', 'port_id=?',array($interface['port_id'])); + dbUpdate(array('ifOperStatus' => 'up'), 'ports', 'port_id=?',array($interface['port_id'])); } ?>