Beispiel #1
0
 /**
  * MYSQL_ADD_SLAVE action modifyer
  * @param string $actionId - action idenifyer
  * @param array $actionParams - action parameterss
  * @param string $hostname - server hostname
  * @return array - modifyed action params
  * @throws NeedMoreUserInfoException
  */
 public static function mysqlAddSlave($actionId, $actionParams, $hostname)
 {
     $action = new Action("MYSQL_ADD_SLAVE_MODIFYER", array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-mysql -a options -o json", "LOG_LEVEL" => Logger::LOG_LEVEL_DISABLE), "", array());
     $action->start();
     $actRes = $action->getResult();
     $needModeInfo = false;
     if (isset($actRes["MYSQL_ADD_SLAVE_MODIFYER"]["OUTPUT"]["DATA"]["params"]["options"]) && is_array($actRes["MYSQL_ADD_SLAVE_MODIFYER"]["OUTPUT"]["DATA"]["params"]["options"])) {
         foreach ($actRes["MYSQL_ADD_SLAVE_MODIFYER"]["OUTPUT"]["DATA"]["params"]["options"] as $option) {
             if ($option == "cluster_password" || $option == "replica_password") {
                 $actionParams["START_COMMAND_TEMPLATE"] .= " --" . $option . "=" . \Bitrix\Scale\Helper::generatePass();
             } elseif ($option == "mysql_password") {
                 $actionParams["START_COMMAND_TEMPLATE"] .= " --" . $option . "=##USER_PARAMS:MYSQL_PASS##";
                 if (!isset($actionParams["USER_PARAMS"])) {
                     $actionParams["USER_PARAMS"] = array();
                 }
                 $actionParams["USER_PARAMS"]["MYSQL_PASS"] = array("NAME" => Loc::getMessage("SCALE_AM_MYAR_MYSQL_PASS"), "TYPE" => "PASSWORD", "REQUIRED" => "Y", "VERIFY_TWICE" => "Y");
                 $needModeInfo = true;
             }
         }
         if ($needModeInfo) {
             throw new NeedMoreUserInfoException("Need more user's info", $actionParams);
         }
     }
     return $actionParams;
 }
Beispiel #2
0
 /**
  * MYSQL_ADD_SLAVE, MYSQL_CHANGE_MASTER, MYSQL_DEL_SLAVE actions modifier/
  * @param string $actionId - action idenifyer
  * @param array $actionParams - action parameters
  * @param string $hostname - server hostname
  * @return array - modifyed action params
  * @throws NeedMoreUserInfoException
  */
 public static function checkExtraDbExist($actionId, $actionParams, $hostname)
 {
     if ($actionId == "MYSQL_ADD_SLAVE" || $actionId == "MYSQL_CHANGE_MASTER") {
         $hostname = ServersData::getDbMasterHostname();
     }
     if (Helper::isExtraDbExist($hostname)) {
         $actionParams["CHECK_EXTRA_DB_USER_ASK"] = "Y";
         throw new NeedMoreUserInfoException("Need more user's info", $actionParams);
     }
     return $actionParams;
 }
Beispiel #3
0
 */
define("ADMIN_MODULE_NAME", "scale");
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
use Bitrix\Main\Localization\Loc;
Loc::loadMessages(__FILE__);
if (!\Bitrix\Main\Loader::includeModule("scale")) {
    ShowError(Loc::getMessage("SCALE_GRAPH_MODULE_NOT_INSTALLED"));
}
if (!$USER->IsAdmin()) {
    $APPLICATION->AuthForm(Loc::getMessage("SCALE_GRAPH_ACCESS_DENIED"));
}
$APPLICATION->SetTitle(Loc::getMessage("SCALE_GRAPH_TITLE"));
$APPLICATION->SetAdditionalCSS("/bitrix/js/scale/css/scale-page-style.css");
$APPLICATION->AddHeadScript("/bitrix/js/scale/core.js");
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
if (\Bitrix\Scale\Helper::checkBxEnvVersion()) {
    if (\Bitrix\Scale\Monitoring::isEnabled()) {
        $serversList = \Bitrix\Scale\ServersData::getList();
        reset($serversList);
        $serverHostname = isset($_REQUEST["SERVER_HOSTNAME"]) ? htmlspecialcharsbx($_REQUEST["SERVER_HOSTNAME"]) : key($serversList);
        $monitoringCategoryId = isset($_REQUEST["GRAPH_CATEGORY"]) ? htmlspecialcharsbx($_REQUEST["GRAPH_CATEGORY"]) : "SYSTEM";
        $period = isset($_REQUEST["PERIOD"]) ? htmlspecialcharsbx($_REQUEST["PERIOD"]) : "day";
        $graphCategories = array();
        $sFilterID = "scale_graph_filter_id";
        $oFilter = new CAdminFilter($sFilterID, array(Loc::getMessage("SCALE_GRAPH_SELECT_SERVER"), Loc::getMessage("SCALE_GRAPH_SELECT_CATEGORY"), Loc::getMessage("SCALE_GRAPH_SELECT_PERIOD")));
        $graphs = \Bitrix\Scale\GraphData::getList();
        foreach ($serversList as $hostname => $server) {
            $graphCategories[$hostname] = \Bitrix\Scale\ServersData::getGraphCategories($hostname);
            foreach ($graphCategories[$hostname] as $key => $category) {
                if (!isset($graphs[$category])) {
                    continue;
 *
 *  NAME:  required.
 *      The name of action. Name will be seen by user.
 *
 *  ACTIONS: array (for TYPE = CHAIN only) required.
 *      List of another actions ids from this list witch will be executed in same order
 *
 *  START_COMMAND_TEMPLATE:  (for TYPE != CHAIN) required
 *       Command template, to execute. In this template aviable anchors:
 *       ##USER_PARAMS:PARAM_NAME## - show dialog to user, and ask them to enter param PARAM_NAME
 *       ##SERVER_PARAMS:PARAM_NAME## - Get param PARAM_NAME from server params (now aviable only ip|hostname)
 *       ##INPUT_PARAMS:PARAM_NAME## - results taken from results of previous actions calling.
 *          It usefull only if action takes part in actionschain, and one of previous action returns param PARAM_NAME
 *
 * USER_PARAMS: array optional
 *      Params wich we must to ask to user. Aviable params:
 *      NAME:  required. Param name. User will see it as param name in dialog window.
 *		TYPE:  required. Aviable: STRING, PASSWORD, DROPDOWN, CHECKBOX
 *		REQUIRED:  (Y|N) optional. If user must obligatory to fill this field.
 *      VERIFY_TWICE  (Y|N) optional. If user must confirm param. Password for example.
 *
 *      ASYNC  (Y|N) optional. If command must be executed async asynchronously
 */
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
use Bitrix\Main\Localization\Loc;
Loc::loadMessages(__FILE__);
$connection = \Bitrix\Main\Application::getConnection();
$actionsDefinitions = array("NEW_SERVER_CHAIN" => array("TYPE" => "CHAIN", "NAME" => Loc::getMessage("SCALE_ADEF_NEW_SERVER_CHAIN"), "ACTIONS" => array("GET_CURRENT_KEY", "COPY_KEY_TO_SERVER", "ADD_SERVER", "MONITORING_UPDATE"), "PAGE_REFRESH" => "Y"), "GET_CURRENT_KEY" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a key -o json", "NAME" => Loc::getMessage("SCALE_ADEF_GET_CURRENT_KEY")), "COPY_KEY_TO_SERVER" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a copy -i ##USER_PARAMS:SERVER_IP## -k ##INPUT_PARAMS:sshkey## -p ##USER_PARAMS:ROOT_PASSWD## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_COPY_KEY_TO_SERVER"), "USER_PARAMS" => array("SERVER_IP" => array("NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_UP_NET_ADDRESS"), "TYPE" => "STRING", "REQUIRED" => "Y"), "ROOT_PASSWD" => array("NAME" => Loc::getMessage("SCALE_ADEF_ROOT_PASS"), "TYPE" => "PASSWORD", "REQUIRED" => "Y"))), "ADD_SERVER" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a add -i ##USER_PARAMS:SERVER_IP## -H ##USER_PARAMS:HOSTNAME## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_ADD_SERVER"), "USER_PARAMS" => array("SERVER_IP" => array("NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_UP_NET_ADDRESS"), "TYPE" => "STRING", "REQUIRED" => "Y"), "HOSTNAME" => array("NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_UP_HOSTNAME"), "TYPE" => "STRING", "REQUIRED" => "Y"))), "CREATE_PULL" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a create -o json", "NAME" => Loc::getMessage("SCALE_ADEF_CREATE_PULL"), "PAGE_REFRESH" => "Y"), "DEL_SERVER" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a del -H ##SERVER_PARAMS:hostname## -i ##SERVER_PARAMS:ip## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_DEL_SERVER"), "PAGE_REFRESH" => "Y"), "CHANGE_PASSWD" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a pw -i ##SERVER_PARAMS:ip## -p ##USER_PARAMS:OLD_PASSWD## -P ##USER_PARAMS:NEW_PASSWD## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_NAME"), "USER_PARAMS" => array("OLD_PASSWD" => array("NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_UP_OLD_PASS"), "TYPE" => "PASSWORD", "REQUIRED" => "Y"), "NEW_PASSWD" => array("NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_UP_NEW_PASS"), "TYPE" => "PASSWORD", "REQUIRED" => "Y", "VERIFY_TWICE" => "Y"))), "CHANGE_PASSWD_FIRST" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a pw -i ##USER_PARAMS:SERVER_IP## -p ##USER_PARAMS:OLD_PASSWD## -P ##USER_PARAMS:NEW_PASSWD## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_NAME"), "USER_PARAMS" => array("SERVER_IP" => array("NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_UP_NET_ADDRESS"), "TYPE" => "STRING"), "OLD_PASSWD" => array("NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_UP_OLD_PASS"), "TYPE" => "PASSWORD", "REQUIRED" => "Y"), "NEW_PASSWD" => array("NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_UP_NEW_PASS"), "TYPE" => "PASSWORD", "REQUIRED" => "Y", "VERIFY_TWICE" => "Y"))), "MONITORING_ENABLE" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-monitor -a enable -o json", "NAME" => Loc::getMessage("SCALE_ADEF_MONITORING_ENABLE"), "ASYNC" => "Y", "PAGE_REFRESH" => "Y", "CONDITION" => array("COMMAND" => "sudo -u root /opt/webdir/bin/bx-monitor -o json", "PARAMS" => array("monitor:monitoring_status", "===", "'disable'"))), "MONITORING_DISABLE" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-monitor -a disable -o json", "NAME" => Loc::getMessage("SCALE_ADEF_MONITORING_DISABLE"), "ASYNC" => "Y", "PAGE_REFRESH" => "Y", "CONDITION" => array("COMMAND" => "sudo -u root /opt/webdir/bin/bx-monitor -o json", "PARAMS" => array("monitor:monitoring_status", "===", "'enable'"))), "MONITORING_UPDATE" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-monitor -a update -o json", "NAME" => Loc::getMessage("SCALE_ADEF_MONITORING_UPDATE")), "MYSQL_ADD_SLAVE" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-mysql -a slave -s ##SERVER_PARAMS:hostname## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_MYSQL_ADD_SLAVE"), "ASYNC" => "Y", "BACKUP_ALERT" => "Y", "PAGE_REFRESH" => "Y", "MODIFYERS" => array("\\Bitrix\\Scale\\ActionModifyer::mysqlAddSlave", "\\Bitrix\\Scale\\ActionModifyer::checkExtraDbExist")), "MYSQL_CHANGE_MASTER" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-mysql -a master -s ##SERVER_PARAMS:hostname## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_MYSQL_CHANGE_MASTER"), "ASYNC" => "Y", "PAGE_REFRESH" => "Y", "BACKUP_ALERT" => "Y", "MODIFYERS" => array("\\Bitrix\\Scale\\ActionModifyer::checkExtraDbExist")), "MYSQL_DEL_SLAVE" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-mysql -a remove -s ##SERVER_PARAMS:hostname## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_MYSQL_DEL_SLAVE"), "ASYNC" => "Y", "PAGE_REFRESH" => "Y", "BACKUP_ALERT" => "Y", "MODIFYERS" => array("\\Bitrix\\Scale\\ActionModifyer::checkExtraDbExist")), "MEMCACHED_ADD_ROLE" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-mc -o json -a create -s ##SERVER_PARAMS:hostname##", "NAME" => Loc::getMessage("SCALE_ADEF_MEMCACHED_ADD_ROLE"), "ASYNC" => "Y", "PAGE_REFRESH" => "Y"), "MEMCACHED_DEL_ROLE" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-mc -o json -a remove -s ##SERVER_PARAMS:hostname##", "NAME" => Loc::getMessage("SCALE_ADEF_MEMCACHED_DEL_ROLE"), "ASYNC" => "Y", "PAGE_REFRESH" => "Y"), "SET_EMAIL_SETTINGS" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sites -o json -a email" . " --smtphost=##USER_PARAMS:SMTP_HOST##" . " --smtpuser='******'" . " --password=##USER_PARAMS:USER_PASSWORD##" . " --email='##USER_PARAMS:EMAIL##'" . " ##USER_PARAMS:SMTPTLS##", "NAME" => Loc::getMessage("SCALE_ADEF_SET_EMAIL"), "PAGE_REFRESH" => "Y", "USER_PARAMS" => array("SITE_NAME" => array("NAME" => Loc::getMessage("SCALE_ADEF_SET_EMAIL_SITE"), "TYPE" => "TEXT"), "SMTP_HOST" => array("NAME" => Loc::getMessage("SCALE_ADEF_SET_EMAIL_SMTP_HOST"), "TYPE" => "STRING"), "SMTP_PORT" => array("NAME" => Loc::getMessage("SCALE_ADEF_SET_EMAIL_SMTP_PORT"), "TYPE" => "STRING"), "SMTP_USER" => array("NAME" => Loc::getMessage("SCALE_ADEF_SET_EMAIL_SMTP_USER"), "TYPE" => "STRING"), "USER_PASSWORD" => array("NAME" => Loc::getMessage("SCALE_ADEF_SET_EMAIL_USER_PASSWORD"), "TYPE" => "PASSWORD", "VERIFY_TWICE" => "Y"), "EMAIL" => array("NAME" => Loc::getMessage("SCALE_ADEF_SET_EMAIL_EMAIL"), "TYPE" => "STRING"), "SMTPTLS" => array("NAME" => Loc::getMessage("SCALE_ADEF_SET_EMAIL_SMTPTLS"), "TYPE" => "CHECKBOX", "CHECKED" => "N", "STRING" => "--smtptls"))), "CRON_SET" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sites -s ##VM_SITE_ID## -a cron --enable", "NAME" => Loc::getMessage("SCALE_ADEF_CRON_SET"), "PAGE_REFRESH" => "Y"), "CRON_UNSET" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sites -s ##VM_SITE_ID## -a cron --disable", "NAME" => Loc::getMessage("SCALE_ADEF_CRON_UNSET"), "PAGE_REFRESH" => "Y"), "HTTP_OFF" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sites -s ##VM_SITE_ID## -a https --enable", "NAME" => Loc::getMessage("SCALE_ADEF_HTTP_OFF"), "PAGE_REFRESH" => "Y"), "HTTP_ON" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sites -s ##VM_SITE_ID## -a https --disable", "NAME" => Loc::getMessage("SCALE_ADEF_HTTP_ON"), "PAGE_REFRESH" => "Y"), "REBOOT" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a bx_reboot -H ##SERVER_PARAMS:hostname## -o json", "ASYNC" => "Y", "NAME" => Loc::getMessage("SCALE_ADEF_REBOOT")), "UPDATE_BVM" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a bx_update -H ##SERVER_PARAMS:hostname## -o json", "ASYNC" => "Y", "PAGE_REFRESH" => "Y", "NAME" => Loc::getMessage("SCALE_ADEF_BVM_UPDATE")), "UPDATE_ALL_BVMS" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a bx_update -o json", "ASYNC" => "Y", "PAGE_REFRESH" => "Y", "NAME" => Loc::getMessage("SCALE_ADEF_BVM_UPDATE")), "CHANGE_PASSWD_BITRIX" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a bx_passwd -u bitrix -H ##SERVER_PARAMS:hostname## -P ##USER_PARAMS:NEW_PASSWD## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_CHANGE_PASSWD_BITRIX"), "USER_PARAMS" => array("NEW_PASSWD" => array("NAME" => Loc::getMessage("SCALE_ADEF_CHPASS_UP_NEW_PASS"), "TYPE" => "PASSWORD", "REQUIRED" => "Y", "VERIFY_TWICE" => "Y"))), "SITE_ADD" => array("NAME" => Loc::getMessage("SCALE_ADEF_SITE_ADD"), "START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sites" . " -o json" . " -a create" . " -s ##USER_PARAMS:SITE_NAME##" . " -t link" . " -r ##USER_PARAMS:SITE_PATH##", "ASYNC" => "Y", "PAGE_REFRESH" => "Y", "USER_PARAMS" => array("SITE_NAME" => array("NAME" => Loc::getMessage("SCALE_ADEF_SITE_ADD_NAME"), "TYPE" => "STRING", "REQUIRED" => "Y"), "SITE_PATH" => array("NAME" => Loc::getMessage("SCALE_ADEF_SITE_ADD_SITE_PATH"), "TYPE" => "STRING"))), "SITE_DEL" => array("NAME" => Loc::getMessage("SCALE_ADEF_SITE_DEL"), "START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sites -o json -a delete -s ##VM_SITE_ID##", "ASYNC" => "Y", "PAGE_REFRESH" => "Y"), "APACHE_ADD_ROLE" => array("NAME" => Loc::getMessage("SCALE_ADEF_APACHE_ADD_ROLE"), "START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sites -H ##SERVER_PARAMS:hostname## -a web --enable  -o json", "ASYNC" => "Y", "PAGE_REFRESH" => "Y"), "APACHE_DEL_ROLE" => array("NAME" => Loc::getMessage("SCALE_ADEF_APACHE_DEL_ROLE"), "START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sites -H ##SERVER_PARAMS:hostname## -a web --disable  -o json", "ASYNC" => "Y", "PAGE_REFRESH" => "Y"), "SPHINX_ADD_ROLE" => array("NAME" => Loc::getMessage("SCALE_ADEF_SPHINX_ADD_ROLE"), "START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sphinx -a create -s ##SERVER_PARAMS:hostname## --dbname ##CODE_PARAMS:DB_NAME## ##USER_PARAMS:INDEX## -o json", "ASYNC" => "Y", "PAGE_REFRESH" => "Y", "USER_PARAMS" => array("INDEX" => array("NAME" => Loc::getMessage("SCALE_ADEF_SPHINX_ADD_ROLE_INDEX"), "TYPE" => "CHECKBOX", "CHECKED" => "N", "STRING" => "--reindex")), "CODE_PARAMS" => array("DB_NAME" => 'return \\Bitrix\\Main\\Application::getConnection()->getDbName();')), "SPHINX_DEL_ROLE" => array("NAME" => Loc::getMessage("SCALE_ADEF_SPHINX_DEL_ROLE"), "START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/bx-sphinx -a remove -s ##SERVER_PARAMS:hostname## --dbname ##CODE_PARAMS:DB_NAME## -o json", "ASYNC" => "Y", "PAGE_REFRESH" => "Y", "CODE_PARAMS" => array("DB_NAME" => 'return \\Bitrix\\Main\\Application::getConnection()->getDbName();')), "CREATE_PULL_NET_IFACE" => array("START_COMMAND_TEMPLATE" => "sudo -u root /opt/webdir/bin/wrapper_ansible_conf -a create -I ##USER_PARAMS:NET_IFACE## -o json", "NAME" => Loc::getMessage("SCALE_ADEF_CREATE_PULL"), "PAGE_REFRESH" => "Y", "USER_PARAMS" => array("NET_IFACE" => array("NAME" => Loc::getMessage("SCALE_ADEF_CREATE_PULL_NET_IFACE"), "TYPE" => "DROPDOWN", "VALUES" => \Bitrix\Scale\Helper::getNetworkInterfaces()))));
Beispiel #5
0
    protected static function getNetParams($hostname)
    {
        $dir = new \Bitrix\Main\IO\Directory(static::$rrdPath . "/" . $hostname);
        if (!$dir->isExists()) {
            return array();
        }
        $arChildren = $dir->getChildren();
        $result = array();
        foreach ($arChildren as $child) {
            if (!$child->isFile()) {
                continue;
            }
            $name = $child->getName();
            $pos1 = strpos($name, "-if_");
            $pos2 = strpos($name, "-up-");
            if ($pos1 !== false && $pos2 !== false) {
                $pos1 += 4;
                $dev = substr($name, $pos1, $pos2 - $pos1);
                $result[$dev] = array("NAME" => $dev . " " . Loc::getMessage("SCALE_MONITORING_NET_PARAMS"), "RRD" => $hostname . "-if_" . $dev . "-up-d.rrd", "OPTIONS" => array("DEF:in=" . static::$rrdPath . "/" . $hostname . "/" . $hostname . "-if_" . $dev . "-up-d.rrd:42:AVERAGE:start=now-600;end=now", "DEF:out=" . static::$rrdPath . "/" . $hostname . "/" . $hostname . "-if_" . $dev . "-down-d.rrd:42:AVERAGE:start=now-600;end=now", "VDEF:vin=in,TOTAL", "VDEF:vout=out,TOTAL", "PRINT:vin:%1.2lf", "PRINT:vout:%1.2lf"), "DATA_FUNC" => '
					$result = false;
					if(isset($data["calcpr"][0]) && isset($data["calcpr"][1]))
					{
						$result = \\Bitrix\\Scale\\Monitoring::formatSize($data["calcpr"][0]/600).
							" / ".
							\\Bitrix\\Scale\\Monitoring::formatSize($data["calcpr"][1]/600)." ' . Helper::nbsp(Loc::getMessage("SCALE_MONITORING_NET_SEC")) . '";
					}
					return $result;');
            }
        }
        return $result;
    }