function ParseComputersOCS() { $Dir = "/var/log/squid/mysql-computers"; if (!($handle = opendir($Dir))) { events("Unable to open {$Dir}"); return; } $f = array(); events("ParseComputersOCS()::Scanning {$Dir}"); $ocs = new ocs(); while (false !== ($filename = readdir($handle))) { if ($filename == ".") { continue; } if ($filename == "..") { continue; } $filepath = "{$Dir}/{$filename}"; events("ParseComputersOCS():: Scanning {$filepath}"); $array = unserialize(@file_get_contents($filepath)); if (!is_array($array)) { events("ParseUsersAgents:: {$filepath} Not an array"); continue; } $mac = $array["MAC"]; $ipaddr = $array["IP"]; $ocs->ADD_HARDWARE($ipaddr, $mac); } }