Exemplo n.º 1
0
                    // . 'echo ${!};', $out
                    //echo "/sacp/includes/sshManagerWorker.php?HOST=".$deviceInfo->tLastAliveIP."&PORT=22&USER=root&PASS="******"&memberID=$memberID&deviceID=".$deviceID."&jobTemplateID=".$jobTemplateID."";
                    //echo "\n/usr/bin/php /var/www/html/sacp/includes/sshManagerWorker.php '".$deviceInfo->tLastAliveIP."' '22' 'root' '".$deviceInfo->tRootPwd."' '".$memberID."' '".$deviceID."' '".$jobTemplateID."' '".$cmdID."'  > /tmp/file3.log &";
                    $db_CS->commit();
                    exec("/usr/bin/php /var/www/html/sacp/includes/sshManagerWorker.php '" . $deviceInfo->tLastAliveIP . "' '22' 'root' '" . $deviceInfo->tRootPwd . "' '" . $memberID . "' '" . $deviceID . "' '" . $jobTemplateID . "' '" . $cmdID . "'  > /tmp/file3.log &");
                }
            }
        }
    }
}
$task = isset($_REQUEST["task"]) ? $_REQUEST["task"] : false;
$deviceListAffected = isset($_REQUEST["deviceListAffected"]) ? json_decode($_REQUEST["deviceListAffected"]) : false;
$cmdID = isset($_REQUEST["cmdID"]) ? $_REQUEST["cmdID"] : false;
$jobTemplateID = isset($_REQUEST["jobTemplateID"]) ? $_REQUEST["jobTemplateID"] : false;
$customPass = isset($_REQUEST["customPass"]) ? $_REQUEST["customPass"] : false;
if (!$deviceListAffected || !$jobTemplateID) {
    echo 'no deviceListAffected or jobTemplateID';
    die;
}
$worker = new Worker();
if ($task == "checkHostAlive") {
    //echo "checkHostAlive";
    $worker->checkHostAlive($deviceListAffected, $jobTemplateID);
} else {
    if ($task == "checkHostFW") {
        //echo "checkHostFW";
        $worker->checkHostFW($deviceListAffected, $jobTemplateID, $customPass);
    } else {
        $worker->runJobCommands($deviceListAffected, $jobTemplateID, $customPass);
    }
}