• Модуль: scale
  • Путь к файлу: ~/bitrix/modules/scale/lib/serversdata.php
  • Класс: BitrixScaleServersData
  • Вызов: ServersData::getDbList
static function getDbList($hostname)
{
	if($hostname == '')
		throw new BitrixMainArgumentNullException("hostname");

	$dbList = array();

	$action =  new Action("get_db_list", array(
		"START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a dbs_list -H ".$hostname." -o json",
		"LOG_LEVEL" => Logger::LOG_LEVEL_DISABLE
		),
		"",
		array()
	);

	$action->start();
	$actRes = $action->getResult();

	if(isset($actRes["get_db_list"]["OUTPUT"]["DATA"]["params"]["dbs_list"][$hostname]["dbs_list"]))
		$dbList = $actRes["get_db_list"]["OUTPUT"]["DATA"]["params"]["dbs_list"][$hostname]["dbs_list"];

	if(is_array($dbList))
		$result = $dbList;
	else
		$result = array();

	return $result;
}