Example #1
0
    $script = new CScript("javascript: if(CLNDR['events_since'].clndr.setSDateFromOuterObj()){" . "\$('filter_timesince').value = parseInt(CLNDR['events_since'].clndr.sdt.getTime()/1000);}" . "if(CLNDR['events_till'].clndr.setSDateFromOuterObj()){" . "\$('filter_timetill').value = parseInt(CLNDR['events_till'].clndr.sdt.getTime()/1000);}");
    $filterForm->AddAction('onsubmit', $script);
    $filterForm->AddVar('triggerid', $_REQUEST['triggerid']);
    if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) {
        $trigger = expand_trigger_description($_REQUEST['triggerid']);
    } else {
        $trigger = "";
    }
    $row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox("trigger", $trigger, 96, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->GetName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r')));
    $filterForm->AddRow($row);
    $filterForm->AddVar('show_unknown', $show_unknown);
    $unkcbx = new CCheckBox('show_unk', $show_unknown, null, '1');
    $unkcbx->SetAction('javascript: create_var("' . $filterForm->GetName() . '", "show_unknown", (this.checked?1:0), 0); ');
    $filterForm->AddRow(S_SHOW_UNKNOWN, $unkcbx);
    $reset = new CButton("filter_rst", S_RESET);
    $reset->SetType('button');
    $reset->SetAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();');
    $filterForm->AddItemToBottomRow(new CButton("filter_set", S_FILTER));
    $filterForm->AddItemToBottomRow($reset);
    $p_elements[] = create_filter(S_FILTER, $navigation, $filterForm, 'tr_filter', get_profile('web.events.filter.state', 0));
} else {
    $p_elements[] = get_thin_table_header(SPACE, $navigation);
}
//-------
$p_elements[] = $table;
$p_elements[] = get_thin_table_header(SPACE, $navigation);
$events_hat = create_hat($text, $p_elements, $fs_icon, 'hat_events', get_profile('web.events.hats.hat_events.state', 1));
$events_hat->Show();
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once "include/page_footer.php";
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
**/
$regExpForm = new CForm();
$regExpForm->setName('regularExpressionsForm');
$regExpForm->addVar('form', $this->data['form']);
$regExpForm->addVar('form_refresh', $this->data['form_refresh']);
$regExpForm->addVar('regexpid', get_request('regexpid'));
$regExpLeftTable = new CTable();
$regExpLeftTable->addRow(create_hat(_('Regular expression'), get_regexp_form(), null, 'hat_regexp'));
$regExpRightTable = new CTable();
$regExpRightTable->addRow(create_hat(_('Expressions'), get_expressions_tab(), null, 'hat_expressions'));
if (isset($_REQUEST['new_expression'])) {
    $hatTable = create_hat(_('New expression'), get_expression_form(), null, 'hat_new_expression');
    $hatTable->setAttribute('style', 'margin-top: 3px;');
    $regExpRightTable->addRow($hatTable);
}
$regExpLeftColumn = new CCol($regExpLeftTable);
$regExpLeftColumn->setAttribute('valign', 'top');
$regExpRightColumn = new CCol($regExpRightTable);
$regExpRightColumn->setAttribute('valign', 'top');
$regExpOuterTable = new CTable();
$regExpOuterTable->addRow(array($regExpLeftColumn, new CCol(' '), $regExpRightColumn));
$regExpForm->addItem($regExpOuterTable);
show_messages();
return $regExpForm;
Example #3
0
$fs_icon = null;
if (isset($elementid) && $element) {
    if (infavorites('web.favorite.screenids', $elementid, 'screenid')) {
        $icon = new CDiv(SPACE, 'iconminus');
        $icon->addOption('title', S_REMOVE_FROM . ' ' . S_FAVORITES);
        $icon->addAction('onclick', new CScript("javascript: rm4favorites('screenid','" . $elementid . "',0);"));
    } else {
        $icon = new CDiv(SPACE, 'iconplus');
        $icon->addOption('title', S_ADD_TO . ' ' . S_FAVORITES);
        $icon->addAction('onclick', new CScript("javascript: add2favorites('screenid','" . $elementid . "');"));
    }
    $icon->addOption('id', 'addrm_fav');
    $url = '?elementid=' . $elementid . ($_REQUEST['fullscreen'] ? '' : '&fullscreen=1');
    $url .= url_param('groupid') . url_param('hostid');
    $fs_icon = new CDiv(SPACE, 'fullscreen');
    $fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
    $fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
}
if (2 == $_REQUEST['fullscreen']) {
    echo unpack_object($p_elements);
} else {
    $screens_hat = create_hat(S_SCREENS_BIG, $p_elements, array($icon, $fs_icon), 'hat_screens');
    $screens_hat->Show();
}
$scroll_div = new CDiv();
$scroll_div->addOption('id', 'scroll_cntnr');
$scroll_div->addOption('style', 'border: 0px #CC0000 solid; height: 25px; width: 800px;');
$scroll_div->show();
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once 'include/page_footer.php';
Example #4
0
     $tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][start_time]', $timeperiod['start_time']));
     $tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][start_date]', $timeperiod['start_date']));
     $tblPeriod->addItem(new Cvar('timeperiods[' . $id . '][period]', $timeperiod['period']));
 }
 $footer = array();
 if (!isset($_REQUEST['new_timeperiod'])) {
     $footer[] = new CButton('new_timeperiod', S_NEW);
 }
 if ($tblPeriod->ItemsCount() > 0) {
     $footer[] = new CButton('del_timeperiod', S_DELETE_SELECTED);
 }
 $left_tab->addRow(new CFormElement(S_MAINTENANCE, $tblPeriod, $footer));
 // }}} MAINTENANCE PERIODS
 if (isset($_REQUEST['new_timeperiod'])) {
     $new_timeperiod = $_REQUEST['new_timeperiod'];
     $left_tab->addRow(create_hat(is_array($new_timeperiod) && isset($new_timeperiod['id']) ? S_EDIT_MAINTENANCE_PERIOD : S_NEW_MAINTENANCE_PERIOD, get_timeperiod_form(), null, 'hat_new_timeperiod'));
 }
 $right_tab = new CTable();
 $right_tab->setCellPadding(3);
 $right_tab->setCellSpacing(3);
 // MAINTENANCE HOSTS {{{
 $options = array('editable' => true, 'output' => API_OUTPUT_EXTEND, 'real_hosts' => true, 'preservekeys' => true);
 $all_groups = CHostGroup::get($options);
 order_result($all_groups, 'name');
 $twb_groupid = get_request('twb_groupid', 0);
 if (!isset($all_groups[$twb_groupid])) {
     $twb_group = reset($all_groups);
     $twb_groupid = $twb_group['groupid'];
 }
 $cmbGroups = new CComboBox('twb_groupid', $twb_groupid, 'submit()');
 foreach ($all_groups as $group) {
Example #5
0
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
//-------
$left_tab = new CTable();
$left_tab->setCellPadding(3);
$left_tab->setCellSpacing(3);
$left_tab->addOption('border', 0);
$left_tab->addRow(create_hat(S_EVENT . SPACE . S_SOURCE . SPACE . S_DETAILS, make_trigger_details($_REQUEST['triggerid'], $trigger_data), null, 'hat_triggerdetails'));
$left_tab->addRow(create_hat(S_EVENT_DETAILS, make_event_details($_REQUEST['eventid']), null, 'hat_eventdetails'));
$right_tab = new CTable();
$right_tab->setCellPadding(3);
$right_tab->setCellSpacing(3);
$right_tab->addOption('border', 0);
$right_tab->addRow(create_hat(S_ACKNOWLEDGES, make_acktab_by_eventid($_REQUEST['eventid']), null, 'hat_eventack', get_profile('web.tr_events.hats.hat_eventack.state', 1)));
$right_tab->addRow(create_hat(S_MESSAGE_ACTIONS, get_action_msgs_for_event($_REQUEST['eventid']), null, 'hat_eventactionmsgs', get_profile('web.tr_events.hats.hat_eventactionmsgs.state', 1)));
$right_tab->addRow(create_hat(S_COMMAND_ACTIONS, get_action_cmds_for_event($_REQUEST['eventid']), null, 'hat_eventactioncmds', get_profile('web.tr_events.hats.hat_eventactioncmds.state', 1)));
$right_tab->addRow(create_hat(S_EVENTS . SPACE . S_LIST . SPACE . '[' . S_LAST . ' 20]', make_small_eventlist($_REQUEST['triggerid'], $trigger_data), null, 'hat_eventlist', get_profile('web.tr_events.hats.hat_eventlist.state', 1)));
$td_l = new CCol($left_tab);
$td_l->addOption('valign', 'top');
$td_r = new CCol($right_tab);
$td_r->addOption('valign', 'top');
$outer_table = new CTable();
$outer_table->addOption('border', 0);
$outer_table->setCellPadding(1);
$outer_table->setCellSpacing(1);
$outer_table->addRow(array($td_l, $td_r));
$p_elements[] = $outer_table;
$latest_hat = create_hat($text, $p_elements, array($fs_icon), 'hat_tr_events', get_profile('web.tr_events.hats.hat_tr_events.state', 1));
$latest_hat->show();
include_once 'include/page_footer.php';
Example #6
0
     $frmRegExp->addVar('config', get_request('config', 10));
     if (isset($_REQUEST['regexpid'])) {
         $frmRegExp->addVar('regexpid', $_REQUEST['regexpid']);
     }
     $left_tab = new CTable();
     $left_tab->setCellPadding(3);
     $left_tab->setCellSpacing(3);
     $left_tab->setAttribute('border', 0);
     $left_tab->addRow(create_hat(S_REGULAR_EXPRESSION, get_regexp_form(), null, 'hat_regexp'));
     $right_tab = new CTable();
     $right_tab->setCellPadding(3);
     $right_tab->setCellSpacing(3);
     $right_tab->setAttribute('border', 0);
     $right_tab->addRow(create_hat(S_EXPRESSIONS, get_expressions_tab(), null, 'hat_expressions'));
     if (isset($_REQUEST['new_expression'])) {
         $right_tab->addRow(create_hat(S_NEW_EXPRESSION, get_expression_form(), null, 'hat_new_expression'));
     }
     $td_l = new CCol($left_tab);
     $td_l->setAttribute('valign', 'top');
     $td_r = new CCol($right_tab);
     $td_r->setAttribute('valign', 'top');
     $outer_table = new CTable();
     $outer_table->setAttribute('border', 0);
     $outer_table->setCellPadding(1);
     $outer_table->setCellSpacing(1);
     $outer_table->addRow(array($td_l, $td_r));
     $frmRegExp->additem($outer_table);
     show_messages();
     $cnf_wdgt->addItem($frmRegExp);
 } else {
     $cnf_wdgt->addItem(BR());
Example #7
0
    foreach ($discovery_info as $ip => $h_data) {
        $table_row = array(get_node_name_by_elid($h_data['druleid']), new CSpan($ip, $h_data['class']), new CSpan($h_data['time'] == 0 ? '' : convert_units(time() - $h_data['time'], 'uptime'), $h_data['class']));
        foreach ($services as $name => $foo) {
            $class = null;
            $time = SPACE;
            $hint = new CDiv(SPACE, $class);
            $hintTable = new CTableInfo();
            $hintTable->addOption('border', 0);
            if (isset($h_data['services'][$name])) {
                $class = $h_data['services'][$name]['class'];
                $time = $h_data['services'][$name]['time'];
                if ($class == 'active') {
                    $hintTable->setHeader(S_UP_TIME);
                } else {
                    if ($class == 'inactive') {
                        $hintTable->setHeader(S_DOWN_TIME);
                    }
                }
                $timeColumn = new CCol(zbx_date2age($h_data['services'][$name]['time']), $class);
                $hintTable->addRow($timeColumn);
                $hint->setHint($hintTable);
            }
            $table_row[] = new CCol($hint, $class);
        }
        $table->AddRow($table_row);
    }
}
$p_elements[] = $table;
$latest_hat = create_hat(S_STATUS_OF_DISCOVERY_BIG, $p_elements, array($fs_icon), 'hat_discovery', get_profile('web.discovery.hats.hat_discovery.state', 1));
$latest_hat->Show();
include_once "include/page_footer.php";
Example #8
0
    $left_tab = new CTable();
    $left_tab->setCellPadding(3);
    $left_tab->setCellSpacing(3);
    $left_tab->setAttribute('border', 0);
    $left_tab->addRow(create_hat(S_MAINTENANCE, get_maintenance_form(), null, 'hat_maintenance'));
    $left_tab->addRow(create_hat(S_MAINTENANCE_PERIODS, get_maintenance_periods(), null, 'hat_timeperiods'));
    if (isset($_REQUEST['new_timeperiod'])) {
        $new_timeperiod = $_REQUEST['new_timeperiod'];
        $left_tab->addRow(create_hat(is_array($new_timeperiod) && isset($new_timeperiod['id']) ? S_EDIT_MAINTENANCE_PERIOD : S_NEW_MAINTENANCE_PERIOD, get_timeperiod_form(), null, 'hat_new_timeperiod'));
    }
    $right_tab = new CTable();
    $right_tab->setCellPadding(3);
    $right_tab->setCellSpacing(3);
    $right_tab->setAttribute('border', 0);
    $right_tab->addRow(create_hat(S_HOSTS_IN_MAINTENANCE, get_maintenance_hosts_form($frmMaintenance), null, 'hat_host_link'));
    $right_tab->addRow(create_hat(S_GROUPS_IN_MAINTENANCE, get_maintenance_groups_form($frmMaintenance), null, 'hat_group_link'));
    $td_l = new CCol($left_tab);
    $td_l->setAttribute('valign', 'top');
    $td_r = new CCol($right_tab);
    $td_r->setAttribute('valign', 'top');
    $outer_table = new CTable();
    $outer_table->setAttribute('border', 0);
    $outer_table->setCellPadding(1);
    $outer_table->setCellSpacing(1);
    $outer_table->addRow(array($td_l, $td_r));
    $frmMaintenance->additem($outer_table);
    show_messages();
    $frmMaintenance->show();
    //			insert_maintenance_form();
} else {
    echo SBR;
Example #9
0
			null,//make_webmon_overview(),
			null,
			'hat_custom',
			get_profile('web.dashboard.hats.hat_custom.state',1)
		));
*/
$td_l = new CCol($left_tab);
$td_l->addOption('valign', 'top');
$td_r = new CCol($right_tab);
$td_r->addOption('valign', 'top');
$outer_table = new CTable();
$outer_table->addOption('border', 0);
$outer_table->setCellPadding(1);
$outer_table->setCellSpacing(1);
$outer_table->addRow(array($td_l, $td_r));
$p_elements[] = $outer_table;
$fav_form = new CForm();
$fav_form->addOption('name', 'fav_form');
$fav_form->addOption('id', 'fav_form');
$fav_form->addOption('style', 'display: inline; margin: 0px;');
$fav_form->addVar('favobj', '');
$fav_form->addVar('favid', '');
$fav_form->addVar('source', '');
$p_elements[] = $fav_form;
$dashboard_hat = create_hat(S_DASHBOARD_BIG, $p_elements, array($fs_icon), 'hat_dashboard', get_profile('web.dashboard.hats.hat_dashboard.state', 1));
$dashboard_hat->Show();
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
//	$link = new CLink('Click Me','javascript: callJSON();','highlight');
//	$link->Show();
include_once "include/page_footer.php";
    if (isset($timeperiod['timeperiodid'])) {
        $maintenanceForm->addVar('timeperiods[' . $id . '][timeperiodid]', $timeperiod['timeperiodid']);
    }
    $maintenanceForm->addVar('timeperiods[' . $id . '][timeperiod_type]', $timeperiod['timeperiod_type']);
    $maintenanceForm->addVar('timeperiods[' . $id . '][every]', $timeperiod['every']);
    $maintenanceForm->addVar('timeperiods[' . $id . '][month]', $timeperiod['month']);
    $maintenanceForm->addVar('timeperiods[' . $id . '][dayofweek]', $timeperiod['dayofweek']);
    $maintenanceForm->addVar('timeperiods[' . $id . '][day]', $timeperiod['day']);
    $maintenanceForm->addVar('timeperiods[' . $id . '][start_time]', $timeperiod['start_time']);
    $maintenanceForm->addVar('timeperiods[' . $id . '][start_date]', $timeperiod['start_date']);
    $maintenanceForm->addVar('timeperiods[' . $id . '][period]', $timeperiod['period']);
}
$maintenancePeriodFormList->addRow(_('Periods'), array($maintenancePeriodTable, new CSubmit('new_timeperiod', _('New'), null, 'link_menu'), SPACE, SPACE, new CSubmit('del_timeperiod', _('Delete selected'), null, 'link_menu')));
if (isset($_REQUEST['new_timeperiod'])) {
    $label = is_array($_REQUEST['new_timeperiod']) && isset($_REQUEST['new_timeperiod']['id']) ? _('Edit maintenance period') : _('New maintenance period');
    $maintenancePeriodFormList->addRow(SPACE, array(BR(), create_hat($label, get_timeperiod_form(), null, 'hat_new_timeperiod')));
}
/*
 * Hosts & groups tab
 */
$hostsAndGroupsFormList = new CFormList('hostsAndGroupsFormList');
$hostTweenBox = new CTweenBox($maintenanceForm, 'hostids', $this->data['hostids'], 10);
foreach ($this->data['hosts'] as $host) {
    $hostTweenBox->addItem($host['hostid'], $host['name']);
}
$groupsComboBox = new CComboBox('twb_groupid', $this->data['twb_groupid'], 'submit()');
foreach ($this->data['all_groups'] as $group) {
    $groupsComboBox->addItem($group['groupid'], $group['name']);
}
$hostTable = new CTable(null, 'formElementTable');
$hostTable->addRow($hostTweenBox->get(_('In maintenance'), array(_('Other hosts | Group') . SPACE, $groupsComboBox)));
Example #11
0
$rep_tab->addOption('border', 0);
// --------------
switch ($config) {
    case 1:
        $rep_form = bar_report_form();
        break;
    case 2:
        $rep_form = bar_report_form2();
        break;
    case 3:
        $rep_form = bar_report_form3();
        break;
    default:
        $rep_form = bar_report_form();
}
$form = create_filter(S_REPORTS, NULL, $rep_form, 'report_form', get_profile('web.report6.filter.state', 1));
$form->Show();
if (isset($_REQUEST['report_show'])) {
    $src = 'chart_bar.php?config=' . $_REQUEST['config'] . url_param('title') . url_param('xlabel') . url_param('ylabel') . url_param('scaletype') . url_param('avgperiod') . url_param('showlegend') . url_param('sorttype') . url_param('report_timesince') . url_param('report_timetill') . url_param('periods') . url_param('items') . url_param('hostids') . url_param('groupids') . url_param('palette') . url_param('palettetype');
    $rep_tab->addRow(create_hat(S_REPORT, new CImg($src, 'report'), null, 'hat_report', get_profile('web.report6.hats.hat_report.state', 1)));
}
$outer_table = new CTable();
$outer_table->addOption('border', 0);
$outer_table->addOption('width', '100%');
$outer_table->setCellPadding(1);
$outer_table->setCellSpacing(1);
$tmp_row = new CRow($rep_tab);
$tmp_row->addOption('align', 'center');
$outer_table->addRow($tmp_row);
$outer_table->Show();
include_once 'include/page_footer.php';
Example #12
0
            }
        } else {
            $state = S_IDLE_TILL . ' ' . date(S_DATE_FORMAT_YMDHMS, $httptest_data['nextcheck']);
            $status['msg'] = S_UNKNOWN;
            $status['style'] = 'unknown';
        }
    }
    array_push($app_rows, new CRow(array(is_show_subnodes() ? SPACE : NULL, $_REQUEST['hostid'] > 0 ? NULL : SPACE, array(str_repeat(SPACE, 6), $name), $httptest_data['step_cout'], $state, $lastcheck, new CSpan($status['msg'], $status['style']))));
}
unset($app_rows);
unset($db_app);
foreach ($tab_rows as $appid => $app_rows) {
    $db_app =& $db_apps[$appid];
    if (uint_in_array($db_app['applicationid'], $_REQUEST['applications']) || isset($show_all_apps)) {
        $link = new CLink(new CImg('images/general/opened.gif'), '?close=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
    } else {
        $link = new CLink(new CImg('images/general/closed.gif'), '?open=1&applicationid=' . $db_app['applicationid'] . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'));
    }
    $col = new CCol(array($link, SPACE, bold($db_app['name']), SPACE . '(' . $db_app['scenarios_cnt'] . SPACE . S_SCENARIOS . ')'));
    $col->SetColSpan(6);
    $table->addRow(array(get_node_name_by_elid($db_app['applicationid']), $_REQUEST['hostid'] > 0 ? NULL : $db_app['host'], $col));
    $any_app_exist = true;
    foreach ($app_rows as $row) {
        $table->addRow($row);
    }
}
$form->addItem($table);
$p_elements[] = $form;
$latest_hat = create_hat(S_STATUS_OF_WEB_MONITORING_BIG, $p_elements, null, 'hat_httpmon', get_profile('web.httpmon.hats.hat_httpmon.state', 1));
$latest_hat->Show();
include_once 'include/page_footer.php';
Example #13
0
$text = array(S_OVERVIEW_BIG);
$url = 'overview.php?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$form_l = new CForm();
$form_l->setMethod('get');
$form_l->addVar('groupid', $_REQUEST['groupid']);
$cmbStyle = new CComboBox('view_style', $_REQUEST['view_style'], 'submit()');
$cmbStyle->addItem(STYLE_TOP, S_TOP);
$cmbStyle->addItem(STYLE_LEFT, S_LEFT);
$form_l->additem(array(S_HOSTS_LOCATION . SPACE, $cmbStyle));
$p_elements[] = get_table_header($form_l, $form);
//-------------
if ($_REQUEST['type'] == SHOW_DATA) {
    COpt::profiling_start('get_items_data_overview');
    $table = get_items_data_overview($PAGE_HOSTS['hostids'], $_REQUEST['view_style']);
    COpt::profiling_stop('get_items_data_overview');
} else {
    if ($_REQUEST['type'] == SHOW_TRIGGERS) {
        COpt::profiling_start('get_triggers_overview');
        $table = get_triggers_overview($PAGE_HOSTS['hostids'], $_REQUEST['view_style']);
        COpt::profiling_stop('get_triggers_overview');
    }
}
$p_elements[] = $table;
$overview_hat = create_hat($text, $p_elements, array($help, $fs_icon), 'hat_overview', get_profile('web.overview.hats.hat_overview.state', 1));
$overview_hat->Show();
//	$table->Show();
//	unset($table);
include_once 'include/page_footer.php';
Example #14
0
    $left_tab->setAttribute('border', 0);
    $left_tab->addRow(create_hat(S_ACTION, get_act_action_form($action), null, 'hat_action'));
    $left_tab->addRow(create_hat(S_ACTION_CONDITIONS, get_act_condition_form($action), null, 'hat_conditions'));
    if (isset($_REQUEST['new_condition'])) {
        $left_tab->addRow(create_hat(S_NEW_CONDITION, get_act_new_cond_form($action), null, 'hat_new_cond'));
    }
    $right_tab = new CTable();
    $right_tab->setCellPadding(3);
    $right_tab->setCellSpacing(3);
    $right_tab->setAttribute('border', 0);
    $right_tab->addRow(create_hat(S_ACTION_OPERATIONS, get_act_operations_form($action), null, 'hat_operations'));
    if (isset($_REQUEST['new_operation'])) {
        $right_tab->addRow(create_hat(S_EDIT_OPERATION, get_act_new_oper_form($action), null, 'hat_new_oper'));
    }
    if (isset($_REQUEST['new_opcondition'])) {
        $right_tab->addRow(create_hat(S_NEW . SPACE . S_OPERATION_CONDITION, get_oper_new_cond_form($action), null, 'hat_new_oper_cond'));
    }
    $td_l = new CCol($left_tab);
    $td_l->setAttribute('valign', 'top');
    $td_r = new CCol($right_tab);
    $td_r->setAttribute('valign', 'top');
    $outer_table = new CTable();
    $outer_table->setAttribute('border', 0);
    $outer_table->setCellPadding(1);
    $outer_table->setCellSpacing(1);
    $outer_table->addRow(array($td_l, $td_r));
    $frmAction->additem($outer_table);
    show_messages();
    $frmAction->Show();
    //*/
} else {
Example #15
0
if (isset($_REQUEST["sysmapid"])) {
    $action_map = get_action_map_by_sysmapid($_REQUEST["sysmapid"]);
    $table->AddRow($action_map);
    $imgMap = new CImg("map.php?noedit=1&sysmapid=" . $_REQUEST["sysmapid"]);
    $imgMap->SetMap($action_map->GetName());
    $table->AddRow($imgMap);
}
$p_elements[] = $table;
$icon = null;
$fs_icon = null;
if (isset($_REQUEST["sysmapid"])) {
    $sysmap = get_sysmap_by_sysmapid($_REQUEST["sysmapid"]);
    $text = $all_maps[$_REQUEST["sysmapid"]];
    if (infavorites('web.favorite.sysmapids', $_REQUEST['sysmapid'], 'sysmapid')) {
        $icon = new CDiv(SPACE, 'iconminus');
        $icon->AddOption('title', S_REMOVE_FROM . ' ' . S_FAVORITES);
        $icon->AddAction('onclick', new CScript("javascript: rm4favorites('sysmapid','" . $_REQUEST["sysmapid"] . "',0);"));
    } else {
        $icon = new CDiv(SPACE, 'iconplus');
        $icon->AddOption('title', S_ADD_TO . ' ' . S_FAVORITES);
        $icon->AddAction('onclick', new CScript("javascript: add2favorites('sysmapid','" . $_REQUEST["sysmapid"] . "');"));
    }
    $icon->AddOption('id', 'addrm_fav');
    $url = '?sysmapid=' . $_REQUEST['sysmapid'] . ($_REQUEST['fullscreen'] ? '' : '&fullscreen=1');
    $fs_icon = new CDiv(SPACE, 'fullscreen');
    $fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
    $fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
}
$latest_hat = create_hat(S_NETWORK_MAPS_BIG, $p_elements, array($icon, $fs_icon), 'hat_maps', get_profile('web.maps.hats.hat_maps.state', 1));
$latest_hat->Show();
include_once "include/page_footer.php";
Example #16
0
        $icon->addAction('onclick', new CScript("javascript: rm4favorites('graphid','" . $_REQUEST['graphid'] . "',0);"));
    } else {
        $icon = new CDiv(SPACE, 'iconplus');
        $icon->addOption('title', S_ADD_TO . ' ' . S_FAVORITES);
        $icon->addAction('onclick', new CScript("javascript: add2favorites('graphid','" . $_REQUEST['graphid'] . "');"));
    }
    $icon->addOption('id', 'addrm_fav');
    $url = '?graphid=' . $_REQUEST['graphid'] . ($_REQUEST['fullscreen'] ? '' : '&fullscreen=1');
    $fs_icon = new CDiv(SPACE, 'fullscreen');
    $fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
    $fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
    $rst_icon = new CDiv(SPACE, 'iconreset');
    $rst_icon->addOption('title', S_RESET);
    $rst_icon->addAction('onclick', new CScript("javascript: graphload(SCROLL_BAR.dom_graphs, " . (time() + 100000000) . ", 3600, false);"));
}
$charts_hat = create_hat(S_GRAPHS_BIG, $p_elements, array($icon, $rst_icon, $fs_icon), 'hat_charts', get_profile('web.charts.hats.hat_charts.state', 1));
$charts_hat->show();
if ($_REQUEST['graphid'] > 0) {
    // NAV BAR
    $stime = get_min_itemclock_by_graphid($_REQUEST['graphid']);
    $stime = is_null($stime) ? 0 : $stime;
    $bstime = time() - $effectiveperiod;
    if (isset($_REQUEST['stime'])) {
        $bstime = $_REQUEST['stime'];
        $bstime = mktime(substr($bstime, 8, 2), substr($bstime, 10, 2), 0, substr($bstime, 4, 2), substr($bstime, 6, 2), substr($bstime, 0, 4));
    }
    $script = 'scrollinit(0,' . $effectiveperiod . ',' . $stime . ',0,' . $bstime . '); showgraphmenu("graph");';
    if ($graphtype == GRAPH_TYPE_NORMAL || $graphtype == GRAPH_TYPE_STACKED) {
        $script .= 'graph_zoom_init("' . $dom_graph_id . '",' . $bstime . ',' . $effectiveperiod . ',ZBX_G_WIDTH,' . $graph_height . ',true);';
    }
    zbx_add_post_js($script);
Example #17
0
     $frmRegExp->addVar('config', get_request('config', 10));
     if (isset($_REQUEST['regexpid'])) {
         $frmRegExp->addVar('regexpid', $_REQUEST['regexpid']);
     }
     $left_tab = new CTable();
     $left_tab->setCellPadding(3);
     $left_tab->setCellSpacing(3);
     $left_tab->addOption('border', 0);
     $left_tab->addRow(create_hat(S_REGULAR_EXPRESSION, get_regexp_form(), null, 'hat_regexp', get_profile('web.config.hats.hat_regexp.state', 1)));
     $right_tab = new CTable();
     $right_tab->setCellPadding(3);
     $right_tab->setCellSpacing(3);
     $right_tab->addOption('border', 0);
     $right_tab->addRow(create_hat(S_EXPRESSIONS, get_expressions_tab(), null, 'hat_expressions', get_profile('web.config.hats.hat_expressions.state', 1)));
     if (isset($_REQUEST['new_expression'])) {
         $right_tab->addRow(create_hat(S_NEW_EXPRESSION, get_expression_form(), null, 'hat_new_expression', get_profile('web.config.hats.hat_new_expression.state', 1)));
     }
     $td_l = new CCol($left_tab);
     $td_l->AddOption('valign', 'top');
     $td_r = new CCol($right_tab);
     $td_r->AddOption('valign', 'top');
     $outer_table = new CTable();
     $outer_table->AddOption('border', 0);
     $outer_table->SetCellPadding(1);
     $outer_table->SetCellSpacing(1);
     $outer_table->AddRow(array($td_l, $td_r));
     $frmRegExp->Additem($outer_table);
     show_messages();
     $frmRegExp->Show();
 } else {
     echo SBR;
Example #18
0
        //			$link = new CLink(new CImg('images/general/opened.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');");
    } else {
        $url = '?open=1&applicationid=0' . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select');
        $link = new CLink(new CImg('images/general/closed.gif'), $url);
        //			$link = new CLink(new CImg('images/general/closed.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');");
    }
    $col = new CCol(array($link, SPACE, bold(S_MINUS_OTHER_MINUS), SPACE . '(' . $db_host['item_cnt'] . SPACE . S_ITEMS . ')'));
    $col->SetColSpan(5);
    $table->AddRow(array(get_node_name_by_elid($db_host['hostid']), $_REQUEST['hostid'] > 0 ? NULL : $db_host['host'], $col));
    foreach ($app_rows as $row) {
        $table->AddRow($row);
    }
}
$p_elements[] = $table;
/*
// Refresh tab
	$refresh_tab = array(
		array('id'	=> ZBX_PAGE_MAIN_HAT,
				'interval' 	=> $USER_DETAILS['refresh'],
				'url'	=>	zbx_empty($_SERVER['QUERY_STRING'])?'':'?'.$_SERVER['QUERY_STRING'],
			)
	);
//*/
$url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
$fs_icon = new CDiv(SPACE, 'fullscreen');
$fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
$fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
$latest_hat = create_hat(S_LATEST_DATA_BIG, $p_elements, array($fs_icon), ZBX_PAGE_MAIN_HAT, get_profile('web.latest.hats.hat_latest.state', 1));
$latest_hat->Show();
//	add_refresh_objects($refresh_tab);
include_once 'include/page_footer.php';
Example #19
0
$refresh_icon->addOption('title', S_MENU);
if (isset($elementid)) {
    $effectiveperiod = navigation_bar_calc();
    if (2 != $_REQUEST['fullscreen']) {
        $stime = time() - 31536000;
        // ~1year
        $bstime = time() - $effectiveperiod;
        if (isset($_REQUEST['stime'])) {
            $bstime = $_REQUEST['stime'];
            $bstime = mktime(substr($bstime, 8, 2), substr($bstime, 10, 2), 0, substr($bstime, 4, 2), substr($bstime, 6, 2), substr($bstime, 0, 4));
        }
        zbx_add_post_js('onload_update_scroll("iframe",0,' . $effectiveperiod . ',' . $stime . ',0,' . $bstime . ');');
    }
    $element = get_slideshow($elementid, 0, $effectiveperiod);
} else {
    $element = new CSpan(S_LOADING_P, 'textcolorstyles');
}
$tab->addRow(create_hat($slide_name, $element, array($icon, $fs_icon, $refresh_icon), 'hat_slides', get_profile('web.slides.hats.hat_slides.state', 1)), 'center');
$tab->show();
$scroll_div = new CDiv();
$scroll_div->addOption('id', 'scroll_cntnr');
$scroll_div->addOption('style', 'border: 0px #CC0000 solid; height: 25px; width: 800px;');
$scroll_div->show();
/*	
	$img = new CImg('images/general/tree/zero.gif','space','20','20');
	$elements = array($img,BR());
	print(unpack_object($elements));
//*/
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once 'include/page_footer.php';
Example #20
0
        if (isset($services[$row['serviceid']])) {
            $services[$row['serviceid']] = array_merge($services[$row['serviceid']], $row);
        } else {
            $services[$row['serviceid']] = $row;
        }
        if (isset($row['serviceupid'])) {
            $services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0);
        }
        if (isset($row['servicedownid'])) {
            $services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']);
        }
    }
    $treeServ = array();
    createShowServiceTree($services, $treeServ);
    //return into $treeServ parametr
    //permission issue
    $treeServ = del_empty_nodes($treeServ);
    $tree = new CTree($treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold(S_SLA_LAST_7_DAYS), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH)));
    if ($tree) {
        $url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
        $fs_icon = new CDiv(SPACE, 'fullscreen');
        $fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
        $fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
        $tab = create_hat(S_IT_SERVICES_BIG, $tree->getHTML(), null, 'hat_services', get_profile('web.srv_status.hats.hat_services.state', 1));
        $tab->Show();
        unset($tab);
    } else {
        error('Can not format Tree. Check logik structure in service links');
    }
}
include_once "include/page_footer.php";
Example #21
0
                $ack = array(new CSpan(S_YES, 'off'), SPACE . '(' . $acks_cnt['cnt'] . SPACE, new CLink(S_SHOW, 'acknow.php?eventid=' . $row_event['eventid'], 'action'), ')');
            } else {
                $ack = new CLink(S_NOT_ACKNOWLEDGED, 'acknow.php?eventid=' . $row_event['eventid'], 'on');
            }
        }
        $description = expand_trigger_description_by_data(array_merge($row, array('clock' => $row_event['clock'])), ZBX_FLAG_EVENT);
        $font = new CTag('font', 'yes');
        $font->addOption('color', '#808080');
        $font->addItem(array(' - ', $description));
        $description = $font;
        $description = new CCol($description);
        $description->addOption('style', 'white-space: normal; width: 90%;');
        $table->addRow(array($config['event_ack_enable'] ? $row_event['acknowledged'] == 1 ? SPACE : new CCheckBox('events[' . $row_event['eventid'] . ']', 'no', NULL, $row_event['eventid']) : NULL, new CCol(get_severity_description($row['priority']), get_severity_style($row['priority'], $row_event['value'])), $value, new CLink(zbx_date2str(S_DATE_FORMAT_YMDHMS, $row_event['clock']), 'tr_events.php?triggerid=' . $row['triggerid'] . '&eventid=' . $row_event['eventid'], 'action'), get_node_name_by_elid($row['triggerid']), $host, $description, $actions, $config['event_ack_enable'] ? new CCol($ack, 'center') : NULL, new CLink($row['comments'] == '' ? S_ADD : S_SHOW, 'tr_comments.php?triggerid=' . $row['triggerid'], 'action')));
        $event_limit++;
        if ($event_limit >= $config['event_show_max']) {
            break;
        }
    }
    unset($row, $description, $actions);
}
$table->setFooter(new CCol(array($config['event_ack_enable'] ? new CButton('bulkacknowledge', S_BULK_ACKNOWLEDGE, 'javascript: submit();') : SPACE)));
$m_form->addItem($table);
unset($table);
$p_elements[] = $m_form;
$triggers_hat = create_hat($text, $p_elements, array($mute_icon, $fs_icon), 'hat_triggers', get_profile('web.tr_status.hats.hat_triggers.state', 1));
$triggers_hat->Show();
zbx_add_post_js('insert_in_element("tr_numrows","' . $triggers_num . '");');
zbx_add_post_js('blink.init();');
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once 'include/page_footer.php';