Port from config and path from plugin function
This commit is contained in:
@@ -8,13 +8,19 @@ global $DB, $agents;
|
||||
|
||||
$check_arr = [];
|
||||
$comps = [];
|
||||
|
||||
$rs_path = Plugin::getPhpDir('remotesupport');
|
||||
|
||||
$pfConfig = new PluginFusioninventoryConfig();
|
||||
$port = $pfConfig->getValue('agent_port');
|
||||
|
||||
$pfInventoryComputerComputer = new PluginFusioninventoryInventoryComputerComputer();
|
||||
foreach (getAllDataFromTable(PluginFusioninventoryAgent::getTable()) as $a) {
|
||||
|
||||
$check = [];
|
||||
$a_computerextend = $pfInventoryComputerComputer->hasAutomaticInventory($a["computers_id"]);
|
||||
|
||||
$check["url"] = "http://" . $a_computerextend["remote_addr"] . ":62354/status";
|
||||
$check["url"] = "http://" . $a_computerextend["remote_addr"] . ":" . $port . "/status";
|
||||
$check["id"] = $a["id"];
|
||||
$check["computers_id"] = $a["computers_id"];
|
||||
$check["status"] = "unknown";
|
||||
@@ -33,7 +39,7 @@ $descriptorspec = array(
|
||||
$cwd = '/tmp';
|
||||
$env = array('debug' => 'false');
|
||||
|
||||
$process = proc_open(__DIR__ . '/check_status', $descriptorspec, $pipes, $cwd, $env);
|
||||
$process = proc_open($rs_path . '/bin/check_status', $descriptorspec, $pipes, $cwd, $env);
|
||||
|
||||
if (is_resource($process)) {
|
||||
// $pipes now looks like this:
|
||||
|
||||
@@ -9,10 +9,8 @@ class PluginRemotesupportRemotesupport extends CommonDBTM
|
||||
public static function showInfo($item)
|
||||
{
|
||||
|
||||
$fi_path = Plugin::getWebDir('fusioninventory');
|
||||
|
||||
// Manage locks pictures
|
||||
PluginFusioninventoryLock::showLockIcon('Computer');
|
||||
//PluginFusioninventoryLock::showLockIcon('Computer');
|
||||
|
||||
$pfInventoryComputerComputer = new PluginFusioninventoryInventoryComputerComputer();
|
||||
$a_computerextend = $pfInventoryComputerComputer->hasAutomaticInventory($item->getID());
|
||||
@@ -75,6 +73,9 @@ class PluginRemotesupportRemotesupport extends CommonDBTM
|
||||
global $DB;
|
||||
|
||||
Toolbox::logInFile("remotsupport", "Starting search of agents\n");
|
||||
$pfConfig = new PluginFusioninventoryConfig();
|
||||
$port = $pfConfig->getValue('agent_port');
|
||||
$rs_path = Plugin::getPhpDir('remotesupport');
|
||||
|
||||
$check_arr = [];
|
||||
$comps = [];
|
||||
@@ -84,7 +85,7 @@ class PluginRemotesupportRemotesupport extends CommonDBTM
|
||||
$check = [];
|
||||
$a_computerextend = $pfInventoryComputerComputer->hasAutomaticInventory($a["computers_id"]);
|
||||
|
||||
$check["url"] = "http://" . $a_computerextend["remote_addr"] . ":62354/status";
|
||||
$check["url"] = "http://" . $a_computerextend["remote_addr"] . ":" . $port . "/status";
|
||||
$check["id"] = $a["id"];
|
||||
$check["computers_id"] = $a["computers_id"];
|
||||
$check["status"] = "unknown";
|
||||
@@ -103,7 +104,7 @@ class PluginRemotesupportRemotesupport extends CommonDBTM
|
||||
$cwd = '/tmp';
|
||||
$env = array('debug' => 'false');
|
||||
|
||||
$process = proc_open(__DIR__ . '/../bin/check_status', $descriptorspec, $pipes, $cwd, $env);
|
||||
$process = proc_open($rs_path . '/bin/check_status', $descriptorspec, $pipes, $cwd, $env);
|
||||
|
||||
if (is_resource($process)) {
|
||||
// $pipes now looks like this:
|
||||
|
||||
Reference in New Issue
Block a user