thepip3r Posted July 14, 2006 Share Posted July 14, 2006 I have a script that runs every 5 mins on a Windows Server 2003 OS to update a database from a variable length directory of INI files. My problem is that when the directory gets a larger number of files, it takes a longer time for the script to process, like over an hour. I've watch the php.exe process and while I can see it kicked off, it barely does anything to the processor so I'm wondering if there's anyway that anyone might now as to how I might be able to speed up this batch processing request. Thanx in advance.Edit: the script is writing a bunch of information to a MySQL database and the mysql process is very active compared to the PHP exe so maybe that's my downfall. Can anyone give me any pointers on streamlining some of my code to see if there's a way to make it run more efficiently? thanx again.[code]$ScriptStartTime = microtime_float();db_open();$INIPath = "e:\\inventory_agent\\data\\INIs\\";$ComputerCount = 1;if (is_dir($INIPath)) { if ($INIDH = opendir($INIPath)) { while (($INIFile = readdir($INIDH)) !== false) { $INISub = SubStr($INIFile,-4,4); $HostName = SubStr($INIFile,0,StrLen($INIFile)-4); if ($INISub == '.ini') { if (is_file($INIPath.$INIFile)) { $ini_array = parse_ini_file($INIPath.$INIFile, true); $Timestamp = $ini_array['General']['Timestamp']; # Write each elements section and value to it's own variable name and value if (is_array($ini_array['General'])) { foreach ($ini_array['General'] as $key => $val) { $$key = $val; } # Create the SQL statement, query to see if a record exists for that hostname, and count the number of results $sql = "SELECT * FROM computers WHERE hostname='$Hostname'"; $result = mysql_query($sql) or die("SQL query failed, please contact your administrator. Reported Error: ".logErrors('general',mysql_error(),$ComputerCount)."\n"); $count = mysql_num_rows($result); # If no record exists, write that hostname's information to the database if ($count == 0) { $result2 = mysql_query("INSERT INTO computers (hostname,ip,mac,os,os_ver,scriptruntime) VALUES('$Hostname','$IP','$MAC','$OS','$Ver','$ScriptRunTime')") or die("SQL query failed on $hostname. Reported Error: ".logErrors('general',mysql_error(),$ComputerCount)."\n"); # If a record already exists, check to see if any of the values have changed; if they have, dynamically create the SQL statement to only update the changes and do it } elseif ($count == 1) { while ($row = mysql_fetch_assoc($result)) { if ($Hostname != $row['hostname']) $temp['hostname'] = $Hostname; if ($IP != $row['ip']) $temp['ip'] = $IP; if ($MAC != $row['mac']) $temp['mac'] = $MAC; if ($OS != $row['os']) $temp['os'] = $OS; if ($Ver != $row['os_ver']) $temp['os_ver'] = $Ver; if ($ScriptRunTime != $row['scriptruntime']) $temp['scriptruntime'] = $ScriptRunTime; if ($Timestamp != $row['Timestamp']) $temp['Timestamp'] = $Timestamp; $sql2 = "UPDATE computers SET "; if (is_array($temp)) { foreach ($temp as $key2 => $val2) { if ($val2 == end($temp)) { $sql2 .= "$key2='$val2'"; } else { $sql2 .= "$key2='$val2',"; } } $sql2 .= " WHERE hostname='$Hostname'"; $result2 = mysql_query($sql2) or die("Updating ".$hostname."'s records failed. Reported Error: ".logErrors('general',mysql_error(),$ComputerCount)."\n"); } } # If there is either more than 1 record in the DB for that hostname or a different error occurred, halt script execution } elseif ($count > 1) { fwrite(STDOUT, "Multiple computer accounts with the same name exist in the DB."); } else { fwrite(STDOUT, "An unforseen error has occurred. Please contact your site administrator."); exit; } } else { fwrite(STDOUT, "The array for 'General' information could not be created on $INIPath$INIFile.\n"); unlink($INIPath.$INIFile); continue; } # Grab the id field of the computer we're trying to add information to $CompIDResult = mysql_query("SELECT id FROM computers WHERE hostname='$HostName'") or die("Computer ID selection failed, please contact your site administrator. Reported Error: ".logErrors('compidl',mysql_error(),$ComputerCount)."\n"); $CompIDCount = mysql_num_rows($CompIDResult); $CompIDRow = mysql_fetch_row($CompIDResult); $CompID = $CompIDRow[0]; if (!isset($CompID)) { fwrite(STDOUT, "Computer ID query failed. This is most likely the result of needing to run the Exec General INI again."); exit; } if (is_array($ini_array['Processes'])) { # Iterate all processes that are running when the user logs on, verify that they exist in the DB, or write them to the database foreach ($ini_array['Processes'] as $Proc) { list($ProcName,$ProcPath,$ProcVersion,$ProcPublisher) = explode("*",$Proc); $ProcResult = mysql_query("SELECT * FROM processes WHERE name='$ProcName'") or die("Process verification query failed, please contact your site administrator. Reported Error: ".logErrors('processes',mysql_error(),$ComputerCount)."\n"); $ProcCount = mysql_num_rows($ProcResult); if ($ProcCount == 0) { $ProcResult2 = mysql_query("INSERT INTO processes (name) VALUES('$ProcName')") or die("Process SQL INSERT failed for $ProcName, please contact your site administrator Reported Error: ".logErrors('processes',mysql_error(),$ComputerCount)."\n"); $ProcID = mysql_insert_id(); $ProcResult3 = mysql_query("SELECT * FROM process_info WHERE path='$ProcPath'") or die("Process information query failed, please contact your site administrator. Reported Error: ".logErrors('processes',mysql_error(),$ComputerCount)."\n"); $ProcCount2 = mysql_num_rows($ProcResult3); if ($ProcCount2 == 0) { $ProcResult4 = mysql_query("INSERT INTO process_info (path) VALUES('$ProcPath')") or die("Process information insert failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcInfoID = mysql_insert_id(); $ProcResult5 = mysql_query("INSERT INTO computer_process_ids (computer_id,process_id,process_info_id,timestamp) VALUES('$CompID','$ProcID','$ProcInfoID','$Timestamp')") or die("Process ID insert failed(1), please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } elseif ($ProcCount2 == 1) { $ProcInfoRow = mysql_fetch_row($ProcResult3); $ProcInfoID = $ProcInfoRow[0]; $ProcResult5 = mysql_query("SELECT * FROM computer_process_ids WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID selection for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcCount3 = mysql_num_rows($ProcResult5); if ($ProcCount3 == 0) { $ProcResult5 = mysql_query("INSERT INTO computer_process_ids (computer_id,process_id,process_info_id,timestamp) VALUES('$CompID','$ProcID','$ProcInfoID','$Timestamp')") or die("Process ID insert failed(2), please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } else { $ProcResult6 = msyql_query("UPDATE computer_process_ids SET timestamp='$Timestamp' WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID update for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the processes for $HostName.\n"); } } elseif ($ProcCount == 1) { #fwrite(STDOUT, "Process $ProcName has already been added to the database.\n"; $ProcIDRow = mysql_fetch_row($ProcResult); $ProcID = $ProcIDRow[0]; $ProcResult3 = mysql_query("SELECT * FROM process_info WHERE path='$ProcPath'") or die("Process information query failed, please contact your site administrator. Reported Error: ".logErrors('processes',mysql_error(),$ComputerCount)."\n"); $ProcCount2 = mysql_num_rows($ProcResult3); if ($ProcCount2 == 0) { $ProcResult4 = mysql_query("INSERT INTO process_info (path) VALUES('$ProcPath')") or die("Process information insert failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcInfoID = mysql_insert_id(); $ProcResult5 = mysql_query("SELECT * FROM computer_process_ids WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID selection for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcCount3 = mysql_num_rows($ProcResult5); if ($ProcCount3 == 0) { $ProcResult5 = mysql_query("INSERT INTO computer_process_ids (computer_id,process_id,process_info_id,timestamp) VALUES('$CompID','$ProcID','$ProcInfoID','$Timestamp')") or die("Process ID insert failed(3), please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } else { $ProcResult6 = msyql_query("UPDATE computer_process_ids SET timestamp='$Timestamp' WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID update for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } } elseif ($ProcCount2 == 1) { $ProcInfoRow = mysql_fetch_row($ProcResult3); $ProcInfoID = $ProcInfoRow[0]; $ProcResult5 = mysql_query("SELECT * FROM computer_process_ids WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID selection for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcCount3 = mysql_num_rows($ProcResult5); if ($ProcCount3 == 0) { $ProcResult5 = mysql_query("INSERT INTO computer_process_ids (computer_id,process_id,process_info_id,timestamp) VALUES('$CompID','$ProcID','$ProcInfoID','$Timestamp')") or die("Process ID insert failed(4), please contact your site administrator.\n Timestamp: $Timestamp \n Hostname: $HostName \n".logErrors('processes',mysql_error(),$ComputerCount)); } else { $ProcResult6 = mysql_query("UPDATE computer_process_ids SET timestamp='$Timestamp' WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID update for processes failed, please contact your site administrator.\n$Timestamp\n".logErrors('processes',mysql_error(),$ComputerCount)); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the processes for $HostName.\n"); } } } } else { fwrite(STDOUT, "The array for 'Process' information could not be created on $INIFile.\n"); } if (is_array($ini_array['Programs'])) { # Iterate all programs that are running when the user logs on, verify that they exist in the DB, or write them to the database foreach ($ini_array['Programs'] as $Prog) { list($ProgName,$ProgPath,$ProgVersion,$ProgPublisher) = explode("*",$Prog); $ProgResult = mysql_query("SELECT * FROM programs WHERE name='$ProgName'") or die("Program verification query failed, please contact your site administrator. Reported Error: ".mysql_error()."\n"); $ProgCount = mysql_num_rows($ProgResult); if ($ProgCount == 0) { $ProgResult2 = mysql_query("INSERT INTO programs (name) VALUES('$ProgName')") or die("Program SQL INSERT failed for $ProgName, please contact your site administrator Reported Error: ".mysql_error()."\n"); $ProgID = mysql_insert_id(); $ProgResult3 = mysql_query("SELECT * FROM program_info WHERE path='$ProgPath' AND version = '$ProgVersion' AND publisher='$ProgPublisher'") or die("Program information query failed, please contact your site administrator. Reported Error: ".mysql_error()."\n"); $ProgCount2 = mysql_num_rows($ProgResult3); if ($ProgCount2 == 0) { $ProgResult4 = mysql_query("INSERT INTO program_info (path,version,publisher) VALUES('$ProgPath','$ProgVersion','$ProgPublisher')") or die("Program information insert failed, please contact your site administrator.\n".mysql_error()); $ProgInfoID = mysql_insert_id(); $ProgResult5 = mysql_query("INSERT INTO computer_program_ids (computer_id,program_id,program_info_id,timestamp) VALUES('$CompID','$ProgID','$ProgInfoID','$Timestamp')") or die("Program ID insert failed(1), please contact your site administrator.\n".mysql_error()); } elseif ($ProgCount2 == 1) { $ProgInfoRow = mysql_fetch_row($ProgResult3); $ProgInfoID = $ProgInfoRow[0]; $ProgResult5 = mysql_query("SELECT * FROM computer_program_ids WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID selection for programes failed, please contact your site administrator.\n".mysql_error()); $ProgCount3 = mysql_num_rows($ProgResult5); if ($ProgCount3 == 0) { $ProgResult5 = mysql_query("INSERT INTO computer_program_ids (computer_id,program_id,program_info_id,timestamp) VALUES('$CompID','$ProgID','$ProgInfoID','$Timestamp')") or die("Progess ID insert failed(2), please contact your site administrator.\n".mysql_error()); } else { $ProgResult6 = msyql_query("UPDATE computer_program_ids SET timestamp='".strtotime("now")."' WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID update for programes failed, please contact your site administrator.\n$Timestamp\n".mysql_error()); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the programs for $HostName.\n"); } } elseif ($ProgCount == 1) { #fwrite(STDOUT, "Program $ProgName has already been added to the database.\n"; $ProgIDRow = mysql_fetch_row($ProgResult); $ProgID = $ProgIDRow[0]; $ProgResult3 = mysql_query("SELECT * FROM program_info WHERE path='$ProgPath' AND version = '$ProgVersion' AND publisher='$ProgPublisher'") or die("Program information query failed, please contact your site administrator. Reported Error: ".mysql_error()."\n"); $ProgCount2 = mysql_num_rows($ProgResult3); if ($ProgCount2 == 0) { $ProgResult4 = mysql_query("INSERT INTO program_info (path,version,publisher) VALUES('$ProgPath','$ProgVersion','$ProgPublisher')") or die("Program information insert failed, please contact your site administrator.\n".mysql_error()); $ProgInfoID = mysql_insert_id(); $ProgResult5 = mysql_query("SELECT * FROM computer_program_ids WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID selection for programes failed, please contact your site administrator.\n".mysql_error()); $ProgCount3 = mysql_num_rows($ProgResult5); if ($ProgCount3 == 0) { $ProgResult5 = mysql_query("INSERT INTO computer_program_ids (computer_id,program_id,program_info_id,timestamp) VALUES('$CompID','$ProgID','$ProgInfoID','$Timestamp')") or die("Progess ID insert failed(3), please contact your site administrator.\n".mysql_error()); } else { $ProgResult6 = msyql_query("UPDATE computer_program_ids SET timestamp='".strtotime("now")."' WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID update for programes failed, please contact your site administrator.\n$Timestamp\n".mysql_error()); } } elseif ($ProgCount2 == 1) { $ProgInfoRow = mysql_fetch_row($ProgResult3); $ProgInfoID = $ProgInfoRow[0]; $ProgResult5 = mysql_query("SELECT * FROM computer_program_ids WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID selection for programes failed, please contact your site administrator.\n".mysql_error()); $ProgCount3 = mysql_num_rows($ProgResult5); if ($ProgCount3 == 0) { $ProgResult5 = mysql_query("INSERT INTO computer_program_ids (computer_id,program_id,program_info_id,timestamp) VALUES('$CompID','$ProgID','$ProgInfoID','$Timestamp')") or die("Progess ID insert failed(4), please contact your site administrator.\n".mysql_error()); } else { $ProgResult6 = mysql_query("UPDATE computer_program_ids SET timestamp='".strtotime("now")."' WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID update for programes failed, please contact your site administrator.\n$Timestamp\n".mysql_error()); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the programs for $HostName.\n"); } } } } else { fwrite(STDOUT, "The array for 'Program' information could not be created on $INIFile.\n"); } [/code] Quote Link to comment Share on other sites More sharing options...
thepip3r Posted July 14, 2006 Author Share Posted July 14, 2006 bump... Quote Link to comment Share on other sites More sharing options...
ShogunWarrior Posted July 14, 2006 Share Posted July 14, 2006 It's an unusual thing, you might be able to find a command line way to change a process priority and exec it. Quote Link to comment Share on other sites More sharing options...
Buyocat Posted July 14, 2006 Share Posted July 14, 2006 How many writes are you doing? Because they will always taking longer than selects and may be the cause of this bottleneck. Quote Link to comment Share on other sites More sharing options...
redarrow Posted July 14, 2006 Share Posted July 14, 2006 Have you got a php Optimizer installed that might fasten things up. Quote Link to comment Share on other sites More sharing options...
shoz Posted July 14, 2006 Share Posted July 14, 2006 PHP's only work in this script seems to be to read a directory and parse ini files. Most of it seems to be queries for MYSQL to handle.Although there are some ways to minimize the number of queries (In one case a REPLACE could possibly be better), I'd first look at optimizing the tables if they aren't already.Post the create statement for your tables.[code]SHOW CREATE TABLE tablename[/code]Btw, how many rows are in your largest table and about how many ini files are usually processed?Also post the current script execution time for comparison later on. Quote Link to comment Share on other sites More sharing options...
ShogunWarrior Posted July 14, 2006 Share Posted July 14, 2006 You should think about indexing some fields fields which could speed up things a bit.Also, try and reduce queries if they're unneccesary or if they can be combined etc. Quote Link to comment Share on other sites More sharing options...
thepip3r Posted July 25, 2006 Author Share Posted July 25, 2006 wow... there were quite a few posts so i apologize for not getting back on this one. Shoz is right, almost ALL of the processing happens by MySQL. The problem is the length of time each file takes to process... so here's the skinny on my project:I wrote a KiX script that gathers a whole crap-load of information whenever a user logs into our network. The KiX script appends that information gathered to an INI file in a directory on a web server. Then a PHP script running via the Windows Task Scheduler every 5 mins, parses this INI directory and compares the contents of each computer_name.INI file and compares it to the database and if there's any new information, it appends that information and updates timestamps. Some KiX gathered information from a particular computer is detailed below: [code][General]MAC=**********OS=Windows XP ProfessionalVer=Service Pack 2Hostname=******22IP=*.*.*.125Timestamp=1153849518ScriptRunTime=36[LLU]1153849518=john.doe[Processes]Process1=acachsrv.exe*1616*Path UnknownProcess2=acautoreg.exe*1636*Path UnknownProcess3=acautoup.exe*1684*Path UnknownProcess4=accoca.exe*1748*Path UnknownProcess5=acevtsrv.exe*1712*C:-BSlash-Program Files-BSlash-ActivCard-BSlash-ActivCard Gold-BSlash-acevtsrv.exeProcess6=agquickp.exe*500*C:-BSlash-Program Files-BSlash-ActivCard-BSlash-ActivCard Gold-BSlash-agquickp.exeProcess7=alg.exe*840*Path UnknownProcess8=ccApp.exe*1628*C:-BSlash-Program Files-BSlash-Common Files-BSlash-Symantec Shared-BSlash-ccApp.exeProcess9=ccEvtMgr.exe*1152*Path UnknownProcess10=CcmExec.exe*372*Path UnknownProcess11=ccSetMgr.exe*1188*Path UnknownProcess12=cmd.exe*4020*C:-BSlash-WINNT-BSlash-system32-BSlash-cmd.exeProcess13=cscript.exe*4088*C:-BSlash-WINNT-BSlash-system32-BSlash-cscript.exeProcess14=csrss.exe*528*Path UnknownProcess15=DefWatch.exe*1772*Path UnknownProcess16=explorer.exe*4052*C:-BSlash-WINNT-BSlash-Explorer.EXEProcess17=GlobalAddressUpater.exe*2572*C:-BSlash-DOCUME-Tilde-1-BSlash-JOSEPH-Tilde-1.MIR-BSlash-LOCALS-Tilde-1-BSlash-Temp-BSlash-GlobalAddressUpater.exeProcess18=GWInkMonitor.exe*2328*C:-BSlash-Program Files-BSlash-Gateway Utilities-BSlash-GWInkMonitor.exeProcess19=jusched.exe*2920*C:-BSlash-Program Files-BSlash-Java-BSlash-jre1.5.0_06-BSlash-bin-BSlash-jusched.exeProcess20=KIX32.EXE*496*Path UnknownProcess21=lsass.exe*608*Path UnknownProcess22=masqform.exe*3064*C:-BSlash-Program Files-BSlash-PureEdge-BSlash-Viewer 6.0-BSlash-masqform.exeProcess23=mdm.exe*1860*Path UnknownProcess24=msiexec.exe*3416*Path UnknownProcess25=nvsvc32.exe*1900*Path UnknownProcess26=qttask.exe*2908*C:-BSlash-Program Files-BSlash-QuickTime-BSlash-qttask.exeProcess27=reader_sl.exe*1096*C:-BSlash-Program Files-BSlash-Adobe-BSlash-Acrobat 7.0-BSlash-Reader-BSlash-reader_sl.exeProcess28=Rtvscan.exe*2032*Path UnknownProcess29=rundll32.exe*2956*C:-BSlash-WINNT-BSlash-system32-BSlash-RUNDLL32.EXEProcess30=SavRoam.exe*1936*Path UnknownProcess31=scardsvr.exe*1456*Path UnknownProcess32=services.exe*596*Path UnknownProcess33=smss.exe*480*Path UnknownProcess34=SPBBCSvc.exe*1304*Path UnknownProcess35=spoolsv.exe*1364*Path UnknownProcess36=svchost.exe*1004*Path UnknownProcess37=svchost.exe*1036*Path UnknownProcess38=svchost.exe*2016*Path UnknownProcess39=svchost.exe*788*Path UnknownProcess40=svchost.exe*852*Path UnknownProcess41=svchost.exe*924*Path UnknownProcess42=System Idle Process*0*Path UnknownProcess43=System*4*Path UnknownProcess44=unsecapp.exe*2112*C:-BSlash-WINNT-BSlash-System32-BSlash-wbem-BSlash-unsecapp.exeProcess45=userinit.exe*1084*C:-BSlash-WINNT-BSlash-system32-BSlash-userinit.exeProcess46=VPTray.exe*3092*C:-BSlash-PROGRA-Tilde-1-BSlash-SYMANT-Tilde-2-BSlash-VPTray.exeProcess47=winlogon.exe*552*Path UnknownProcess48=wmiprvse.exe*1644*Path UnknownProcess49=wmiprvse.exe*2072*Path UnknownProcess50=wmiprvse.exe*2524*Path UnknownProcess51=wmiprvse.exe*3508*Path UnknownProcess52=wscript.exe*2208*C:-BSlash-WINNT-BSlash-system32-BSlash-Wscript.exeProcess53=wscript.exe*3612*C:-BSlash-WINNT-BSlash-system32-BSlash-Wscript.exeProcess54=Wuser32.exe*216*Path Unknown[Services]Service1=ACachSrv*ActivCard Authentication Service*C:-BSlash-Program Files-BSlash-Common Files-BSlash-ActivCard-BSlash-acachsrv.exe*Auto*Running*LocalSystemService2=acautoreg*ActivCard Gold Autoregister*C:-BSlash-Program Files-BSlash-Common Files-BSlash-ActivCard-BSlash-acautoreg.exe*Auto*Running*LocalSystemService3=acautoupdate*ActivCard Auto-Update Service*C:-BSlash-Program Files-BSlash-Common Files-BSlash-ActivCard-BSlash-acautoup.exe*Auto*Running*LocalSystemService4=Accoca*ActivCard Gold service*C:-BSlash-Program Files-BSlash-Common Files-BSlash-ActivCard-BSlash-accoca.exe*Auto*Running*NT AUTHORITY-BSlash-LocalServiceService5=Alerter*Alerter*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k LocalService*Disabled*Stopped*NT AUTHORITY-BSlash-LocalServiceService6=ALG*Application Layer Gateway Service*C:-BSlash-WINNT-BSlash-System32-BSlash-alg.exe*Manual*Running*NT AUTHORITY-BSlash-LocalServiceService7=AppMgmt*Application Management*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost.exe -k netsvcs*Manual*Stopped*LocalSystemService8=aspnet_state*ASP.NET State Service*C:-BSlash-WINNT-BSlash-Microsoft.NET-BSlash-Framework-BSlash-v1.1.4322-BSlash-aspnet_state.exe*Manual*Stopped*NT AUTHORITY-BSlash-NetworkServiceService9=AudioSrv*Windows Audio*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService10=BITS*Background Intelligent Transfer Service*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost.exe -k netsvcs*Manual*Stopped*LocalSystemService11=Browser*Computer Browser*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService12=ccEvtMgr*Symantec Event Manager*-SQuote-C:-BSlash-Program Files-BSlash-Common Files-BSlash-Symantec Shared-BSlash-ccEvtMgr.exe-SQuote-*Auto*Running*LocalSystemService13=CcmExec*SMS Agent Host*C:-BSlash-WINNT-BSlash-System32-BSlash-CCM-BSlash-CcmExec.exe*Auto*Running*LocalSystemService14=ccSetMgr*Symantec Settings Manager*-SQuote-C:-BSlash-Program Files-BSlash-Common Files-BSlash-Symantec Shared-BSlash-ccSetMgr.exe-SQuote-*Auto*Running*LocalSystemService15=CiSvc*Indexing Service*C:-BSlash-WINNT-BSlash-system32-BSlash-cisvc.exe*Manual*Stopped*LocalSystemService16=ClipSrv*ClipBook*C:-BSlash-WINNT-BSlash-system32-BSlash-clipsrv.exe*Disabled*Stopped*LocalSystemService17=COMSysApp*COM+ System Application*C:-BSlash-WINNT-BSlash-System32-BSlash-dllhost.exe /Processid:-LCBrace-02D4B3F1-FD88-11D1-960D-00805FC79235-RCBrace-*Manual*Stopped*LocalSystemService18=CryptSvc*Cryptographic Services*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService19=DcomLaunch*DCOM Server Process Launcher*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost -k DcomLaunch*Auto*Running*LocalSystemService20=DefWatch*Symantec AntiVirus Definition Watcher*-SQuote-C:-BSlash-Program Files-BSlash-Symantec AntiVirus-BSlash-DefWatch.exe-SQuote-*Auto*Running*LocalSystemService21=Dhcp*DHCP Client*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService22=dmadmin*Logical Disk Manager Administrative Service*C:-BSlash-WINNT-BSlash-System32-BSlash-dmadmin.exe /com*Manual*Stopped*LocalSystemService23=dmserver*Logical Disk Manager*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService24=Dnscache*DNS Client*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k NetworkService*Auto*Running*NT AUTHORITY-BSlash-NetworkServiceService25=ERSvc*Error Reporting Service*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService26=Eventlog*Event Log*C:-BSlash-WINNT-BSlash-system32-BSlash-services.exe*Auto*Running*LocalSystemService27=EventSystem*COM+ Event System*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Manual*Running*LocalSystemService28=FastUserSwitchingCompatibility*Fast User Switching Compatibility*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Manual*Stopped*LocalSystemService29=hClient*Hercules Client*C:-BSlash-program files-BSlash-Citadel-BSlash-Hercules-BSlash-Client-BSlash-HercClient.exe*Auto*Stopped*LocalSystemService30=helpsvc*Help and Support*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService31=HidServ*Human Interface Device Access*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Disabled*Stopped*LocalSystemService32=HTTPFilter*HTTP SSL*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k HTTPFilter*Manual*Stopped*LocalSystemService33=ImapiService*IMAPI CD-Burning COM Service*C:-BSlash-WINNT-BSlash-System32-BSlash-imapi.exe*Manual*Stopped*LocalSystemService34=lanmanserver*Server*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService35=lanmanworkstation*Workstation*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService36=LiveUpdate*LiveUpdate*-SQuote-C:-BSlash-PROGRA-Tilde-1-BSlash-Symantec-BSlash-LIVEUP-Tilde-1-BSlash-LUCOMS-Tilde-1.EXE-SQuote-*Manual*Stopped*LocalSystemService37=LmHosts*TCP/IP NetBIOS Helper*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k LocalService*Auto*Running*NT AUTHORITY-BSlash-LocalServiceService38=MDM*Machine Debug Manager*-SQuote-C:-BSlash-Program Files-BSlash-Common Files-BSlash-Microsoft Shared-BSlash-VS7Debug-BSlash-mdm.exe-SQuote-*Auto*Running*LocalSystemService39=Messenger*Messenger*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService40=mnmsrvc*NetMeeting Remote Desktop Sharing*C:-BSlash-WINNT-BSlash-System32-BSlash-mnmsrvc.exe*Manual*Stopped*LocalSystemService41=MSDTC*Distributed Transaction Coordinator*C:-BSlash-WINNT-BSlash-System32-BSlash-msdtc.exe*Manual*Stopped*NT Authority-BSlash-NetworkServiceService42=MSIServer*Windows Installer*C:-BSlash-WINNT-BSlash-system32-BSlash-msiexec.exe /V*Manual*Running*LocalSystemService43=NetDDE*Network DDE*C:-BSlash-WINNT-BSlash-system32-BSlash-netdde.exe*Disabled*Stopped*LocalSystemService44=NetDDEdsdm*Network DDE DSDM*C:-BSlash-WINNT-BSlash-system32-BSlash-netdde.exe*Disabled*Stopped*LocalSystemService45=Netlogon*Net Logon*C:-BSlash-WINNT-BSlash-System32-BSlash-lsass.exe*Auto*Running*LocalSystemService46=Netman*Network Connections*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Manual*Running*LocalSystemService47=NetSvc*Intel NCS NetService*C:-BSlash-Program Files-BSlash-Intel-BSlash-PROSetWired-BSlash-NCS-BSlash-Sync-BSlash-NetSvc.exe*Manual*Stopped*LocalSystemService48=Nla*Network Location Awareness -LParen-NLA-RParen-*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Manual*Running*LocalSystemService49=NtLmSsp*NT LM Security Support Provider*C:-BSlash-WINNT-BSlash-System32-BSlash-lsass.exe*Manual*Stopped*LocalSystemService50=NtmsSvc*Removable Storage*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost.exe -k netsvcs*Manual*Stopped*LocalSystemService51=NVSvc*NVIDIA Display Driver Service*C:-BSlash-WINNT-BSlash-System32-BSlash-nvsvc32.exe*Auto*Running*LocalSystemService52=OracleClientCache80*OracleClientCache80*C:-BSlash-ACES-BSlash-BIN-BSlash-ONRSD80.EXE*Manual*Stopped*LocalSystemService53=ose*Office Source Engine*-SQuote-C:-BSlash-Program Files-BSlash-Common Files-BSlash-Microsoft Shared-BSlash-Source Engine-BSlash-OSE.EXE-SQuote-*Manual*Stopped*LocalSystemService54=PlugPlay*Plug and Play*C:-BSlash-WINNT-BSlash-system32-BSlash-services.exe*Auto*Running*LocalSystemService55=PolicyAgent*IPSEC Services*C:-BSlash-WINNT-BSlash-System32-BSlash-lsass.exe*Auto*Running*LocalSystemService56=ProtectedStorage*Protected Storage*C:-BSlash-WINNT-BSlash-system32-BSlash-lsass.exe*Auto*Running*LocalSystemService57=RasAuto*Remote Access Auto Connection Manager*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Manual*Stopped*LocalSystemService58=RasMan*Remote Access Connection Manager*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Manual*Stopped*LocalSystemService59=RDSessMgr*Remote Desktop Help Session Manager*C:-BSlash-WINNT-BSlash-system32-BSlash-sessmgr.exe*Manual*Stopped*LocalSystemService60=RemoteAccess*Routing and Remote Access*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Disabled*Stopped*LocalSystemService61=RemoteRegistry*Remote Registry*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost.exe -k LocalService*Auto*Running*NT AUTHORITY-BSlash-LocalServiceService62=RpcLocator*Remote Procedure Call -LParen-RPC-RParen- Locator*C:-BSlash-WINNT-BSlash-System32-BSlash-locator.exe*Manual*Stopped*NT AUTHORITY-BSlash-NetworkServiceService63=RpcSs*Remote Procedure Call -LParen-RPC-RParen-*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost -k rpcss*Auto*Running*NT Authority-BSlash-NetworkServiceService64=RSVP*QoS RSVP*C:-BSlash-WINNT-BSlash-System32-BSlash-rsvp.exe*Manual*Stopped*LocalSystemService65=SamSs*Security Accounts Manager*C:-BSlash-WINNT-BSlash-system32-BSlash-lsass.exe*Auto*Running*LocalSystemService66=SavRoam*SAVRoam*-SQuote-C:-BSlash-Program Files-BSlash-Symantec AntiVirus-BSlash-SavRoam.exe-SQuote-*Auto*Running*LocalSystemService67=SCardSvr*Smart Card*C:-BSlash-WINNT-BSlash-System32-BSlash-SCardSvr.exe*Auto*Running*NT AUTHORITY-BSlash-LocalServiceService68=Schedule*Task Scheduler*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService69=seclogon*Secondary Logon*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService70=SENS*System Event Notification*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService71=SharedAccess*Windows Firewall/Internet Connection Sharing -LParen-ICS-RParen-*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService72=ShellHWDetection*Shell Hardware Detection*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService73=SPBBCSvc*Symantec SPBBCSvc*-SQuote-C:-BSlash-Program Files-BSlash-Common Files-BSlash-Symantec Shared-BSlash-SPBBC-BSlash-SPBBCSvc.exe-SQuote-*Auto*Running*LocalSystemService74=Spooler*Print Spooler*C:-BSlash-WINNT-BSlash-system32-BSlash-spoolsv.exe*Auto*Running*LocalSystemService75=srservice*System Restore Service*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService76=SSDPSRV*SSDP Discovery Service*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k LocalService*Manual*Running*NT AUTHORITY-BSlash-LocalServiceService77=stisvc*Windows Image Acquisition -LParen-WIA-RParen-*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k imgsvc*Auto*Running*LocalSystemService78=SwPrv*MS Software Shadow Copy Provider*C:-BSlash-WINNT-BSlash-System32-BSlash-dllhost.exe /Processid:-LCBrace-9091FC78-379E-45C5-93F0-2AD6CC404A31-RCBrace-*Manual*Stopped*LocalSystemService79=Symantec AntiVirus*Symantec AntiVirus*-SQuote-C:-BSlash-Program Files-BSlash-Symantec AntiVirus-BSlash-Rtvscan.exe-SQuote-*Auto*Running*LocalSystemService80=SysmonLog*Performance Logs and Alerts*C:-BSlash-WINNT-BSlash-system32-BSlash-smlogsvc.exe*Manual*Stopped*NT Authority-BSlash-NetworkServiceService81=TapiSrv*Telephony*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Manual*Stopped*LocalSystemService82=TermService*Terminal Services*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost -k DComLaunch*Auto*Running*LocalSystemService83=Themes*Themes*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService84=TlntSvr*Telnet*C:-BSlash-WINNT-BSlash-System32-BSlash-tlntsvr.exe*Disabled*Stopped*LocalSystemService85=TrkWks*Distributed Link Tracking Client*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService86=upnphost*Universal Plug and Play Device Host*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k LocalService*Manual*Stopped*NT AUTHORITY-BSlash-LocalServiceService87=UPS*Uninterruptible Power Supply*C:-BSlash-WINNT-BSlash-System32-BSlash-ups.exe*Manual*Stopped*NT AUTHORITY-BSlash-LocalServiceService88=VSS*Volume Shadow Copy*C:-BSlash-WINNT-BSlash-System32-BSlash-vssvc.exe*Manual*Stopped*LocalSystemService89=W32Time*Windows Time*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService90=WebClient*WebClient*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k LocalService*Auto*Running*NT AUTHORITY-BSlash-LocalServiceService91=winmgmt*Windows Management Instrumentation*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService92=WmdmPmSN*Portable Media Serial Number Service*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Manual*Stopped*LocalSystemService93=Wmi*Windows Management Instrumentation Driver Extensions*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService94=WmiApSrv*WMI Performance Adapter*C:-BSlash-WINNT-BSlash-System32-BSlash-wbem-BSlash-wmiapsrv.exe*Manual*Stopped*LocalSystemService95=wscsvc*Security Center*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Stopped*LocalSystemService96=wuauserv*Automatic Updates*C:-BSlash-WINNT-BSlash-system32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService97=Wuser32*SMS Remote Control Agent*C:-BSlash-WINNT-BSlash-System32-BSlash-CCM-BSlash-CLICOMP-BSlash-RemCtrl-BSlash-Wuser32.exe*Auto*Running*LocalSystemService98=WZCSVC*Wireless Zero Configuration*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Auto*Running*LocalSystemService99=xmlprov*Network Provisioning Service*C:-BSlash-WINNT-BSlash-System32-BSlash-svchost.exe -k netsvcs*Manual*Stopped*LocalSystem[Programs]Program1=3D Pinball*C:-BSlash-Program Files-BSlash-Windows NT-BSlash-Pinball-BSlash-pinball.exe*5.1.2600.2180*CinematronicsProgram2=767 Aircraft Familiarization*767 Aircraft Familiarization*N/A*N/AProgram3=A10 Aircraft Familiarization*A10 Aircraft Familiarization*N/A*N/AProgram4=ActivCard Gold for CAC - PKI - Version 3.0 Feature Pack 1*-LCBrace-F489174B-CF14-4B4D-84BB-C1AD46EDB412-RCBrace-*3.01.1076.1*ActivCardProgram5=Address Book*C:-BSlash-Program Files-BSlash-Outlook Express-BSlash-wab.exe*6.0.2900.2180*Microsoft CorporationProgram6=Adobe Reader 7.0*C:-BSlash-Program Files-BSlash-Adobe-BSlash-Acrobat 7.0-BSlash-Reader-BSlash-AcroRd32.exe*7.0.7.142*Adobe Systems IncorporatedProgram7=Ahead Nero BurnRights*Nero BurnRights-EPoint-UninstallKey*N/A*N/AProgram8=Aircraft Familiarization - 737*-LCBrace-CEE76A20-94F7-11D4-84C9-00105AE3A578-RCBrace-*N/A*N/AProgram9=Aircraft Familiarization - 757*-LCBrace-9BD3FD30-AEBB-11D4-84D2-00105AE3A578-RCBrace-*N/A*N/AProgram10=Aircraft Familiarization - 777*-LCBrace-E8426890-4BBC-11D5-8514-00105AE3A578-RCBrace-*N/A*N/AProgram11=Authorware Runtime*c:-BSlash-ic_trng-BSlash-F-16-BSlash-logon.exe*4.0.0.0*Macromedia, Inc.Program12=Authorware Runtime*C:-BSlash-Program Files-BSlash-ic_trng-BSlash-af_737-BSlash-af737.exe*5.2.0.0*Macromedia, Inc.Program13=Authorware Runtime*C:-BSlash-Program Files-BSlash-ic_trng-BSlash-af_757-BSlash-AF757.exe*5.2.0.0*Macromedia, Inc.Program14=Authorware Runtime*C:-BSlash-Program Files-BSlash-ic_trng-BSlash-af_777-BSlash-AF777.exe*5.2.0.0*Macromedia, Inc.Program15=Authorware Runtime*C:-BSlash-Program Files-BSlash-ic_trng-BSlash-consp2-BSlash-CS2.exe*5.1.0.0*Macromedia, Inc.Program16=Authorware Runtime*C:-BSlash-Program Files-BSlash-ic_trng-BSlash-consp3-BSlash-cs3logon.exe*5.1.0.0*Macromedia, Inc.Program17=Authorware Runtime*C:-BSlash-Program Files-BSlash-ic_trng-BSlash-consp4-BSlash-cs4.exe*5.2.0.0*Macromedia, Inc.Program18=Authorware Runtime*C:-BSlash-Program Files-BSlash-ic_trng-BSlash-fa_fr-BSlash-fafr.exe*6.0.0.0*Macromedia, Inc.Program19=C-130*C-130*N/A*N/AProgram20=CommVault Systems DataMigrator Outlook Add-In*-LCBrace-49CE7E71-9F17-4B93-82E0-E1F1EF02DCDC-RCBrace-*6.1.2*CommVault SystemsProgram21=Config Safe*ConfigSafe*N/A*N/AProgram22=Confined Space Series: Awareness*-LCBrace-D26E9092-C84E-11D3-B964-00403394B10A-RCBrace-*N/A*N/AProgram23=Confined Space Series: Operations*-LCBrace-7DDC47B2-F51D-11D3-8428-00105AE3A578-RCBrace-*N/A*N/AProgram24=Confined Space Series: Support Material*-LCBrace-6F2F9B72-17B3-11D4-846C-00105AE3A578-RCBrace-*N/A*N/AProgram25=Confined Space Series: Technician*-LCBrace-7F04CFAF-0C79-11D4-8450-00105AE3A578-RCBrace-*N/A*N/AProgram26=Cover Designer*C:-BSlash-Program Files-BSlash-Ahead-BSlash-CoverDesigner-BSlash-CoverDes.exe*2.3.0.4*Ahead Software AGProgram27=COVER Train 2.0 Adminstrator*InstallShield_-LCBrace-ED71D4CC-3810-4CD9-9E3C-D87FC2945F3F-RCBrace-*2.0.27*C2 Technologies, Inc.Program28=COVER Train Patch 2.0.53*InstallShield_-LCBrace-1804DB0C-D502-4759-8865-4072547B1A99-RCBrace-*2.0.53*C2 Technologies, IncProgram29=DBsign Client Configuration Utility*C:-BSlash-Program Files-BSlash-Gradkell Systems, Inc-BSlash-DBsign Web Signer-BSlash-lib-BSlash-DBsignClientConfig.exe*2.3.6.0*Gradkell Systems, Inc.Program30=DoMore*-LCBrace-E5B26C1E-4751-4F03-BC18-634F41F31EC6-RCBrace-*1*N/AProgram31=F-117A Aircraft Familiarization*F-117A Aircraft Familiarization*N/A*N/AProgram32=F-15 Familiarization Training*F-15 Familiarization Training*N/A*N/AProgram33=F-16 Familiarization Training II*F-16 Familiarization Training II*N/A*N/AProgram34=Files and Settings Transfer Wizard*C:-BSlash-WINNT-BSlash-system32-BSlash-usmt-BSlash-migwiz.exe*5.1.2600.2180*Microsoft CorporationProgram35=First Aid First Responder*-LCBrace-E9EEC450-E6C2-11D5-8526-00105AE3A578-RCBrace-*N/A*N/AProgram36=Flash Player 5.0 r30*C:-BSlash-Program Files-BSlash-ic_trng-BSlash-CSSM-BSlash-cssm.exe*5.0.30.0*Macromedia, Inc.Program37=FormFlow 2.22 Filler*FormFlow 2.2 Filler*N/A*N/AProgram38=FormFlow Filler*C:-BSlash-FormFlow-BSlash-DFFILL.EXE*2.1.0.0*JetFormProgram39=Gateway Ink Monitor*C:-BSlash-Program Files-BSlash-Gateway Utilities-BSlash-GWInkMonitor.exe*1.0.0.21*GatewayProgram40=High Definition Audio Driver Package - KB888111*KB888111WXPSP2*20040219.000000*Microsoft CorporationProgram41=HyperTerminal Applet*C:-BSlash-Program Files-BSlash-Windows NT-BSlash-hypertrm.exe*5.1.2600.0*Hilgraeve, Inc.Program42=ICS Viewer 6.0*-LCBrace-E0000600-0600-0600-0600-000000000600-RCBrace-*N/A*N/AProgram43=ICS Viewer*C:-BSlash-Program Files-BSlash-PureEdge-BSlash-Viewer 6.0-BSlash-masqform.exe*6.0.1.51*PureEdge Solutions Inc.Program44=Intel-LParen-R-RParen- PRO Network Adapters and Drivers*PROSet*N/A*N/AProgram45=Intel-LParen-R-RParen- PROSet for Wired Connections*-LCBrace-16906D21-0656-4F8B-9A01-C3D24B5401FC-RCBrace-*7.10.0000*IntelProgram46=InterActual Player*InterActual Player*N/A*N/AProgram47=Internet Connection Wizard*C:-BSlash-Program Files-BSlash-Internet Explorer-BSlash-Connection Wizard-BSlash-ICWCONN1.EXE*6.0.2900.2180*Microsoft CorporationProgram48=Internet Connection Wizard*C:-BSlash-Program Files-BSlash-Internet Explorer-BSlash-Connection Wizard-BSlash-ICWCONN2.EXE*6.0.2900.2180*Microsoft CorporationProgram49=Internet Connection Wizard*C:-BSlash-Program Files-BSlash-Internet Explorer-BSlash-Connection Wizard-BSlash-INETWIZ.EXE*6.0.2900.2180*Microsoft CorporationProgram50=Internet Explorer Q903235*Q903235*N/A*Microsoft CorporationProgram51=Internet Explorer*C:-BSlash-Program Files-BSlash-Internet Explorer-BSlash-iexplore.exe*6.0.2900.2180*Microsoft CorporationProgram52=Internet Signup*C:-BSlash-Program Files-BSlash-Internet Explorer-BSlash-Connection Wizard-BSlash-ISIGNUP.EXE*6.0.2600.0*Microsoft CorporationProgram53=J2SE Runtime Environment 5.0 Update 6*-LCBrace-3248F0A8-6813-11D6-A77B-00B0D0150060-RCBrace-*1.5.0.60*Sun Microsystems, Inc.Program54=Java 2 Runtime Environment, SE v1.4.2_10*-LCBrace-7148F0A8-6813-11D6-A77B-00B0D0142100-RCBrace-*1.4.2_10*Sun Microsystems, Inc.Program55=Java-LParen-TM-RParen- Web Start Launcher*C:-BSlash-Program Files-BSlash-Java-BSlash-jre1.5.0_06-BSlash-bin-BSlash-javaws.exe*5.0.60.5*Sun Microsystems, Inc.Program56=knowledgeWorks LMS*-LCBrace-E85FAB4B-AC88-4885-9369-B033F06B4643-RCBrace-*N/A*N/AProgram57=LiveUpdate Wizard*C:-BSlash-PROGRA-Tilde-1-BSlash-Symantec-BSlash-LiveUpdate-BSlash-LUALL.EXE*3.0.0.160*Symantec CorporationProgram58=Macromedia Flash Player 8*-LCBrace-6815FCDD-401D-481E-BA88-31B4754C2B46-RCBrace-*8.0.22.0*MacromediaProgram59=Macromedia Shockwave Player*Macromedia Shockwave Player*10.1.0.11*Macromedia, Inc.Program60=MFC-Anwendung NeroBurnRightsExe*C:-BSlash-Program Files-BSlash-Ahead-BSlash-NeroBurnRights-BSlash-NeroBurnRights.exe*1.0.0.7*Ahead Software AGProgram61=Microsoft -LParen-R-RParen- Address Book Import Tool*C:-BSlash-Program Files-BSlash-Outlook Express-BSlash-wabmig.exe*6.0.2900.2180*Microsoft CorporationProgram62=Microsoft .NET Framework 1.1 Hotfix -LParen-KB886903-RParen-*M886903*N/A*N/AProgram63=Microsoft Data Access Components KB870669*KB870669*N/A*Microsoft CorporationProgram64=Microsoft DirectX Diagnostic Tool*C:-BSlash-WINNT-BSlash-System32-BSlash-dxdiag.exe*5.3.2600.2180*Microsoft CorporationProgram65=Microsoft Help and Support Center*C:-BSlash-WINNT-BSlash-PCHealth-BSlash-HelpCtr-BSlash-Binaries-BSlash-HelpCtr.exe*5.1.2600.2180*Microsoft CorporationProgram66=Microsoft Office Access*C:-BSlash-PROGRA-Tilde-1-BSlash-MICROS-Tilde-3-BSlash-OFFICE11-BSlash-MSACCESS.EXE*11.0.6566.0*Microsoft CorporationProgram67=Microsoft Office Document Imaging*C:-BSlash-PROGRA-Tilde-1-BSlash-COMMON-Tilde-1-BSlash-MICROS-Tilde-1-BSlash-MODI-BSlash-11.0-BSlash-MSPVIEW.EXE*11.0.1897.0*Microsoft CorporationProgram68=Microsoft Office Excel*C:-BSlash-PROGRA-Tilde-1-BSlash-MICROS-Tilde-3-BSlash-OFFICE11-BSlash-EXCEL.EXE*11.0.8033.0*Microsoft CorporationProgram69=Microsoft Office FrontPage*C:-BSlash-PROGRA-Tilde-1-BSlash-MICROS-Tilde-3-BSlash-OFFICE11-BSlash-FRONTPG.EXE*11.0.6552.0*Microsoft CorporationProgram70=Microsoft Office InfoPath*C:-BSlash-Program Files-BSlash-Microsoft Office-BSlash-OFFICE11-BSlash-INFOPATH.EXE*11.0.6565.0*Microsoft CorporationProgram71=Microsoft Office Outlook*C:-BSlash-PROGRA-Tilde-1-BSlash-MICROS-Tilde-3-BSlash-OFFICE11-BSlash-OUTLOOK.EXE*11.0.8010.0*Microsoft CorporationProgram72=Microsoft Office Picture Manager*C:-BSlash-PROGRA-Tilde-1-BSlash-MICROS-Tilde-3-BSlash-OFFICE11-BSlash-OIS.EXE*11.0.6550.0*Microsoft CorporationProgram73=Microsoft Office PowerPoint*C:-BSlash-PROGRA-Tilde-1-BSlash-MICROS-Tilde-3-BSlash-OFFICE11-BSlash-POWERPNT.EXE*11.0.8024.0*Microsoft CorporationProgram74=Microsoft Office Professional Edition 2003*-LCBrace-90110409-6000-11D3-8CFE-0150048383C9-RCBrace-*11.0.7969.0*Microsoft CorporationProgram75=Microsoft Office Publisher*C:-BSlash-PROGRA-Tilde-1-BSlash-MICROS-Tilde-3-BSlash-OFFICE11-BSlash-MSPUB.EXE*11.0.6565.0*Microsoft CorporationProgram76=Microsoft Office Word*C:-BSlash-PROGRA-Tilde-1-BSlash-MICROS-Tilde-3-BSlash-OFFICE11-BSlash-WINWORD.EXE*11.0.8026.0*Microsoft CorporationProgram77=Microsoft Schedule+ for Windows 95 application file*C:-BSlash-PROGRA-Tilde-1-BSlash-MICROS-Tilde-3-BSlash-OFFICE11-BSlash-1033-BSlash-SCHDPL32.EXE*7.5.1457.3*Microsoft CorporationProgram78=msn*C:-BSlash-Program Files-BSlash-MSN-BSlash-MSNCoreFiles-BSlash-MSN6.exe*7.2.5.2202*Microsoft CorporationProgram79=MyODBC*-LCBrace-29042B1C-0713-4575-B7CA-5C8E7B0899D4-RCBrace-*3.51.11*MySQLProgram80=Nero Burning ROM*C:-BSlash-Program Files-BSlash-Ahead-BSlash-nero-BSlash-nero.exe*6.0.0.20*Ahead Software AGProgram81=Nero OEM*Nero - Burning Rom-EPoint-UninstallKey*N/A*N/AProgram82=Nero StartSmart*C:-BSlash-Program Files-BSlash-Ahead-BSlash-Nero StartSmart-BSlash-NeroStartSmart.exe*1.0.0.11*Ahead Software AGProgram83=NVIDIA Drivers*NVIDIA Drivers*N/A*N/AProgram84=Oracle JInitiator 1.1.8.11*Oracle JInitiator 1.1.8.11*N/A*N/AProgram85=Oracle JInitiator 1.3.1.6*Oracle JInitiator 1.3.1.6*N/A*N/AProgram86=Outlook Express*C:-BSlash-Program Files-BSlash-Outlook Express-BSlash-msimn.exe*6.0.2900.2180*Microsoft CorporationProgram87=Paint*C:-BSlash-WINNT-BSlash-system32-BSlash-mspaint.exe*5.1.2600.2180*Microsoft CorporationProgram88=PC-Doctor for Windows*-LCBrace-1F7CCFA3-D926-4882-B2A5-A0217ED25597-RCBrace-*N/A*N/AProgram89=PictureViewer Application*C:-BSlash-PROGRA-Tilde-1-BSlash-QUICKT-Tilde-1-BSlash-PictureViewer.exe*4.0.0.155*Apple Computer, Inc.Program90=QuickTime for Windows -LParen-32-bit-RParen-*QuickTime32*N/A*N/AProgram91=QuickTime Player Application*C:-BSlash-PROGRA-Tilde-1-BSlash-QUICKT-Tilde-1-BSlash-QuickTimePlayer.exe*4.0.1.9*Apple Computer, Inc.Program92=Security Update for Step By Step Interactive Training -LParen-KB898458-RParen-*KB898458*20050502.101010*Microsoft CorporationProgram93=Security Update for Windows Media Player -LParen-KB911564-RParen-*KB911564*N/A*Microsoft CorporationProgram94=Security Update for Windows Media Player 9 -LParen-KB911565-RParen-*KB911565*N/A*Microsoft CorporationProgram95=Security Update for Windows Media Player 9 -LParen-KB917734-RParen-*KB917734_WMP9*N/A*Microsoft CorporationProgram96=Security Update for Windows XP -LParen-KB883939-RParen-*KB883939*1*Microsoft CorporationProgram97=Security Update for Windows XP -LParen-KB890046-RParen-*KB890046*1*Microsoft CorporationProgram98=Security Update for Windows XP -LParen-KB893756-RParen-*KB893756*1*Microsoft CorporationProgram99=Security Update for Windows XP -LParen-KB896358-RParen-*KB896358*1*Microsoft CorporationProgram100=Security Update for Windows XP -LParen-KB896422-RParen-*KB896422*1*Microsoft CorporationProgram101=Security Update for Windows XP -LParen-KB896423-RParen-*KB896423*1*Microsoft CorporationProgram102=Security Update for Windows XP -LParen-KB896424-RParen-*KB896424*1*Microsoft CorporationProgram103=Security Update for Windows XP -LParen-KB896428-RParen-*KB896428*1*Microsoft CorporationProgram104=Security Update for Windows XP -LParen-KB896688-RParen-*KB896688*1*Microsoft CorporationProgram105=Security Update for Windows XP -LParen-KB899587-RParen-*KB899587*1*Microsoft CorporationProgram106=Security Update for Windows XP -LParen-KB899588-RParen-*KB899588*1*Microsoft CorporationProgram107=Security Update for Windows XP -LParen-KB899589-RParen-*KB899589*1*Microsoft CorporationProgram108=Security Update for Windows XP -LParen-KB899591-RParen-*KB899591*1*Microsoft CorporationProgram109=Security Update for Windows XP -LParen-KB900725-RParen-*KB900725*1*Microsoft CorporationProgram110=Security Update for Windows XP -LParen-KB901017-RParen-*KB901017*1*Microsoft CorporationProgram111=Security Update for Windows XP -LParen-KB901214-RParen-*KB901214*1*Microsoft CorporationProgram112=Security Update for Windows XP -LParen-KB902400-RParen-*KB902400*1*Microsoft CorporationProgram113=Security Update for Windows XP -LParen-KB904706-RParen-*KB904706*1*Microsoft CorporationProgram114=Security Update for Windows XP -LParen-KB905414-RParen-*KB905414*1*Microsoft CorporationProgram115=Security Update for Windows XP -LParen-KB905749-RParen-*KB905749*1*Microsoft CorporationProgram116=Security Update for Windows XP -LParen-KB905915-RParen-*KB905915*1*Microsoft CorporationProgram117=Security Update for Windows XP -LParen-KB908519-RParen-*KB908519*1*Microsoft CorporationProgram118=Security Update for Windows XP -LParen-KB908531-RParen-*KB908531*1*Microsoft CorporationProgram119=Security Update for Windows XP -LParen-KB911280-RParen-*KB911280*1*Microsoft CorporationProgram120=Security Update for Windows XP -LParen-KB911562-RParen-*KB911562*1*Microsoft CorporationProgram121=Security Update for Windows XP -LParen-KB911567-RParen-*KB911567*1*Microsoft CorporationProgram122=Security Update for Windows XP -LParen-KB911927-RParen-*KB911927*1*Microsoft CorporationProgram123=Security Update for Windows XP -LParen-KB912812-RParen-*KB912812*1*Microsoft CorporationProgram124=Security Update for Windows XP -LParen-KB912919-RParen-*KB912919*1*Microsoft CorporationProgram125=Security Update for Windows XP -LParen-KB913446-RParen-*KB913446*1*Microsoft CorporationProgram126=Security Update for Windows XP -LParen-KB913580-RParen-*KB913580*1*Microsoft CorporationProgram127=Security Update for Windows XP -LParen-KB914388-RParen-*KB914388*1*Microsoft CorporationProgram128=Security Update for Windows XP -LParen-KB914389-RParen-*KB914389*1*Microsoft CorporationProgram129=Security Update for Windows XP -LParen-KB916281-RParen-*KB916281*1*Microsoft CorporationProgram130=Security Update for Windows XP -LParen-KB917159-RParen-*KB917159*1*Microsoft CorporationProgram131=Security Update for Windows XP -LParen-KB917344-RParen-*KB917344*1*Microsoft CorporationProgram132=Security Update for Windows XP -LParen-KB917953-RParen-*KB917953*1*Microsoft CorporationProgram133=Security Update for Windows XP -LParen-KB918439-RParen-*KB918439*1*Microsoft CorporationProgram134=SMS Advanced Client*-LCBrace-9092C0B8-D5F3-4BF9-808D-20892DEB4F8B-RCBrace-*2.50.3174.1152*Microsoft CorporationProgram135=Symantec AntiVirus*C:-BSlash-Program Files-BSlash-Symantec AntiVirus-BSlash-VPC32.exe*10.1.0.401*Symantec CorporationProgram136=Symantec AntiVirus*C:-BSlash-PROGRA-Tilde-1-BSlash-SYMANT-Tilde-2-BSlash-VPTray.exe*10.1.0.401*Symantec CorporationProgram137=Symantec User Session*C:-BSlash-Program Files-BSlash-Common Files-BSlash-Symantec Shared-BSlash-ccApp.exe*104.0.8.3*Symantec CorporationProgram138=System Configuration Utility*C:-BSlash-WINNT-BSlash-PCHealth-BSlash-HelpCtr-BSlash-Binaries-BSlash-MSConfig.exe*5.1.2600.2180*Microsoft CorporationProgram139=System Information*C:-BSlash-Program Files-BSlash-Common Files-BSlash-Microsoft Shared-BSlash-MSInfo-BSlash-MSInfo32.exe*5.1.2600.0*Microsoft CorporationProgram140=T-38 Familiarization Training*T-38 Familiarization Training*N/A*N/AProgram141=TAPI 3.0 Dialer and IP Multicast Conference Viewer*C:-BSlash-Program Files-BSlash-Windows NT-BSlash-dialer.exe*5.1.2600.2180*Microsoft CorporationProgram142=Update for Windows XP -LParen-KB896727-RParen-*KB896727*1*Microsoft CorporationProgram143=Update for Windows XP -LParen-KB898461-RParen-*KB898461*1*Microsoft CorporationProgram144=Update for Windows XP -LParen-KB910437-RParen-*KB910437*1*Microsoft CorporationProgram145=WebFldrs XP*-LCBrace-350C97B0-3D7C-4EE8-BAA9-00BCB3D54227-RCBrace-*9.50.6513*Microsoft CorporationProgram146=Windows Installer 3.1 -LParen-KB893803-RParen-*KB893803v2*3.1*Microsoft CorporationProgram147=Windows Media Player*C:-BSlash-Program Files-BSlash-Windows Media Player-BSlash-mplayer2.exe*6.4.9.1125*Microsoft CorporationProgram148=Windows Media Player*C:-BSlash-Program Files-BSlash-Windows Media Player-BSlash-wmplayer.exe*9.0.0.3250*Microsoft CorporationProgram149=Windows Messenger*C:-BSlash-Program Files-BSlash-Messenger-BSlash-msmsgs.exe*4.7.0.3001*Microsoft CorporationProgram150=Windows Movie Maker*C:-BSlash-Program Files-BSlash-Movie Maker-BSlash-moviemk.exe*2.1.4026.0*Microsoft CorporationProgram151=Windows Sasser Worm Removal Tool -LParen-KB841720-RParen-*KB841720*N/A*Microsoft CorporationProgram152=Windows XP Hotfix - KB873333*KB873333*20050114.005213*Microsoft CorporationProgram153=Windows XP Hotfix - KB873339*KB873339*20041117.092459*Microsoft CorporationProgram154=Windows XP Hotfix - KB885250*KB885250*20050118.202711*Microsoft CorporationProgram155=Windows XP Hotfix - KB885835*KB885835*20041027.181713*Microsoft CorporationProgram156=Windows XP Hotfix - KB885836*KB885836*20041028.173203*Microsoft CorporationProgram157=Windows XP Hotfix - KB885884*KB885884*20040924.025457*Microsoft CorporationProgram158=Windows XP Hotfix - KB886185*KB886185*20041021.090540*Microsoft CorporationProgram159=Windows XP Hotfix - KB887472*KB887472*20041014.162858*Microsoft CorporationProgram160=Windows XP Hotfix - KB887742*KB887742*20041103.095002*Microsoft CorporationProgram161=Windows XP Hotfix - KB888113*KB888113*20041116.131036*Microsoft CorporationProgram162=Windows XP Hotfix - KB888302*KB888302*20041207.111426*Microsoft CorporationProgram163=Windows XP Hotfix - KB890175*KB890175*20041201.233338*Microsoft CorporationProgram164=Windows XP Hotfix - KB890859*KB890859*1*Microsoft CorporationProgram165=Windows XP Hotfix - KB890923*KB890923*1*Microsoft CorporationProgram166=Windows XP Hotfix - KB891781*KB891781*20050110.165439*Microsoft CorporationProgram167=Windows XP Hotfix - KB893066*KB893066*1*Microsoft CorporationProgram168=Windows XP Hotfix - KB893086*KB893086*1*Microsoft CorporationProgram169=Windows XP Service Pack 2*Windows XP Service Pack*20040803.231319*Microsoft CorporationProgram170=Windows® NetMeeting®*C:-BSlash-Program Files-BSlash-NetMeeting-BSlash-conf.exe*5.1.2600.2180*Microsoft CorporationProgram171=WinDVD MFC Application*C:-BSlash-Program Files-BSlash-DVD-BSlash-DVD Player-BSlash-WinDVD.exe*4.0.11.237*InterVideo Inc.Program172=WinZip*C:-BSlash-Program Files-BSlash-WinZip-BSlash-winzip32.exe*18.0.6224.0*WinZip Computing, Inc.Program173=WordPad MFC Application*C:-BSlash-Program Files-BSlash-Windows NT-BSlash-Accessories-BSlash-WORDPAD.EXE*5.1.2600.2180*Microsoft CorporationProgram174=XML Editor*C:-BSlash-Program Files-BSlash-Common Files-BSlash-Microsoft Shared-BSlash-OFFICE11-BSlash-MSOXMLED.EXE*11.0.5510.0*Microsoft CorporationProgram175=Zone Datafile*C:-BSlash-Program Files-BSlash-MSN Gaming Zone-BSlash-Windows-BSlash-bckgzm.exe*1.2.626.1*Microsoft CorporationProgram176=Zone Datafile*C:-BSlash-Program Files-BSlash-MSN Gaming Zone-BSlash-Windows-BSlash-chkrzm.exe*1.2.626.1*Microsoft CorporationProgram177=Zone Datafile*C:-BSlash-Program Files-BSlash-MSN Gaming Zone-BSlash-Windows-BSlash-hrtzzm.exe*1.2.626.1*Microsoft CorporationProgram178=Zone Datafile*C:-BSlash-Program Files-BSlash-MSN Gaming Zone-BSlash-Windows-BSlash-rvsezm.exe*1.2.626.1*Microsoft CorporationProgram179=Zone Datafile*C:-BSlash-Program Files-BSlash-MSN Gaming Zone-BSlash-Windows-BSlash-shvlzm.exe*1.2.626.1*Microsoft Corporation[/code] Quote Link to comment Share on other sites More sharing options...
thepip3r Posted July 25, 2006 Author Share Posted July 25, 2006 [continuation from previous post...]that's one example file that a computer will write to my logging location on the web server. Then I have a PHP script that I have set to run every 5 mins that's supposed to open up those INI files, read the contents, compare the contents to the info in the DB, and then either just move on or append new information if there is any. The thing is, when I was running this on a test scenario, (computers number < 1000) everything worked great. Now that I started running it live on our network (> 3000 systems) the PHP script can't keep up with the number of users logging in each time. so the report on the last time the PHP script ran was that it took 17 hrs to parse 1500 systems. and i've watched the process run and Shoz was right, the PHP.exe just sits there and about every 8 secs or so, it shows 1% CPU usage and MySQL stays around 40% usage the whole time.The data collection part works flawlessly so far. It's the INI file reposity to database synchronization where my script is hanging up. Here is my dump of tables from phpmyadmin:[code]Database inventory_agent running on localhost# phpMyAdmin MySQL-Dump# version 2.2.3# http://phpwizard.net/phpMyAdmin/# http://phpmyadmin.sourceforge.net/ (download page)## Host: localhost# Generation Time: Jul 25, 2006 at 11:44 AM# Server version: 5.00.22# PHP Version: 5.1.4# Database : `inventory_agent`# --------------------------------------------------------## Table structure for table `computer_process_ids`#CREATE TABLE computer_process_ids ( id int(11) NOT NULL auto_increment, computer_id int(11) NOT NULL default '0', process_id int(11) NOT NULL default '0', process_info_id int(11) default '0', `timestamp` int(11) NOT NULL default '0', PRIMARY KEY (id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `computer_program_ids`#CREATE TABLE computer_program_ids ( id int(11) NOT NULL auto_increment, computer_id int(11) NOT NULL default '0', program_id int(11) NOT NULL default '0', program_info_id int(11) NOT NULL default '0', `timestamp` int(11) NOT NULL default '0', PRIMARY KEY (id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `computer_service_ids`#CREATE TABLE computer_service_ids ( id int(11) NOT NULL auto_increment, computer_id int(11) NOT NULL default '0', service_id int(11) NOT NULL default '0', service_info_id int(11) NOT NULL default '0', `timestamp` int(11) NOT NULL default '0', PRIMARY KEY (id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `computer_username_ids`#CREATE TABLE computer_username_ids ( id int(11) NOT NULL auto_increment, computer_id int(11) default '0', username_id int(11) default '0', `timestamp` int(11) NOT NULL default '0', PRIMARY KEY (id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `computers`#CREATE TABLE computers ( id int(11) NOT NULL auto_increment, hostname varchar(20) NOT NULL default '', ip varchar(32) NOT NULL default '', mac varchar(20) NOT NULL default '', os varchar(50) NOT NULL, os_ver varchar(30) NOT NULL default '', scriptruntime int(11) NOT NULL default '0', `timestamp` int(11) NOT NULL default '0', PRIMARY KEY (id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `process_info`#CREATE TABLE process_info ( id int(11) NOT NULL auto_increment, path text NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `processes`#CREATE TABLE processes ( id int(11) NOT NULL auto_increment, `name` varchar(50) default NULL, PRIMARY KEY (id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `program_info`#CREATE TABLE program_info ( id int(11) NOT NULL auto_increment, path text NOT NULL, version varchar(75) NOT NULL, publisher varchar(150) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `programs`#CREATE TABLE programs ( id int(11) NOT NULL auto_increment, `name` varchar(150) NOT NULL, PRIMARY KEY (id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `script_execution`#CREATE TABLE script_execution ( id int(11) NOT NULL auto_increment, `timestamp` int(11) NOT NULL default '0', number_of_computers int(11) NOT NULL default '0', `status` tinyint(4) NOT NULL default '0', scriptruntime int(11) NOT NULL default '0', PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `script_execution_errors`#CREATE TABLE script_execution_errors ( id int(11) NOT NULL auto_increment, section varchar(50) NOT NULL, mysql_error text NOT NULL, computers int(11) NOT NULL, `timestamp` int(11) NOT NULL, PRIMARY KEY (id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `service_info`#CREATE TABLE service_info ( id int(11) NOT NULL auto_increment, path text NOT NULL, startup_type varchar(20) NOT NULL, `status` varchar(20) NOT NULL, authority varchar(75) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `services`#CREATE TABLE services ( id int(11) NOT NULL auto_increment, `name` varchar(100) default NULL, display_name varchar(150) default NULL, PRIMARY KEY (id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;# --------------------------------------------------------## Table structure for table `usernames`#CREATE TABLE usernames ( id int(11) NOT NULL auto_increment, username varchar(30) NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=latin1; [/code]and here is the script for synchronization if anyone can offer me pointers anywhere, i would be soooooo greatly appreciative. I know this is a whole crap-load of information but i don't know anyone else to ask as I'm the only one who works on projects like these where i work and i've never been in an actual PHP development team before so i don't know any other avenues or colleagues i can turn to. =/[code]<?set_time_limit(0);require ('functions.php');function logErrors($section, $mysqlError, $computers) { global $ScriptStartTime; $ScriptEndTime = microtime_float(); $ScriptRunTime = $ScriptEndTime - $ScriptStartTime; $Timestamp = strtotime("now"); $ScriptSQL = "INSERT INTO script_execution (timestamp,number_of_computers,scriptruntime,status) VALUES('".strtotime("now")."','$computers','".round($ScriptRunTime)."','1')"; $ScriptResult = mysql_query($ScriptSQL) or die("Script logging function failed, please contact your administrator.\n $ScriptSQL \n".mysql_error()); $ErrorResult = mysql_query("INSERT INTO script_execution_errors (section,mysql_error,computers,timestamp) VALUES('$section','test','$computers','$Timestamp')") or die ("Error log update failed.\n".mysql_error());}$ScriptStartTime = microtime_float();db_open();$INIPath = "e:\\inventory_agent\\data\\INIs\\";$ComputerCount = 1;if (is_dir($INIPath)) { if ($INIDH = opendir($INIPath)) { while (($INIFile = readdir($INIDH)) !== false) { $INISub = SubStr($INIFile,-4,4); $HostName = SubStr($INIFile,0,StrLen($INIFile)-4); if ($INISub == '.ini') { if (is_file($INIPath.$INIFile)) { $ini_array = parse_ini_file($INIPath.$INIFile, true); $Timestamp = $ini_array['General']['Timestamp']; # Write each elements section and value to it's own variable name and value if (is_array($ini_array['General'])) { foreach ($ini_array['General'] as $key => $val) { $$key = $val; } # Create the SQL statement, query to see if a record exists for that hostname, and count the number of results $sql = "SELECT * FROM computers WHERE hostname='$Hostname'"; $result = mysql_query($sql) or die("SQL query failed, please contact your administrator. Reported Error: ".logErrors('general',mysql_error(),$ComputerCount)."\n"); $count = mysql_num_rows($result); # If no record exists, write that hostname's information to the database if ($count == 0) { $result2 = mysql_query("INSERT INTO computers (hostname,ip,mac,os,os_ver,scriptruntime) VALUES('$Hostname','$IP','$MAC','$OS','$Ver','$ScriptRunTime')") or die("SQL query failed on $hostname. Reported Error: ".logErrors('general',mysql_error(),$ComputerCount)."\n"); # If a record already exists, check to see if any of the values have changed; if they have, dynamically create the SQL statement to only update the changes and do it } elseif ($count == 1) { while ($row = mysql_fetch_assoc($result)) { if ($Hostname != $row['hostname']) $temp['hostname'] = $Hostname; if ($IP != $row['ip']) $temp['ip'] = $IP; if ($MAC != $row['mac']) $temp['mac'] = $MAC; if ($OS != $row['os']) $temp['os'] = $OS; if ($Ver != $row['os_ver']) $temp['os_ver'] = $Ver; if ($ScriptRunTime != $row['scriptruntime']) $temp['scriptruntime'] = $ScriptRunTime; if ($Timestamp != $row['Timestamp']) $temp['Timestamp'] = $Timestamp; $sql2 = "UPDATE computers SET "; if (is_array($temp)) { foreach ($temp as $key2 => $val2) { if ($val2 == end($temp)) { $sql2 .= "$key2='$val2'"; } else { $sql2 .= "$key2='$val2',"; } } $sql2 .= " WHERE hostname='$Hostname'"; $result2 = mysql_query($sql2) or die("Updating ".$hostname."'s records failed. Reported Error: ".logErrors('general',mysql_error(),$ComputerCount)."\n"); } } # If there is either more than 1 record in the DB for that hostname or a different error occurred, halt script execution } elseif ($count > 1) { fwrite(STDOUT, "Multiple computer accounts with the same name exist in the DB."); } else { fwrite(STDOUT, "An unforseen error has occurred. Please contact your site administrator."); exit; } } else { fwrite(STDOUT, "The array for 'General' information could not be created on $INIPath$INIFile.\n"); unlink($INIPath.$INIFile); continue; } # Grab the id field of the computer we're trying to add information to $CompIDResult = mysql_query("SELECT id FROM computers WHERE hostname='$HostName'") or die("Computer ID selection failed, please contact your site administrator. Reported Error: ".logErrors('compidl',mysql_error(),$ComputerCount)."\n"); $CompIDCount = mysql_num_rows($CompIDResult); $CompIDRow = mysql_fetch_row($CompIDResult); $CompID = $CompIDRow[0]; if (!isset($CompID)) { fwrite(STDOUT, "Computer ID query failed. This is most likely the result of needing to run the Exec General INI again."); exit; } if (is_array($ini_array['Processes'])) { # Iterate all processes that are running when the user logs on, verify that they exist in the DB, or write them to the database foreach ($ini_array['Processes'] as $Proc) { list($ProcName,$ProcPath,$ProcVersion,$ProcPublisher) = explode("*",$Proc); $ProcResult = mysql_query("SELECT * FROM processes WHERE name='$ProcName'") or die("Process verification query failed, please contact your site administrator. Reported Error: ".logErrors('processes',mysql_error(),$ComputerCount)."\n"); $ProcCount = mysql_num_rows($ProcResult); if ($ProcCount == 0) { $ProcResult2 = mysql_query("INSERT INTO processes (name) VALUES('$ProcName')") or die("Process SQL INSERT failed for $ProcName, please contact your site administrator Reported Error: ".logErrors('processes',mysql_error(),$ComputerCount)."\n"); $ProcID = mysql_insert_id(); $ProcResult3 = mysql_query("SELECT * FROM process_info WHERE path='$ProcPath'") or die("Process information query failed, please contact your site administrator. Reported Error: ".logErrors('processes',mysql_error(),$ComputerCount)."\n"); $ProcCount2 = mysql_num_rows($ProcResult3); if ($ProcCount2 == 0) { $ProcResult4 = mysql_query("INSERT INTO process_info (path) VALUES('$ProcPath')") or die("Process information insert failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcInfoID = mysql_insert_id(); $ProcResult5 = mysql_query("INSERT INTO computer_process_ids (computer_id,process_id,process_info_id,timestamp) VALUES('$CompID','$ProcID','$ProcInfoID','$Timestamp')") or die("Process ID insert failed(1), please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } elseif ($ProcCount2 == 1) { $ProcInfoRow = mysql_fetch_row($ProcResult3); $ProcInfoID = $ProcInfoRow[0]; $ProcResult5 = mysql_query("SELECT * FROM computer_process_ids WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID selection for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcCount3 = mysql_num_rows($ProcResult5); if ($ProcCount3 == 0) { $ProcResult5 = mysql_query("INSERT INTO computer_process_ids (computer_id,process_id,process_info_id,timestamp) VALUES('$CompID','$ProcID','$ProcInfoID','$Timestamp')") or die("Process ID insert failed(2), please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } else { $ProcResult6 = msyql_query("UPDATE computer_process_ids SET timestamp='$Timestamp' WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID update for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the processes for $HostName.\n"); } } elseif ($ProcCount == 1) { #fwrite(STDOUT, "Process $ProcName has already been added to the database.\n"; $ProcIDRow = mysql_fetch_row($ProcResult); $ProcID = $ProcIDRow[0]; $ProcResult3 = mysql_query("SELECT * FROM process_info WHERE path='$ProcPath'") or die("Process information query failed, please contact your site administrator. Reported Error: ".logErrors('processes',mysql_error(),$ComputerCount)."\n"); $ProcCount2 = mysql_num_rows($ProcResult3); if ($ProcCount2 == 0) { $ProcResult4 = mysql_query("INSERT INTO process_info (path) VALUES('$ProcPath')") or die("Process information insert failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcInfoID = mysql_insert_id(); $ProcResult5 = mysql_query("SELECT * FROM computer_process_ids WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID selection for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcCount3 = mysql_num_rows($ProcResult5); if ($ProcCount3 == 0) { $ProcResult5 = mysql_query("INSERT INTO computer_process_ids (computer_id,process_id,process_info_id,timestamp) VALUES('$CompID','$ProcID','$ProcInfoID','$Timestamp')") or die("Process ID insert failed(3), please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } else { $ProcResult6 = msyql_query("UPDATE computer_process_ids SET timestamp='$Timestamp' WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID update for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); } } elseif ($ProcCount2 == 1) { $ProcInfoRow = mysql_fetch_row($ProcResult3); $ProcInfoID = $ProcInfoRow[0]; $ProcResult5 = mysql_query("SELECT * FROM computer_process_ids WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID selection for processes failed, please contact your site administrator.\n".logErrors('processes',mysql_error(),$ComputerCount)); $ProcCount3 = mysql_num_rows($ProcResult5); if ($ProcCount3 == 0) { $ProcResult5 = mysql_query("INSERT INTO computer_process_ids (computer_id,process_id,process_info_id,timestamp) VALUES('$CompID','$ProcID','$ProcInfoID','$Timestamp')") or die("Process ID insert failed(4), please contact your site administrator.\n Timestamp: $Timestamp \n Hostname: $HostName \n".logErrors('processes',mysql_error(),$ComputerCount)); } else { $ProcResult6 = mysql_query("UPDATE computer_process_ids SET timestamp='$Timestamp' WHERE computer_id='$CompID' AND process_id='$ProcID' AND process_info_id='$ProcInfoID'") or die ("ID update for processes failed, please contact your site administrator.\n$Timestamp\n".logErrors('processes',mysql_error(),$ComputerCount)); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the processes for $HostName.\n"); } } } } else { fwrite(STDOUT, "The array for 'Process' information could not be created on $INIFile.\n"); } if (is_array($ini_array['Programs'])) { # Iterate all programs that are running when the user logs on, verify that they exist in the DB, or write them to the database foreach ($ini_array['Programs'] as $Prog) { list($ProgName,$ProgPath,$ProgVersion,$ProgPublisher) = explode("*",$Prog); $ProgResult = mysql_query("SELECT * FROM programs WHERE name='$ProgName'") or die("Program verification query failed, please contact your site administrator. Reported Error: ".mysql_error()."\n"); $ProgCount = mysql_num_rows($ProgResult); if ($ProgCount == 0) { $ProgResult2 = mysql_query("INSERT INTO programs (name) VALUES('$ProgName')") or die("Program SQL INSERT failed for $ProgName, please contact your site administrator Reported Error: ".mysql_error()."\n"); $ProgID = mysql_insert_id(); $ProgResult3 = mysql_query("SELECT * FROM program_info WHERE path='$ProgPath' AND version = '$ProgVersion' AND publisher='$ProgPublisher'") or die("Program information query failed, please contact your site administrator. Reported Error: ".mysql_error()."\n"); $ProgCount2 = mysql_num_rows($ProgResult3); if ($ProgCount2 == 0) { $ProgResult4 = mysql_query("INSERT INTO program_info (path,version,publisher) VALUES('$ProgPath','$ProgVersion','$ProgPublisher')") or die("Program information insert failed, please contact your site administrator.\n".mysql_error()); $ProgInfoID = mysql_insert_id(); $ProgResult5 = mysql_query("INSERT INTO computer_program_ids (computer_id,program_id,program_info_id,timestamp) VALUES('$CompID','$ProgID','$ProgInfoID','$Timestamp')") or die("Program ID insert failed(1), please contact your site administrator.\n".mysql_error()); } elseif ($ProgCount2 == 1) { $ProgInfoRow = mysql_fetch_row($ProgResult3); $ProgInfoID = $ProgInfoRow[0]; $ProgResult5 = mysql_query("SELECT * FROM computer_program_ids WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID selection for programes failed, please contact your site administrator.\n".mysql_error()); $ProgCount3 = mysql_num_rows($ProgResult5); if ($ProgCount3 == 0) { $ProgResult5 = mysql_query("INSERT INTO computer_program_ids (computer_id,program_id,program_info_id,timestamp) VALUES('$CompID','$ProgID','$ProgInfoID','$Timestamp')") or die("Progess ID insert failed(2), please contact your site administrator.\n".mysql_error()); } else { $ProgResult6 = msyql_query("UPDATE computer_program_ids SET timestamp='".strtotime("now")."' WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID update for programes failed, please contact your site administrator.\n$Timestamp\n".mysql_error()); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the programs for $HostName.\n"); } } elseif ($ProgCount == 1) { #fwrite(STDOUT, "Program $ProgName has already been added to the database.\n"; $ProgIDRow = mysql_fetch_row($ProgResult); $ProgID = $ProgIDRow[0]; $ProgResult3 = mysql_query("SELECT * FROM program_info WHERE path='$ProgPath' AND version = '$ProgVersion' AND publisher='$ProgPublisher'") or die("Program information query failed, please contact your site administrator. Reported Error: ".mysql_error()."\n"); $ProgCount2 = mysql_num_rows($ProgResult3); if ($ProgCount2 == 0) { $ProgResult4 = mysql_query("INSERT INTO program_info (path,version,publisher) VALUES('$ProgPath','$ProgVersion','$ProgPublisher')") or die("Program information insert failed, please contact your site administrator.\n".mysql_error()); $ProgInfoID = mysql_insert_id(); $ProgResult5 = mysql_query("SELECT * FROM computer_program_ids WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID selection for programes failed, please contact your site administrator.\n".mysql_error()); $ProgCount3 = mysql_num_rows($ProgResult5); if ($ProgCount3 == 0) { $ProgResult5 = mysql_query("INSERT INTO computer_program_ids (computer_id,program_id,program_info_id,timestamp) VALUES('$CompID','$ProgID','$ProgInfoID','$Timestamp')") or die("Progess ID insert failed(3), please contact your site administrator.\n".mysql_error()); } else { $ProgResult6 = msyql_query("UPDATE computer_program_ids SET timestamp='".strtotime("now")."' WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID update for programes failed, please contact your site administrator.\n$Timestamp\n".mysql_error()); } } elseif ($ProgCount2 == 1) { $ProgInfoRow = mysql_fetch_row($ProgResult3); $ProgInfoID = $ProgInfoRow[0]; $ProgResult5 = mysql_query("SELECT * FROM computer_program_ids WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID selection for programes failed, please contact your site administrator.\n".mysql_error()); $ProgCount3 = mysql_num_rows($ProgResult5); if ($ProgCount3 == 0) { $ProgResult5 = mysql_query("INSERT INTO computer_program_ids (computer_id,program_id,program_info_id,timestamp) VALUES('$CompID','$ProgID','$ProgInfoID','$Timestamp')") or die("Progess ID insert failed(4), please contact your site administrator.\n".mysql_error()); } else { $ProgResult6 = mysql_query("UPDATE computer_program_ids SET timestamp='".strtotime("now")."' WHERE computer_id='$CompID' AND program_id='$ProgID' AND program_info_id='$ProgInfoID'") or die ("ID update for programes failed, please contact your site administrator.\n$Timestamp\n".mysql_error()); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the programs for $HostName.\n"); } } } } else { fwrite(STDOUT, "The array for 'Program' information could not be created on $INIFile.\n"); } if (is_array($ini_array['Services'])) { # Iterate all programs that are running when the user logs on, verify that they exist in the DB, or write them to the database foreach ($ini_array['Services'] as $Serv) { list($ServName,$ServDisplayName,$ServPath,$ServStartupType,$ServStatus,$ServAuthority) = explode("*",$Serv); $ServResult = mysql_query("SELECT * FROM services WHERE name='$ServName' AND display_name='$ServDisplayName'") or die("Service verification query failed, please contact your site administrator. Reported Error: ".logErrors('services',mysql_error(),$ComputerCount)."\n"); $ServCount = mysql_num_rows($ServResult); if ($ServCount == 0) { $ServResult2 = mysql_query("INSERT INTO services (name,display_name) VALUES('$ServName','$ServDisplayName')") or die("Service SQL INSERT failed for $ServName, please contact your site administrator Reported Error: ".logErrors('services',mysql_error(),$ComputerCount)."\n"); $ServID = mysql_insert_id(); $ServResult3 = mysql_query("SELECT * FROM service_info WHERE path='$ServPath' AND startup_type = '$ServStartupType' AND status='$ServStatus' AND authority='$$ServAuthority'") or die("Service information query failed, please contact your site administrator. Reported Error: ".logErrors('services',mysql_error(),$ComputerCount)."\n"); $ServCount2 = mysql_num_rows($ServResult3); if ($ServCount2 == 0) { $ServResult4 = mysql_query("INSERT INTO service_info (path,startup_type,status,authority) VALUES('$ServPath','$ServStartupType','$ServStatus','$$ServAuthority')") or die("Service information insert failed, please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); $ServInfoID = mysql_insert_id(); $ServResult5 = mysql_query("INSERT INTO computer_service_ids (computer_id,service_id,service_info_id,timestamp) VALUES('$CompID','$ServID','$ServInfoID','$Timestamp')") or die("Service ID insert failed(1), please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); } elseif ($ServCount2 == 1) { $ServInfoRow = mysql_fetch_row($ServResult3); $ServInfoID = $ServInfoRow[0]; $ServResult5 = mysql_query("SELECT * FROM computer_service_ids WHERE computer_id='$CompID' AND service_id='$ServID' AND service_info_id='$ServInfoID'") or die ("ID selection for servicees failed, please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); $ServCount3 = mysql_num_rows($ServResult5); if ($ServCount3 == 0) { $ServResult5 = mysql_query("INSERT INTO computer_service_ids (computer_id,service_id,service_info_id,timestamp) VALUES('$CompID','$ServID','$ServInfoID','$Timestamp')") or die("Servess ID insert failed(3), please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); } else { $ServResult6 = msyql_query("UPDATE computer_service_ids SET timestamp='$Timestamp' WHERE computer_id='$CompID' AND service_id='$ServID' AND service_info_id='$ServInfoID'") or die ("ID update for servicees failed, please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the service for $HostName.\n"); } } elseif ($ServCount == 1) { #fwrite(STDOUT, "Program $ProgName has already been added to the database.\n"; $ServIDRow = mysql_fetch_row($ServResult); $ServID = $ServIDRow[0]; $ServResult3 = mysql_query("SELECT * FROM service_info WHERE path='$ServPath' AND startup_type = '$ServStartupType' AND status='$ServStatus' AND authority='$$ServAuthority'") or die("Service information query failed, please contact your site administrator. Reported Error: ".logErrors('services',mysql_error(),$ComputerCount)."\n"); $ServCount2 = mysql_num_rows($ServResult3); if ($ServCount2 == 0) { $ServResult4 = mysql_query("INSERT INTO service_info (path,startup_type,status,authority) VALUES('$ServPath','$ServStartupType','$ServStatus','$$ServAuthority')") or die("Service information insert failed, please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); $ServInfoID = mysql_insert_id(); $ServResult5 = mysql_query("SELECT * FROM computer_service_ids WHERE computer_id='$CompID' AND service_id='$ServID' AND service_info_id='$ServInfoID'") or die ("ID selection for servicees failed, please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); $ServCount3 = mysql_num_rows($ServResult5); if ($ServCount3 == 0) { $ServResult5 = mysql_query("INSERT INTO computer_service_ids (computer_id,service_id,service_info_id,timestamp) VALUES('$CompID','$ServID','$ServInfoID','$Timestamp')") or die("service ID insert failed(3), please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); } else { $ServResult6 = msyql_query("UPDATE computer_service_ids SET timestamp='$Timestamp' WHERE computer_id='$CompID' AND service_id='$ServID' AND service_info_id='$ServInfoID'") or die ("ID update for servicees failed, please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); } } elseif ($ServCount2 == 1) { $ServInfoRow = mysql_fetch_row($ServResult3); $ServInfoID = $ServInfoRow[0]; $ServResult5 = mysql_query("SELECT * FROM computer_service_ids WHERE computer_id='$CompID' AND service_id='$ServID' AND service_info_id='$ServInfoID'") or die ("ID selection for servicees failed, please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); $ServCount3 = mysql_num_rows($ServResult5); if ($ServCount3 == 0) { $ServResult5 = mysql_query("INSERT INTO computer_service_ids (computer_id,service_id,service_info_id,timestamp) VALUES('$CompID','$ServID','$ServInfoID','$Timestamp')") or die("service ID insert failed(4), please contact your site administrator.\n".logErrors('services',mysql_error(),$ComputerCount)); } else { $ServResult6 = mysql_query("UPDATE computer_service_ids SET timestamp='$Timestamp' WHERE computer_id='$CompID' AND service_id='$ServID' AND service_info_id='$ServInfoID'") or die ("ID update for servicees failed, please contact your site administrator.\n$Timestamp\n".logErrors('services',mysql_error(),$ComputerCount)); } } else { fwrite(STDOUT, "An unexpected error occurred while trying to process the services for $HostName.\n"); } } } } else { fwrite(STDOUT, "The array for 'Service' information could not be created on $INIFile.\n"); } if (is_array($ini_array['LLU'])) { # Iterate all users who logged into the particular hostname; query the database to make sure that user has an entry in the database foreach ($ini_array['LLU'] as $key => $val) { $LLUResult = mysql_query("SELECT * FROM usernames WHERE username='$val'") or die("Username verification query failed, please contact your site administrator. Reported Error: ".logErrors('LLU',mysql_error(),$ComputerCount)."\n"); $LLUCount = mysql_num_rows($LLUResult); # If 0 results, create the user account in the usernames table and also add the corresponding entry to associate the userid with the computerid if ($LLUCount == 0) { $LLUResult2 = mysql_query("INSERT INTO usernames (username) VALUES('$val')") or die("Last Logged on User (LLU) SQL INSERT failed for $val, please contact your site administrator Reported Error: ".logErrors('LLU',mysql_error(),$ComputerCount)."\n"); $LLUID = mysql_insert_id(); $LLUResult3 = mysql_query("INSERT INTO computer_username_ids (computer_id,username_id,timestamp) VALUES('$CompID','$LLUID','$key')") or die("Computer -> Username ID INSERT failed, please contact your site administrator. Reported Error: ".logErrors('LLU',mysql_error(),$ComputerCount)."\n"); # If the username queried for is in the correct table, check to see if the exact entries exist in the userid/computerid table and if it does NOT, write it to the DB } elseif ($LLUCount == 1) { #fwrite(STDOUT, "User $val has already been added to the database.\n"; $LLUIDResult2 = mysql_query("SELECT id FROM usernames WHERE username='$val'") or die("Computer ID selection failed, please contact your site administrator. Reported Error: ".logErrors('LLU',mysql_error(),$ComputerCount)."\n"); $LLUIDRow = mysql_fetch_row($LLUIDResult2); $LLUID = $LLUIDRow[0]; $LLUResult3 = mysql_query("SELECT * FROM computer_username_ids WHERE username_id='$LLUID' AND computer_id='$CompID' AND timestamp='$key'") or die("Last logged on user query failed, please contact your site administrator. Reported Error: ".logErrors('LLU',mysql_error(),$ComputerCount)."\n"); $LLUCount3 = mysql_num_rows($LLUResult3); if ($LLUCount3 == 0) { $LLUResult4 = mysql_query("INSERT INTO computer_username_ids (computer_id,username_id,timestamp) VALUES('$CompID','$LLUID','$key')") or die("Computer -> Username ID INSERT-2 failed, please contact your site administrator. Reported Error: ".logErrors('LLU',mysql_error(),$ComputerCount)."\n"); } elseif ($LLUCount3 == 1) { #fwrite(STDOUT, "$val has already been entered into the database for the script being run.\n"; } else { fwrite(STDOUT, "DATABASE ERROR: Multiple records exist for that username, computer, and time; halting script execution!\n"); exit; } } else { fwrite(STDOUT, "DATABASE ERROR: Multiple records for $val already exist in the database! Halting script execution.\n"); exit; } } } else { fwrite(STDOUT, "The array for 'Last Logged on User' information could not be created on $INIFile.\n"); } #fwrite(STDOUT, "\n\n"; $ComputerCount++; if (file_exists($INIPath.$INIFile)) unlink($INIPath.$INIFile); } } } # Report an error if the opening of the INI file directory fails } else { fwrite(STDOUT, "Error Opening Directory: " . $INIPath . "\n"); }# Report an error if the variable is not a directory} else { fwrite(STDOUT,"There were no computers that needed to be updated.\n");}$ScriptEndTime = microtime_float();$ScriptRunTime = $ScriptEndTime - $ScriptStartTime;$ScriptSQL = "INSERT INTO script_execution (timestamp,number_of_computers,scriptruntime) VALUES('".strtotime("now")."','$ComputerCount','".round($ScriptRunTime)."')";$ScriptResult = mysql_query($ScriptSQL) or die("Script logging function failed, please contact your administrator.\n $ScriptSQL \n".logErrors('SQL',mysql_error(),$ComputerCount));fwrite(STDOUT, "Computers Processed: $ComputerCount\n");fwrite(STDOUT, "Script Execution Completed \n");# Close the opened databasedb_close();exit(0); ?>[/code] Quote Link to comment Share on other sites More sharing options...
ryanlwh Posted July 25, 2006 Share Posted July 25, 2006 you may want to try LOAD DATA INFILE. It's a lot faster than INSERTs. Quote Link to comment Share on other sites More sharing options...
thepip3r Posted July 25, 2006 Author Share Posted July 25, 2006 i'll have to look at that because since my information is in INI files and in a specified format with the way the info is gathered, i'll have to rewrite the whole PHP script to write the specific table-based information into a temp .txt file so that LOAD DATA INFILE can parse the information correctly. It will be a task but if you think it will work. do you know of any good tutorials on using this so that i don't have to fumble through it myself? thanx in advance. Quote Link to comment Share on other sites More sharing options...
ShogunWarrior Posted July 25, 2006 Share Posted July 25, 2006 Yeah, maybe if you could format the files slightly differently so that they can be loaded into MySQL.Also, while possibly not your favourite option you could consider using something like Python if it's going to be running for a long time, the speed increase might help. Quote Link to comment Share on other sites More sharing options...
ryanlwh Posted July 25, 2006 Share Posted July 25, 2006 Perl is also a good text processing language.on a side note, if it's going to be a pain to rewrite the whole script, try INSERT INTO ... ON DUPLICATE KEY UPDATE. It saves you 2 queries each time. or take advantage of the multiple VALUES syntax. Quote Link to comment Share on other sites More sharing options...
thepip3r Posted July 25, 2006 Author Share Posted July 25, 2006 thank you for the suggestions guys but also try to remmeber that it's not my text processing that's my short-fall, it's my mysql queries that are bogging down the process.. i'll have to try some of those mysql suggestions that you all have given. thank you again. Quote Link to comment Share on other sites More sharing options...
shoz Posted July 26, 2006 Share Posted July 26, 2006 That's a lot of data and I'd suggest you go at this a different way.From what you've posted, if you were to go through each value/line in the ini files as you're doing. Even if you performed [b]one[/b] query for each value you'd end up doing about 500,000 queries when processing 1500 ini files and about 1 million if you processed 3000(This is based on the example file). Now multiply that by the number of queries that the script is currently running for each line.MYSQL can do a lot if given the data. So what I'd first suggest is to dump the values in the ini files into temporary tables and work with those.The basic thing you need to do first is this.Create the following temporary tables at the beginning of the script. Do not add any indexes[code]processes_tmp //should have a compID column and all the columns in "processes" and "process_info" except the id columnsprograms_tmp //should have a compID column and all the columns in "programs " and "program_info" except the id columnsservices_tmp //should have a compID column and all the columns in "services" and "service_info" except the id columnsusernames_tmp //This can be left for later.[/code]Once you've done that you'll need to populate them with all the values you were splitting across the multple tables.You can use the multiple VALUES syntax for this as ryanlwh suggested, but you can use seperate inserts for the time being. Yes, we're takingf the 500,000/1mil query hit at the beginning. The reason I'm not pushing you to use the other syntax is because I haven't noticed much of a speed difference when I've tested it. We can test it later.After you've written that part of the script, post it and post the time it takes to populate the tables.I also noticed that you don't have any method of ensuring that the script isn't already running. Meaning that the script is run every 5 mins even if another one is still being run? If so, you can work on changing that after the script is finished. Quote Link to comment Share on other sites More sharing options...
shoz Posted July 26, 2006 Share Posted July 26, 2006 Let me clarify part of how to dump the data.Put a unique index on the hostname column[code]ALTER TABLE computers ADD UNIQUE(hostname);[/code]Now when going through the ini files you'll insert and get the compID of the current computer using the following. Note the syntax ("INSERT INTO ... ON DUPLICATE KEY UPDATE" as mentioned by ryanlwh).[code]$sql = "INSERT INTO " ."computers " ."(hostname,ip,mac,os,os_ver,scriptruntime) " ."VALUES " ."('$Hostname','$IP','$MAC','$OS','$Ver','$ScriptRunTime') " ."ON DUPLICATE KEY " ."UPDATE " ."hostname='$Hostname', ip='$IP', mac='$MAC', os='$OS', os_ver='$VER', scriptruntime='$ScriptRunTime' ";$result = mysql_query($sql) or die("SQL query failed on $hostname. Reported Error: ".logErrors('general',mysql_error(),$ComputerCount)."\n");$CompID = mysql_insert_id();[/code]You'd then use this compID when populating the tables.EDIT: The explanation of dumping the ini data is on page1 of the thread Quote Link to comment Share on other sites More sharing options...
thepip3r Posted July 26, 2006 Author Share Posted July 26, 2006 wow thanx for all of the information guys. i guess i have some work to do and i'll post the content once i get it up and working but it might be a couple of days as i'm in a cisco class right now and only have my breaks to come back to the office to look at this stuff; and because this is all new to me, i'm sure i'll be fumbling through the syntax and stuff. thanx so much for the help everyone. i'll give it a shot. Shoz: you mentioned a problem i'm having with my PHP script running every 5 mins. I agree, this is a seriuos problem because of the length of time it takes for the script to run AND how my directory array is created. I noticed that when multiple PHP scripts run, the scripts oftentimes try to update the same INI file after a while and almost become in sync so two scripts are fighting each other over finishing the INI file first. I tried to a rudimentary method of attempting to fix this but have come to the problem just aforementioned. you see, the script used to try to open files that had already been deleted. thus, i added the if(is_file)) syntax to check the existence in case one of the PHP scripts had already completed operation on the INI file. I can't think of how to split up processing of the INI files more efficiently. If I can get a good method for accomplishing that down as well as a way to fork my process, i might be able to spawn 10 processes simultaneously to increase the processing efficiency. your thoughts? Quote Link to comment Share on other sites More sharing options...
shoz Posted July 26, 2006 Share Posted July 26, 2006 [quote=thepip3r]I can't think of how to split up processing of the INI files more efficiently. If I can get a good method for accomplishing that down as well as a way to fork my process, i might be able to spawn 10 processes simultaneously to increase the processing efficiency. your thoughts?[/quote]Until this lone script can go through the files in a decent amount of time, I wouldn't think about splitting up processing in any way.To stop the script from running if it's already being run, you can create a basic lock file scenario for the time being. When the script is run it checks if the lock file exists. If it does, it exits. If not, it creates it and continues execution. You may want to use [url=http://www.php.net/register_shutdown_function]register_shutdown_function[/url] to do the cleanup.While you're writing the script, consider writing two. One that uses the tmp tables and the other that goes through the list as you were doing, but with changes similar to the change to insert the hostname. Both methods should be much faster after the queries are changed and indexes created, but if you're going from 17hrs you should invest the time in trying both.eg: The first half would now look like the following.[code]$ScriptStartTime = microtime_float();db_open();$INIPath = "e:\\inventory_agent\\data\\INIs\\";$ComputerCount = 1;if (is_dir($INIPath)) { if ($INIDH = opendir($INIPath)) { while (($INIFile = readdir($INIDH)) !== false) { $INISub = SubStr($INIFile,-4,4); $HostName = SubStr($INIFile,0,StrLen($INIFile)-4); if ($INISub == '.ini') { if (is_file($INIPath.$INIFile)) { $ini_array = parse_ini_file($INIPath.$INIFile, true); $Timestamp = $ini_array['General']['Timestamp']; # Write each elements section and value to it's own variable name and value if (is_array($ini_array['General'])) { foreach ($ini_array['General'] as $key => $val) { $$key = $val; } $sql = "INSERT INTO " ."computers " ."(hostname,ip,mac,os,os_ver,scriptruntime) " ."VALUES " ."('$Hostname','$IP','$MAC','$OS','$Ver','$ScriptRunTime') " ."ON DUPLICATE KEY " ."UPDATE " ."hostname='$Hostname', ip='$IP', mac='$MAC', os='$OS', os_ver='$VER', scriptruntime='$ScriptRunTime' "; $result = mysql_query($sql) or die("SQL query failed on $hostname. Reported Error: ".logErrors('general',mysql_error(),$ComputerCount)."\n"); $CompID = mysql_insert_id();[/code]The general idea behind the tmp tables is this[code]populate tmp tablesINSERT INTO SELECT JOIN etc ON UPDATE column=VALUES(col) etcINSERT INTO SELECT JOIN etc ON UPDATE etc[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.