• Модуль: scale
  • Путь к файлу: ~/bitrix/modules/scale/lib/helper.php
  • Класс: BitrixScaleHelper
  • Вызов: Helper::getNetworkInterfaces
static function getNetworkInterfaces()
{
	$result = array();
	$shellAdapter = new ShellAdapter();
	$execRes = $shellAdapter->syncExec("sudo -u root /opt/webdir/bin/bx-node -o json");
	$jsonData = $shellAdapter->getLastOutput();

	if($execRes)
	{
		$arData = json_decode($jsonData, true);

		if(isset($arData["params"]["pool_interfaces"]))
			$result = $arData["params"]["pool_interfaces"];

		if(is_array($result))
		{
			foreach($result as $iface => $ip)
				$result[$iface] = $iface." (".$ip.")";
		}
	}

	return $result;
}