if ($verbose == "y") {
    echo $sql . "<br />\n\n";
}
$result = mysql_query($sql);
$sql = "";
// Insert an entry in the System table
$sql = "UPDATE system SET system_timestamp = '{$timestamp}' WHERE system_uuid = '{$uuid}'";
if ($verbose == "y") {
    echo $sql . "<br />\n\n";
}
$result = mysql_query($sql);
$sql = "";
foreach ($input as $split) {
    //Network
    if (substr($split, 0, 7) == "network") {
        insert_network($split);
    }
    // First system submit - Initial insert
    if (substr($split, 0, 8) == "system01") {
        insert_system01($split);
    }
    // Second system submit
    if (substr($split, 0, 8) == "system02") {
        insert_system02($split);
    }
    // Third system submit
    if (substr($split, 0, 8) == "system03") {
        insert_system03($split);
    }
    // Processor
    if (substr($split, 0, 9) == "processor") {
Example #2
0
$os_id = insert_os($os_name, $os_arch, $os_basearch, $os_kernel);
if ($xml->cpu->unified_cache) {
    $cpu_unified_cache = (bool) $xml->cpu->unified_cache;
} else {
    $cpu_unified_cache = false;
}
$cpu_id = insert_cpu($cpu_cache, $cpu_name, $cpu_speed, $cpu_unified_cache);
if ($host["hwid"]) {
    echo "this host exists with hwid of : {$host['hwid']}\n";
    $host_id = update_host($hostname, $domain, $hwid, $os_id, $cpu_id, $cpu_count, $swaptotal, $memtotal);
} else {
    echo "this is new hardware\n";
    $host_id = insert_host($hostname, $domain, $hwid, $os_id, $cpu_id, $cpu_count, $swaptotal, $memtotal);
}
if ($xml->nic) {
    insert_network($host_id, $xml->nic);
}
if ($xml->disk) {
    machdb_disk($host_id, $xml->disk);
}
if ($xml->filesystem) {
    machdb_filesystem($host_id, $xml->filesystem);
}
if ($xml->package) {
    machdb_package($host_id, $xml->package);
}
if ($xml->bios) {
    machdb_bios($host_id, $xml->bios);
}
if ($xml->system) {
    machdb_system($host_id, $xml->system);