Beispiel #1
0
 function stage2()
 {
     $table = new CTable(null, 'requirements');
     $table->setAlign('center');
     $final_result = true;
     $table->addRow(array(SPACE, new CCol('Current value', 'header'), new CCol('Required', 'header'), new CCol('Recommended', 'header'), SPACE, SPACE));
     $reqs = check_php_requirements();
     foreach ($reqs as $req) {
         $result = null;
         if (!is_null($req['recommended']) && $req['result'] == 1) {
             $result = new CSpan(S_OK, 'orange');
         } else {
             if (!is_null($req['recommended']) && $req['result'] == 2 || is_null($req['recommended']) && $req['result'] == 1) {
                 $result = new CSpan(S_OK, 'green');
             } else {
                 if ($req['result'] == 0) {
                     $result = new CSpan(S_FAIL, 'link_menu fail');
                     $result->setHint($req['error']);
                 }
             }
         }
         $table->addRow(array(new CCol($req['name'], 'header'), $req['current'], $req['required'] ? $req['required'] : SPACE, $req['recommended'] ? $req['recommended'] : SPACE, $result), $req['result'] ? SPACE : 'fail');
         $final_result &= (bool) $req['result'];
     }
     if (!$final_result) {
         $this->DISABLE_NEXT_BUTTON = true;
         $this->addVar('trouble', true);
         $final_result = array(new CSpan(S_FAIL, 'fail'), BR(), BR(), 'Please correct all issues and press "Retry" button', BR(), BR(), new CButton('retry', S_RETRY));
     } else {
         $this->DISABLE_NEXT_BUTTON = false;
         $final_result = new CSpan(S_OK, 'ok');
     }
     return array($table, BR(), $final_result);
 }
Beispiel #2
0
    global $php_modules;
    $kill = false;
    $php_required_exts = array('xml', 'simplexml', 'dom', 'json');
    $php_modules = get_loaded_extensions();
    $php_modules = array_map('strtolower', $php_modules);
    foreach ($php_required_exts as $ext) {
        if (!in_array($ext, $php_modules)) {
            echo "PHP {$ext} extension NOT INSTALLED<br/>\n";
            $kill = 1;
        }
    }
    if ($kill) {
        die('Getsimple Install Cannot Continue');
    }
}
check_php_requirements();
$kill = '';
# setup inclusions
$load['plugin'] = true;
if (isset($_GET['lang'])) {
    $LANG = $_GET['lang'];
}
include 'inc/common.php';
# variable setup
// attempt to fix permissions issues
$dirsArray = array(GSDATAPATH, GSCACHEPATH, GSDATAOTHERPATH, GSDATAOTHERPATH . 'logs/', GSDATAPAGESPATH, GSDATAUPLOADPATH, GSTHUMBNAILPATH, GSBACKUPSPATH, GSBACKUPSPATH . getRelPath(GSDATAOTHERPATH, GSDATAPATH), GSBACKUPSPATH . getRelPath(GSDATAPAGESPATH, GSDATAPATH), GSBACKUPSPATH . 'zip/', GSBACKUSERSPATH, GSUSERSPATH, GSAUTOSAVEPATH);
// tmp-404.xml used as temporary write tester
// removed afterwards
foreach ($dirsArray as $dir) {
    $tmpfile = GSADMININCPATH . 'tmp/tmp-404.xml';
    if (file_exists($dir)) {
function make_status_of_zbx()
{
    global $USER_DETAILS, $ZBX_SERVER, $ZBX_SERVER_PORT;
    $table = new CTableInfo();
    $table->setHeader(array(S_PARAMETER, S_VALUE, S_DETAILS));
    show_messages();
    //because in function get_status(); function clear_messages() is called when fsockopen() fails.
    $status = get_status();
    $table->addRow(array(S_ZABBIX_SERVER_IS_RUNNING, new CSpan($status['zabbix_server'], $status['zabbix_server'] == S_YES ? 'off' : 'on'), isset($ZBX_SERVER, $ZBX_SERVER_PORT) ? $ZBX_SERVER . ':' . $ZBX_SERVER_PORT : S_ZABBIX_SERVER_IP_OR_PORT_IS_NOT_SET));
    $title = new CSpan(S_NUMBER_OF_HOSTS);
    $title->setAttribute('title', 'asdad');
    $table->addRow(array(S_NUMBER_OF_HOSTS, $status['hosts_count'], array(new CSpan($status['hosts_count_monitored'], 'off'), ' / ', new CSpan($status['hosts_count_not_monitored'], 'on'), ' / ', new CSpan($status['hosts_count_template'], 'unknown'))));
    $title = new CSpan(S_NUMBER_OF_ITEMS);
    $title->setAttribute('title', S_NUMBER_OF_ITEMS_TOOLTIP);
    $table->addRow(array($title, $status['items_count'], array(new CSpan($status['items_count_monitored'], 'off'), ' / ', new CSpan($status['items_count_disabled'], 'on'), ' / ', new CSpan($status['items_count_not_supported'], 'unknown'))));
    $title = new CSpan(S_NUMBER_OF_TRIGGERS);
    $title->setAttribute('title', S_NUMBER_OF_TRIGGERS_TOOLTIP);
    $table->addRow(array($title, $status['triggers_count'], array($status['triggers_count_enabled'], ' / ', $status['triggers_count_disabled'] . SPACE . SPACE . '[', new CSpan($status['triggers_count_on'], 'on'), ' / ', new CSpan($status['triggers_count_unknown'], 'unknown'), ' / ', new CSpan($status['triggers_count_off'], 'off'), ']')));
    /*
    	$table->addRow(array(S_NUMBER_OF_EVENTS,$status['events_count'],' - '));
    	$table->addRow(array(S_NUMBER_OF_ALERTS,$status['alerts_count'],' - '));
    //*/
    $table->addRow(array(S_NUMBER_OF_USERS, $status['users_count'], new CSpan($status['users_online'], 'green')));
    $table->addRow(array(S_REQUIRED_SERVER_PERFORMANCE_NVPS, $status['qps_total'], ' - '));
    // CHECK REQUIREMENTS {{{
    if ($USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN) {
        $reqs = check_php_requirements();
        foreach ($reqs as $req) {
            if ($req['result'] == false) {
                $table->addRow(array(new CSpan($req['name'], 'red'), new CSpan($req['current'], 'red'), new CSpan($req['error'], 'red')));
            }
        }
    }
    // }}}CHECK REQUIREMENTS
    $table->setFooter(new CCol(S_UPDATED . ': ' . zbx_date2str(S_BLOCKS_ZBX_STATUS_TIME_FORMAT)));
    return $table;
}