Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Mar 29, 2024 6:00 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: Optimizing the database
PostPosted: Tue Nov 27, 2007 1:14 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
I'm trying to develop a procedure for optimizing the OpenAudit database. So far I've come up with this. It can be executed via the command line "php -f optimize.php." The include path must point to the current include_config.php. Maybe something like this could be incorporated into the backup page. Does anyone have any tips on optimizing the database? This script has not been thoroughly tested. Use at your own risk.

optimize.php

[code]<?php
include "C:/Inetpub/wwwroot/include_config.php";
$db = mysql_connect($mysql_server,$mysql_user,$mysql_password) or die('Could not connect: ' . mysql_error());
mysql_select_db($mysql_database,$db);
$alltables = mysql_query("SHOW TABLES");
while ($table = mysql_fetch_assoc($alltables))
{
foreach ($table as $db => $tablename)
{
$sql = "OPTIMIZE TABLE " . $tablename;
$result = mysql_query($sql) or die(mysql_error());
}
foreach ($table as $db => $tablename)
{
$sql = "REPAIR TABLE " . $tablename;
$result = mysql_query($sql) or die(mysql_error());
}
}
?>[/code]


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 28, 2007 7:04 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
This is my latest version.

optimize.php

[code]<?php
include "C:/Inetpub/wwwroot/include_config.php";
$db = mysql_connect($mysql_server,$mysql_user,$mysql_password) or die('Could not connect: ' . mysql_error());
mysql_select_db($mysql_database,$db);
$alltables = mysql_query("SHOW TABLES");
while ($table = mysql_fetch_assoc($alltables))
{
foreach ($table as $db => $tablename)
{
$sql = "CHECK TABLE " . $tablename . " EXTENDED";
//$sql = "CHECK TABLE " . $tablename . " CHANGED";
$result = mysql_query($sql) or die(mysql_error());
}
foreach ($table as $db => $tablename)
{
$sql = "ANALYZE NO_WRITE_TO_BINLOG TABLE " . $tablename;
$result = mysql_query($sql) or die(mysql_error());
}
foreach ($table as $db => $tablename)
{
$sql = "OPTIMIZE NO_WRITE_TO_BINLOG TABLE " . $tablename;
$result = mysql_query($sql) or die(mysql_error());
}
// foreach ($table as $db => $tablename)
// {
// $sql = "REPAIR TABLE " . $tablename;
// $result = mysql_query($sql) or die(mysql_error());
// }
}
?>[/code]


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 28, 2007 7:47 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
How much improvement does it make?

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 29, 2007 1:11 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
Not much that I can tell. Most of what it does is compress the database when you've deleted records.

Several sources on the Internet indicate this is good practice:
http://www.totallyphp.co.uk/scripts/opt ... tabase.htm
http://www.jovianskye.com/archive/mysql ... s-with-php

I did finally solve the slow performance problem. What really made the difference was removing rows with duplicate MAC addresses from the network_card table. I had approximately 17000 records in the network_card table. After running the vbscript below I had only about 2000 records. This script removes duplicate MAC addresses from the network_card table leaving only the one with the latest timestamp.

Requires the MySQL ODBC driver from http://dev.mysql.com/downloads/connector/odbc/3.51.html.

[code]set myconn = createobject("adodb.connection")
connection = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=openaudit.domain.com;PORT=3306;DATABASE=openaudit; USER=username;PASSWORD=password;OPTION=3;"
myconn.open (connection)
set result = createobject("adodb.recordset")
sql = "select net_uuid, net_mac_address, count(net_mac_address) as NumOccurances FROM network_card Group by net_mac_address having ( count(net_mac_address) > 1);"
set result = myconn.execute(sql)
if not result.EOF then
while not result.EOF
wscript.echo "Data for UUID:" & result("net_uuid") & " Mac:" & result("net_mac_address") & " #:" & result("NumOccurances")
'wscript.echo result("net_mac_address") ' & ";" & result("system_model")
sql2 = "select * FROM network_card WHERE net_mac_address = " & "'" & result("net_mac_address") & "'" & " ORDER BY net_timestamp DESC;"
set result2 = myconn.execute(sql2)
for i=1 to Cint(result("NumOccurances"))
wscript.echo result2("net_uuid") & ";" & result2("net_mac_address") & ";" & result2("net_timestamp")
If I > 1 Then
wscript.echo "Deleting entry with timestamp :" & result2("net_timestamp")
deletequery = "DELETE FROM network_card WHERE net_mac_address = " & "'" & result2("net_mac_address") & "'" & " AND net_timestamp = " & "'" & result2("net_timestamp") & "'"
set deletequeryresult = myconn.execute(deletequery)
'wscript.echo deletequery
End If
result2.movenext()
next
result.movenext()
wend
else
wscript.echo "No Entry"
end if
[/code]

The performance improvement was dramatic. The network_card table seems to have grown when we changed a DHCP option.

[quote]Release DHCP Lease on Shutdown
This option can be used to control whether DHCP-enabled computers running Windows 2000, Windows XP, or Windows Server 2003 sends a DHCPRelease message to the DHCP server when a shutdown occurs. It is actually implemented and interpreted as a bit-masked value by the DHCP Client service. By default, these clients do not send DHCPRelease messages on proper shutdown.


Setting this option makes our clients release their DHCP address on shutdown. Doing so causes them to get a new IP address when they boot up. Every time they get a new IP, the change causes a new row to be entered in the network_card table because OpenAudit maintains historical records.

Removing the dynamic network settings from the "existing record" query under "function insert_network" in admin_pc_add_2.php should fix the problem. A change in DHCP settings only updates the existing record instead of inserting a new record. Here is the modified function:

[code]function insert_network ($split) {
global $timestamp, $uuid, $verbose, $net_timestamp;
$extended = explode('^^^',$split);
if ($verbose == "y"){echo "<h2>Network</h2><br />";}
$net_mac_address = trim($extended[1]);
$net_description = trim($extended[2]);
$net_dhcp_enabled = trim($extended[3]);
$net_dhcp_server = trim($extended[4]);
$net_dns_host_name = trim($extended[5]);
$net_dns_server = trim($extended[6]);
$net_dns_server_2 = trim($extended[7]);
$net_ip_address = trim($extended[8]);
$net_ip_subnet = trim($extended[9]);
$net_wins_primary = trim($extended[10]);
$net_wins_secondary = trim($extended[11]);
$net_adapter_type = trim($extended[12]);
$net_manufacturer = trim($extended[13]);
$net_gateway = trim($extended[14]);
if (is_null($net_timestamp)) {
$sql = "SELECT MAX(net_timestamp) FROM network_card WHERE net_uuid = '$uuid'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
$myrow = mysql_fetch_array($result);
if ($myrow["MAX(net_timestamp)"]) {$net_timestamp = $myrow["MAX(net_timestamp)"];} else {$net_timestamp = "";}
} else {}
$sql = "SELECT count(net_uuid) as count from network_card WHERE net_mac_address = '$net_mac_address' ";
$sql .= "AND net_uuid = '$uuid' AND net_description = '$net_description' AND net_dhcp_enabled = '$net_dhcp_enabled' ";
$sql .= "AND net_adapter_type = '$net_adapter_type' AND net_manufacturer = '$net_manufacturer' AND (net_timestamp = '$net_timestamp' OR net_timestamp = '$timestamp')"; if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
$myrow = mysql_fetch_array($result);
if ($verbose == "y"){echo "Count: " . $myrow['count'] . "<br />\n\n";}
if ($myrow['count'] == "0"){
// Insert into database
$sql = "INSERT INTO network_card (net_mac_address, net_uuid, net_description, net_dhcp_enabled,";
$sql .= "net_dhcp_server, net_dns_host_name, net_dns_server, net_dns_server_2, net_ip_address, net_ip_subnet,";
$sql .= "net_wins_primary, net_wins_secondary, net_adapter_type, net_manufacturer, net_gateway, net_timestamp, net_first_timestamp) VALUES (";
$sql .= "'$net_mac_address','$uuid','$net_description','$net_dhcp_enabled',";
$sql .= "'$net_dhcp_server','$net_dns_host_name','$net_dns_server','$net_dns_server_2','$net_ip_address','$net_ip_subnet',";
$sql .= "'$net_wins_primary','$net_wins_secondary','$net_adapter_type','$net_manufacturer', '$net_gateway', '$timestamp', '$timestamp')";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
} else {
// Already present in database - update timestamp
$sql = "UPDATE network_card SET net_timestamp = '$timestamp' WHERE net_mac_address = '$net_mac_address' AND net_uuid = '$uuid' AND net_timestamp = '$net_timestamp'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
}

// Remove from the 'other' table if exists
// First - get the id from the 'other' table - if it exists
$other_id = '';
$sql = "SELECT other_id FROM other WHERE other_mac_address = '$net_mac_address'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Check Other table Failed: ' . mysql_error() . '<br />' . $sql);
if ($myrow = mysql_fetch_array($result)){$other_id = $myrow['other_id'];}
if ($other_id <> ''){
// It exists - so update the 'nmap_ports' table to the uuid/mac of the PC - not the other_id
$sql = "UPDATE nmap_ports SET nmap_other_id = '$uuid' WHERE nmap_other_id = '$other_id'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Update nmap_ports Failed: ' . mysql_error() . '<br />' . $sql);
// Now remove the entry from the 'other' table
$sql = "DELETE FROM other WHERE other_mac_address = '$net_mac_address'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Update nmap_ports Failed: ' . mysql_error() . '<br />' . $sql);
}
}
[/code]

Because of the dynamic nature of DHCP, I can see this being a problem for others.

Last edited by jpmorgan on Fri Nov 30, 2007 8:06 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 30, 2007 7:59 am 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
Sorry jpmorgan, could you please point out what lines you modified in admin_pc_add_2.php to fix dhcp issues? Thank you

_________________
Edoardo


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 30, 2007 8:17 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
Sorry I made a mistake in my prior post. The code I posted was the original. I've corrected the code section in my original post.

I replaced:

[code] $sql = "SELECT count(net_uuid) as count from network_card WHERE net_mac_address = '$net_mac_address' ";
$sql .= "AND net_uuid = '$uuid' AND net_description = '$net_description' AND net_dhcp_enabled = '$net_dhcp_enabled' ";
$sql .= "AND net_dhcp_server = '$net_dhcp_server' AND net_dns_host_name = '$net_dns_host_name' AND net_dns_server = '$net_dns_server' AND net_dns_server_2 = '$net_dns_server_2' ";
$sql .= "AND net_ip_address = '$net_ip_address' AND net_ip_subnet = '$net_ip_subnet' AND net_wins_primary = '$net_wins_primary' AND net_wins_secondary = '$net_wins_secondary' ";
$sql .= "AND net_adapter_type = '$net_adapter_type' AND net_manufacturer = '$net_manufacturer' AND net_gateway = '$net_gateway' AND (net_timestamp = '$net_timestamp' OR net_timestamp = '$timestamp')";
[/code]

With this:

[code] $sql = "SELECT count(net_uuid) as count from network_card WHERE net_mac_address = '$net_mac_address' ";
$sql .= "AND net_uuid = '$uuid' AND net_description = '$net_description' AND net_dhcp_enabled = '$net_dhcp_enabled' ";
$sql .= "AND net_adapter_type = '$net_adapter_type' AND net_manufacturer = '$net_manufacturer' AND (net_timestamp = '$net_timestamp' OR net_timestamp = '$timestamp')"; if ($verbose == "y"){echo $sql . "<br />\n\n";}
[/code]

I removed checking for a match for '$net_dhcp_server' , '$net_dns_host_name' ,'$net_dns_server','net_dns_server_2' , '$net_ip_address','$net_ip_subnet', '$net_wins_primary','$net_wins_secondary' and '$net_gateway'

The old code checked existing records for a match that included settings determined by DHCP.
The new code only checks settings not affected by DHCP. If you change your network card or change from static to DHCP a new record will be created. If only IP address, mask, gateway, DNS or WINS changes, the record will only be updated.

I hope that helps.


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 30, 2007 8:21 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
Do you think I should have left '$net_dns_host_name' in the check? Is that the host name of the audited computer? If so, it should probably be left in so a name change will generate a new record and the old will still be available as a historical record.


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 30, 2007 5:44 pm 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
Yes, I think so: although it isn't used to update the system table, it's better to left it in.
But most important I think that, as you removed inserting every time a new record when DHCP server changes or it leases new IP address, subnet mask, gateway, dns or wins settings, at the same time you must update the already existing network_card record with those detected values (not only the timestamp, or they will never update when lease expires)!
Let me know if it makes sense.

_________________
Edoardo


Last edited by ef on Sat Dec 01, 2007 7:19 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 01, 2007 1:13 am 
Offline
Helper

Joined: Thu Jun 14, 2007 4:06 am
Posts: 96
Location: Georgia, USA
Thanks for pointing that out. I didn't really get what you were saying until I separated out the logic. It's hard to follow:

Check database for records matching this query:

[code] $sql = "SELECT count(net_uuid) as count from network_card WHERE net_mac_address = '$net_mac_address' ";
$sql .= "AND net_uuid = '$uuid' AND net_description = '$net_description' AND net_dhcp_enabled = '$net_dhcp_enabled' ";
$sql .= "AND net_adapter_type = '$net_adapter_type' AND net_manufacturer = '$net_manufacturer' AND (net_timestamp = '$net_timestamp' OR net_timestamp = '$timestamp')"; if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
$myrow = mysql_fetch_array($result);
if ($verbose == "y"){echo "Count: " . $myrow['count'] . "<br />\n\n";}
[/code]

If the are no records matching this query ($myrow['count'] == "0") insert into the database:

[code] if ($myrow['count'] == "0"){
// Insert into database
$sql = "INSERT INTO network_card (net_mac_address, net_uuid, net_description, net_dhcp_enabled,";
$sql .= "net_dhcp_server, net_dns_host_name, net_dns_server, net_dns_server_2, net_ip_address, net_ip_subnet,";
$sql .= "net_wins_primary, net_wins_secondary, net_adapter_type, net_manufacturer, net_gateway, net_timestamp, net_first_timestamp) VALUES (";
$sql .= "'$net_mac_address','$uuid','$net_description','$net_dhcp_enabled',";
$sql .= "'$net_dhcp_server','$net_dns_host_name','$net_dns_server','$net_dns_server_2','$net_ip_address','$net_ip_subnet',";
$sql .= "'$net_wins_primary','$net_wins_secondary','$net_adapter_type','$net_manufacturer', '$net_gateway', '$timestamp', '$timestamp')";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
[/code]

Here is the problem. If there is a record matching the query, it only updates net_timestamp.

[code] } else {
// Already present in database - update timestamp
$sql = "UPDATE network_card SET net_timestamp = '$timestamp' WHERE net_mac_address = '$net_mac_address' AND net_uuid = '$uuid' AND net_timestamp = '$net_timestamp'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
}
[/code]

Changing that part to this should fix the problem:

[code] } else {
// Already present in database - update timestamp
$sql = "UPDATE network_card SET net_dhcp_server = '$net_dhcp_server', net_dns_host_name = '$net_dns_host_name', net_dns_server = '$net_dns_server', ";
$sql .= "net_dns_server_2 = '$net_dns_server_2', net_ip_address = '$net_ip_address', net_ip_subnet = '$net_ip_subnet', net_wins_primary = '$net_wins_primary', ";
$sql .= "net_wins_secondary = '$net_wins_secondary', net_gateway = '$net_gateway', net_timestamp = '$timestamp' WHERE net_mac_address = '$net_mac_address' ";
$sql .= "AND net_uuid = '$uuid' AND net_timestamp = '$net_timestamp'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
}
[/code]

Here is the entire "function insert_network" with the above edits and the net_dns_host_name check added back in:

[code]function insert_network ($split) {
global $timestamp, $uuid, $verbose, $net_timestamp;
$extended = explode('^^^',$split);
if ($verbose == "y"){echo "<h2>Network</h2><br />";}
$net_mac_address = trim($extended[1]);
$net_description = trim($extended[2]);
$net_dhcp_enabled = trim($extended[3]);
$net_dhcp_server = trim($extended[4]);
$net_dns_host_name = trim($extended[5]);
$net_dns_server = trim($extended[6]);
$net_dns_server_2 = trim($extended[7]);
$net_ip_address = trim($extended[8]);
$net_ip_subnet = trim($extended[9]);
$net_wins_primary = trim($extended[10]);
$net_wins_secondary = trim($extended[11]);
$net_adapter_type = trim($extended[12]);
$net_manufacturer = trim($extended[13]);
$net_gateway = trim($extended[14]);
if (is_null($net_timestamp)) {
$sql = "SELECT MAX(net_timestamp) FROM network_card WHERE net_uuid = '$uuid'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
$myrow = mysql_fetch_array($result);
if ($myrow["MAX(net_timestamp)"]) {$net_timestamp = $myrow["MAX(net_timestamp)"];} else {$net_timestamp = "";}
} else {}
$sql = "SELECT count(net_uuid) as count from network_card WHERE net_mac_address = '$net_mac_address' ";
$sql .= "AND net_uuid = '$uuid' AND net_description = '$net_description' AND net_dhcp_enabled = '$net_dhcp_enabled' AND net_dns_host_name = '$net_dns_host_name' ";
$sql .= "AND net_adapter_type = '$net_adapter_type' AND net_manufacturer = '$net_manufacturer' AND (net_timestamp = '$net_timestamp' OR net_timestamp = '$timestamp')"; if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
$myrow = mysql_fetch_array($result);
if ($verbose == "y"){echo "Count: " . $myrow['count'] . "<br />\n\n";}
if ($myrow['count'] == "0"){
// Insert into database
$sql = "INSERT INTO network_card (net_mac_address, net_uuid, net_description, net_dhcp_enabled,";
$sql .= "net_dhcp_server, net_dns_host_name, net_dns_server, net_dns_server_2, net_ip_address, net_ip_subnet,";
$sql .= "net_wins_primary, net_wins_secondary, net_adapter_type, net_manufacturer, net_gateway, net_timestamp, net_first_timestamp) VALUES (";
$sql .= "'$net_mac_address','$uuid','$net_description','$net_dhcp_enabled',";
$sql .= "'$net_dhcp_server','$net_dns_host_name','$net_dns_server','$net_dns_server_2','$net_ip_address','$net_ip_subnet',";
$sql .= "'$net_wins_primary','$net_wins_secondary','$net_adapter_type','$net_manufacturer', '$net_gateway', '$timestamp', '$timestamp')";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
} else {
// Already present in database - update timestamp an TCP/IP properties
$sql = "UPDATE network_card SET net_dhcp_server = '$net_dhcp_server', net_dns_host_name = '$net_dns_host_name', net_dns_server = '$net_dns_server', ";
$sql .= "net_dns_server_2 = '$net_dns_server_2', net_ip_address = '$net_ip_address', net_ip_subnet = '$net_ip_subnet', net_wins_primary = '$net_wins_primary', ";
$sql .= "net_wins_secondary = '$net_wins_secondary', net_gateway = '$net_gateway', net_timestamp = '$timestamp' WHERE net_mac_address = '$net_mac_address' ";
$sql .= "AND net_uuid = '$uuid' AND net_timestamp = '$net_timestamp'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Insert Failed: ' . mysql_error() . '<br />' . $sql);
}

// Remove from the 'other' table if exists
// First - get the id from the 'other' table - if it exists
$other_id = '';
$sql = "SELECT other_id FROM other WHERE other_mac_address = '$net_mac_address'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Check Other table Failed: ' . mysql_error() . '<br />' . $sql);
if ($myrow = mysql_fetch_array($result)){$other_id = $myrow['other_id'];}
if ($other_id <> ''){
// It exists - so update the 'nmap_ports' table to the uuid/mac of the PC - not the other_id
$sql = "UPDATE nmap_ports SET nmap_other_id = '$uuid' WHERE nmap_other_id = '$other_id'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Update nmap_ports Failed: ' . mysql_error() . '<br />' . $sql);
// Now remove the entry from the 'other' table
$sql = "DELETE FROM other WHERE other_mac_address = '$net_mac_address'";
if ($verbose == "y"){echo $sql . "<br />\n\n";}
$result = mysql_query($sql) or die ('Update nmap_ports Failed: ' . mysql_error() . '<br />' . $sql);
}
} [/code]

Can you look at it and maybe do some testing? How about the last section that makes changes to the other table and nmap_ports table. Do you think these changes have any effect on that section? It doesn't seem to.


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 01, 2007 2:40 am 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
It's exactly what I intended and these changes don't influence the updating of nmap_ports and other tables. I will try next week what you suggested to optimize network_card table inserting/updating. Thank you

_________________
Edoardo


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group