コード例 #1
0
ファイル: index.php プロジェクト: webgksupport/alpina
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$APPLICATION->SetAdditionalCSS('/bitrix/gadgets/bitrix/bitrixcloud_monitoring/styles.css');
$converter = CBXPunycode::GetConverter();
$saleIncluded = CModule::IncludeModule('sale');
$intervalLang = array("sale" => array(7 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT1_WEEK"), 30 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT1_MONTH"), 90 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT1_QUARTER"), 365 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT1_YEAR")), "uptime" => array(7 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT2_WEEK"), 30 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT2_MONTH"), 90 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT2_QUARTER"), 365 => GetMessage("GD_BITRIXCLOUD_MONITOR_MESS_ALERT2_YEAR")));
$uptime = "";
$testCount = 0;
/** @var CBitrixCloudMonitoringTest $testAlert */
$testAlert = null;
$testDomain = "";
$bAlert = false;
if (CModule::IncludeModule('bitrixcloud')) {
    $monitoring = CBitrixCloudMonitoring::getInstance();
    $monitoringResults = $monitoring->getMonitoringResults();
    if (!is_string($monitoringResults)) {
        if ($monitoringResults->getStatus() === CBitrixCloudMonitoringResult::RED_LAMP) {
            $bAlert = true;
            foreach ($monitoringResults as $domainName => $domainResult) {
                foreach ($domainResult as $testId => $testResult) {
                    if ($testResult->getStatus() === CBitrixCloudMonitoringResult::RED_LAMP) {
                        $testCount++;
                        $testAlert = $testResult;
                        $testDomain = $domainName;
                    }
                }
            }
            $uptime = $monitoring->getWorstUptime("test_http_response_time");
        }
コード例 #2
0
ファイル: monitoring.php プロジェクト: DarneoStudio/bitrix
 public static function startMonitoringAgent()
 {
     $monitoring = CBitrixCloudMonitoring::getInstance();
     $rsR = CLanguage::GetById("ru");
     if ($rsR->Fetch()) {
         $language_id = "ru";
     } else {
         $rsD = CLanguage::GetById("de");
         if ($rsD->Fetch()) {
             $language_id = "de";
         } else {
             $language_id = "en";
         }
     }
     $monitoring->startMonitoring(COption::GetOptionString("main", "server_name", ""), false, $language_id, array(COption::GetOptionString("main", "email_from", "")), array("test_lic", "test_domain_registration", "test_http_response_time"));
     return "";
 }