Esempio n. 1
0
$groups = API::HostGroup()->get(array('output' => API_OUTPUT_EXTEND));
order_result($groups, 'name');
$group_combo = new CComboBox('group', $_REQUEST['group'], 'javascript: submit();');
foreach ($groups as $group) {
    $group_combo->addItem($group['groupid'], $group['name']);
}
$item_combo = new CComboBox('item', $_REQUEST['item'], 'javascript: submit();');
if (isset($_REQUEST['group'])) {
    $items = get_items_by_groupid($_REQUEST['group']);
    foreach ($items as $item) {
        $item_combo->addItem($item, $item);
    }
}
$rightForm = new CForm('get');
$rightForm->addItem(array(_('Group') . SPACE, $group_combo));
$rightForm->addItem(array(SPACE . _('Item') . SPACE, $item_combo));
$sortWidget->addPageHeader(_('SORT HOSTVALUE') . SPACE . '[' . zbx_date2str(_('d M Y H:i:s')) . ']');
$sortWidget->addHeader(_('Sort hostvalue'), $rightForm);
$sortTable = new CTableInfo(_('No hostitem found.'));
$sortTable->setHeader(array(_('Host'), _('Last Time'), make_sorting_header(_('Last Value'), 'lastvalue'), make_sorting_header(_('Prev Value'), 'prevvalue'), _('Graph')));
if (isset($_REQUEST['group']) && isset($_REQUEST['item'])) {
    $items = API::Item()->get(array('output' => array('hostid', 'lastclock', 'lastvalue', 'prevvalue', 'itemid'), 'groupids' => $_REQUEST['group'], 'filter' => array('key_' => $_REQUEST['item'])));
    order_result($items, $sortfield, $sortorder);
    foreach ($items as $item) {
        $host = get_host_by_hostid($item['hostid']);
        $sortTable->addRow(array($host['name'], date('Y-m-d H:i:s', $item['lastclock']), $item['lastvalue'], $item['prevvalue'], new CLink(_('Show'), 'history.php?action=showgraph&itemid=' . $item['itemid'])));
    }
}
$sortWidget->addItem($sortTable);
$sortWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 2
0
// SPACE added to extend CB width in Chrome
$cbMain = new CCheckBox('maintenance', $maintenance, null, '1');
if (!$filterEnable) {
    $cbMain->setAttribute('disabled', 'disabled');
}
$dashForm->addRow(S_HOSTS, array($cbMain, S_SHOW_HOSTS_IN_MAINTENANCE));
// Trigger
$severity = zbx_toHash($severity);
$trgSeverities = array();
$severities = array(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH, TRIGGER_SEVERITY_DISASTER);
foreach ($severities as $snum => $sever) {
    $cb = new CCheckBox('trgSeverity[' . $sever . ']', isset($severity[$sever]), '', 1);
    $cb->setEnabled($filterEnable);
    $trgSeverities[] = array($cb, getSeverityCaption($sever));
    $trgSeverities[] = BR();
}
array_pop($trgSeverities);
$dashForm->addRow(S_TRIGGERS_WITH_SEVERITY, $trgSeverities);
$config = select_config();
$cb = new CComboBox('extAck', $extAck);
$cb->addItems(array(EXTACK_OPTION_ALL => S_O_ALL, EXTACK_OPTION_BOTH => S_O_SEPARATED, EXTACK_OPTION_UNACK => S_O_UNACKNOWLEDGED_ONLY));
$cb->setEnabled($filterEnable && $config['event_ack_enable']);
if (!$config['event_ack_enable']) {
    $cb->setAttribute('title', S_EVENT_ACKNOWLEDGING_DISABLED);
}
$dashForm->addRow(S_PROBLEM_DISPLAY, $cb);
//-----
$dashForm->addItemToBottomRow(new CButton('save', S_SAVE));
$dashboard_wdgt->addItem($dashForm);
$dashboard_wdgt->show();
include_once 'include/page_footer.php';
Esempio n. 3
0
            $problemTrigger['description'] = $triggers[$problemTrigger['triggerid']]['description'];
        }
        unset($problemTrigger);
    }
    unset($serviceSla);
    $treeData = array();
    createServiceMonitoringTree($services, $slaData, $period, $treeData);
    $tree = new CServiceTree('service_status_tree', $treeData, array('caption' => _('Service'), 'status' => _('Status'), 'reason' => _('Reason'), 'sla' => _('Problem time'), 'sla2' => nbsp(_('SLA') . ' / ' . _('Acceptable SLA'))));
    if ($tree) {
        // creates form for choosing a preset interval
        $r_form = new CForm();
        $r_form->setAttribute('class', 'nowrap');
        $r_form->setMethod('get');
        $r_form->setAttribute('name', 'period_choice');
        $r_form->addVar('fullscreen', $_REQUEST['fullscreen']);
        $period_combo = new CComboBox('period', $period, 'javascript: submit();');
        foreach ($periods as $key => $val) {
            $period_combo->addItem($key, $val);
        }
        $r_form->addItem(array(_('Period') . SPACE, $period_combo));
        $srv_wdgt = new CWidget('hat_services', 'service-list service-mon');
        $srv_wdgt->addPageHeader(_('IT SERVICES'), get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen'])));
        $srv_wdgt->addHeader(_('IT services'), $r_form);
        $srv_wdgt->addItem(BR());
        $srv_wdgt->addItem($tree->getHTML());
        $srv_wdgt->show();
    } else {
        error(_('Cannot format Tree. Check logic structure in service links.'));
    }
}
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 4
0
            $row = new CRow(array(SPACE, $config['event_ack_enable'] ? $ack_cb_col : null, $status, $clock, zbx_date2age($row_event['clock']), zbx_date2age($next_clock, $row_event['clock']), $config['event_ack_enable'] ? $ack : NULL, is_show_all_nodes() ? SPACE : null, $empty_col), 'odd_row');
            $row->setAttribute('data-parentid', $trigger['triggerid']);
            $row->addStyle('display: none;');
            $table->addRow($row);
            if ($i > $config['event_show_max']) {
                break;
            }
        }
    }
}
//----- GO ------
$footer = null;
if ($config['event_ack_enable']) {
    $goBox = new CComboBox('go');
    $goBox->addItem('bulkacknowledge', S_BULK_ACKNOWLEDGE);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    $show_event_col ? zbx_add_post_js('chkbxRange.pageGoName = "events";') : zbx_add_post_js('chkbxRange.pageGoName = "triggers";');
    $footer = get_table_header(array($goBox, $goButton));
}
//----
$table = array($paging, $table, $paging, $footer);
$m_form->addItem($table);
$trigg_wdgt->addItem($m_form);
$trigg_wdgt->show();
zbx_add_post_js('blink.init();');
zbx_add_post_js("var switcher = new CSwitcher('{$switcherName}');");
$jsmenu = new CPUMenu(null, 170);
$jsmenu->InsertJavaScript();
include_once 'include/page_footer.php';
Esempio n. 5
0
        if ($host['status'] == HOST_STATUS_MONITORED) {
            $monitoredHostIds[$host['hostid']] = true;
        }
    }
}
if ($monitoredHostIds) {
    $monitoredHosts = API::Host()->get(array('output' => array('hostid'), 'selectGroups' => array('groupid'), 'hostids' => array_keys($monitoredHostIds), 'preservekeys' => true));
}
foreach ($triggers as $trigger) {
    foreach ($trigger['hosts'] as $host) {
        if ($host['status'] == HOST_STATUS_MONITORED) {
            // Pass a monitored 'hostid' and corresponding first 'groupid' to menu pop-up "Events" link.
            $trigger['hostid'] = $host['hostid'];
            $trigger['groupid'] = $monitoredHosts[$trigger['hostid']]['groups'][0]['groupid'];
            break;
        } else {
            // Unmonitored will have disabled "Events" link and there is no 'groupid' or 'hostid'.
            $trigger['hostid'] = 0;
            $trigger['groupid'] = 0;
        }
    }
    $hostId = $trigger['hosts'][0]['hostid'];
    $hostName = new CSpan($trigger['hosts'][0]['name'], 'link_menu menu-host' . ($hosts[$hostId]['status'] == HOST_STATUS_NOT_MONITORED ? ' not-monitored' : ''));
    $hostName->setMenuPopup(CMenuPopupHelper::getHost($hosts[$hostId], $scripts[$hostId]));
    $triggerDescription = new CSpan($trigger['description'], 'link_menu');
    $triggerDescription->setMenuPopup(CMenuPopupHelper::getTrigger($trigger));
    $table->addRow(array($hostName, $triggerDescription, getSeverityCell($trigger['priority']), $trigger['cnt_event']));
}
$rprt_wdgt->addItem($table);
$rprt_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
        }
    } else {
        if (empty($apps)) {
            $url = '?open=1&applicationid=0';
        } else {
            if (isset($apps[0])) {
                $url = '?close=1' . url_param($tmp_apps, false, 'apps');
            } else {
                $url = '?close=1&applicationid=0' . url_param($tmp_apps, false, 'apps');
            }
        }
    }
    $url .= url_param('groupid') . url_param('hostid') . url_param('fullscreen') . url_param('select');
    $link = new CLink($img, $url);
    $col = new CCol(array(bold('- ' . 'other' . ' -'), SPACE . '(' . _n('%1$s Item', '%1$s Items', $db_host['item_cnt']) . ')'));
    $col->setColSpan(5);
    // host JS menu link
    $hostSpan = null;
    if ($_REQUEST['hostid'] == 0) {
        $hostSpan = new CSpan($host['name'], 'link_menu menu-host');
        $scripts = $hostScripts[$host['hostid']];
        $hostSpan->setAttribute('data-menu', hostMenuData($host, $scripts));
    }
    $table->addRow(array($link, get_node_name_by_elid($db_host['hostid']), $hostSpan, $col));
    foreach ($app_rows as $row) {
        $table->addRow($row);
    }
}
$latest_wdgt->addItem($table);
$latest_wdgt->show();
require_once 'include/page_footer.php';
Esempio n. 7
0
    $hosts_count = CTemplate::get($params);
    $overalCount = $hosts_count['rowscount'];
    $viewCount = count($templates);
    $header = array(is_show_all_nodes() ? new CCol(S_NODE) : null, new CCol(S_TEMPLATES), new CCol(S_ITEMS), new CCol(S_TRIGGERS), new CCol(S_GRAPHS));
    $table = new CTableInfo();
    $table->setHeader($header);
    foreach ($templates as $num => $template) {
        $templateid = $template['hostid'];
        $groupid = isset($hostsgroups[$templateid]) ? $hostsgroups[$templateid] : 0;
        $link = 'groupid=' . $groupid . '&hostid=' . $templateid;
        $caption = make_decoration($template['host'], $search);
        $table->addRow(array(get_node_name_by_elid($templateid), new CLink($caption, 'hosts.php?config=3&hostid=' . $templateid), new CLink(S_GO, 'items.php?' . $link), new CLink(S_GO, 'triggers.php?' . $link), new CLink(S_GO, 'graphs.php?' . $link)));
    }
    $table->setFooter(new CCol(S_DISPLAYING . SPACE . $viewCount . SPACE . S_OF_SMALL . SPACE . $overalCount . SPACE . S_FOUND_SMALL));
    $wdgt_templates = new CWidget('search_templates', $table);
    $wdgt_templates->addHeader(S_TEMPLATES, SPACE);
    $right_tab->addRow($wdgt_templates);
}
//----------------
$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));
$search_wdgt->addItem($outer_table);
$search_wdgt->show();
include_once 'include/page_footer.php';
Esempio n. 8
0
            $proxy = get_host_by_hostid($rule_data["proxy_hostid"]);
            array_push($description, $proxy["host"], ":");
        }
        array_push($description, new CLink($rule_data['name'], "?form=update&druleid=" . $rule_data['druleid']));
        $tblDiscovery->addRow(array(new CCheckBox('g_druleid[' . $rule_data["druleid"] . ']', null, null, $rule_data["druleid"]), $description, $rule_data['iprange'], $rule_data['delay'], implode(', ', $checks), $status));
    }
    // pagination at the top and the bottom of the page
    $tblDiscovery->addRow(new CCol($paging));
    $dscry_wdgt->addItem($paging);
    // gobox
    $goBox = new CComboBox('go');
    $goOption = new CComboItem('activate', S_ENABLE_SELECTED);
    $goOption->setAttribute('confirm', S_ENABLE_SELECTED_DISCOVERY_RULES);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('disable', S_DISABLE_SELECTED);
    $goOption->setAttribute('confirm', S_DISABLE_SELECTED_DISCOVERY_RULES);
    $goBox->addItem($goOption);
    $goOption = new CComboItem('delete', S_DELETE_SELECTED);
    $goOption->setAttribute('confirm', S_DELETE_SELECTED_DISCOVERY_RULES);
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CButton('goButton', S_GO . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "g_druleid";');
    $tblDiscovery->setFooter(new CCol(array($goBox, $goButton)));
    //----
    $form->addItem($tblDiscovery);
    $dscry_wdgt->addItem($form);
}
$dscry_wdgt->show();
include_once 'include/page_footer.php';
Esempio n. 9
0
switch ($config) {
    default:
    case 1:
        $rep_form = valueDistributionFormForMultiplePeriods($validItems);
        break;
    case 2:
        $rep_form = valueDistributionFormForMultipleItems($validItems, $validPeriods);
        break;
    case 3:
        $rep_form = valueComparisonFormForMultiplePeriods();
        break;
}
$rep6_wdgt->addFlicker($rep_form, CProfile::get('web.report6.filter.state', 1));
if (isset($_REQUEST['report_show'])) {
    $items = $config == 3 ? array(array('itemid' => get_request('itemid'))) : get_request('items');
    if ($isValid && ($config != 3 ? $validItems : true) && ($config == 2 ? $validPeriods : true)) {
        $src = 'chart_bar.php?' . 'config=' . $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, false, 'items') . url_param('hostids') . url_param('groupids') . url_param('palette') . url_param('palettetype');
        $rep_tab->addRow(new CImg($src, 'report'));
    }
}
$outer_table = new CTable();
$outer_table->setAttribute('border', 0);
$outer_table->setAttribute('width', '100%');
$outer_table->setCellPadding(1);
$outer_table->setCellSpacing(1);
$tmp_row = new CRow($rep_tab);
$tmp_row->setAttribute('align', 'center');
$outer_table->addRow($tmp_row);
$rep6_wdgt->addItem($outer_table);
$rep6_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 10
0
order_result($actions, 'clock', ZBX_SORT_DOWN);
$paging = getPagingLine($actions);
//---------
foreach ($actions as $num => $row) {
    if (empty($row['details'])) {
        $details = array();
        $sql = 'SELECT table_name,field_name,oldvalue,newvalue ' . ' FROM auditlog_details ' . ' WHERE auditid=' . $row['auditid'];
        $db_details = DBselect($sql);
        while ($db_detail = DBfetch($db_details)) {
            $details[] = array($db_detail['table_name'] . '.' . $db_detail['field_name'] . ': ' . $db_detail['oldvalue'] . ' => ' . $db_detail['newvalue'], BR());
        }
    } else {
        $details = $row['details'];
    }
    $table->addRow(array(zbx_date2str(S_AUDITLOGS_RECORD_DATE_FORMAT, $row['clock']), $row['alias'], $row['ip'], $row['resourcetype'], $row['action'], $row['resourceid'], $row['resourcename'], new CCol($details, 'wraptext')));
}
// PAGING FOOTER
$table = array($paging, $table, $paging);
//---------
$audit_wdgt->addItem($table);
$audit_wdgt->show();
// NAV BAR
$timeline = array('period' => $effectiveperiod, 'starttime' => date('YmdHis', $starttime), 'usertime' => null);
if (isset($_REQUEST['stime'])) {
    $timeline['usertime'] = date('YmdHis', zbxDateToTime($_REQUEST['stime']) + $timeline['period']);
}
$dom_graph_id = 'events';
$objData = array('id' => 'timeline_1', 'domid' => $dom_graph_id, 'loadSBox' => 0, 'loadImage' => 0, 'loadScroll' => 1, 'dynamic' => 0, 'mainObject' => 1);
zbx_add_post_js('timeControl.addObject("' . $dom_graph_id . '",' . zbx_jsvalue($timeline) . ',' . zbx_jsvalue($objData) . ');');
zbx_add_post_js('timeControl.processObjects();');
include_once 'include/page_footer.php';
Esempio n. 11
0
                    $style = 'unknown';
                    $url = 'templates.php?form=update&templateid=' . $linkedToHost['objectid'];
                    break;
                default:
                    $style = null;
                    $url = 'hosts.php?form=update&hostid=' . $linkedToHost['objectid'] . '&groupid=' . $_REQUEST['groupid'];
            }
            if ($linkedToOutput) {
                $linkedToOutput[] = ', ';
            }
            $linkedToOutput[] = new CLink($linkedToHost['name'], $url, $style);
        }
        $table->addRow(array(new CCheckBox('templates[' . $template['templateid'] . ']', null, null, $template['templateid']), $templatesOutput, $applications, $items, $triggers, $graphs, $screens, $discoveries, $httpTests, $linkedTemplatesOutput ? new CCol($linkedTemplatesOutput, 'wraptext') : '-', $linkedToOutput ? new CCol($linkedToOutput, 'wraptext') : '-'));
    }
    $goBox = new CComboBox('action');
    $goBox->addItem('template.export', _('Export selected'));
    $goOption = new CComboItem('template.massdelete', _('Delete selected'));
    $goOption->setAttribute('confirm', _('Delete selected templates?'));
    $goBox->addItem($goOption);
    $goOption = new CComboItem('template.massdeleteclear', _('Delete selected with linked elements'));
    $goOption->setAttribute('confirm', _('Delete and clear selected templates? (Warning: all linked hosts will be cleared!)'));
    $goBox->addItem($goOption);
    $goButton = new CSubmit('goButton', _('Go') . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "templates";');
    $footer = get_table_header(array($goBox, $goButton));
    $form->addItem(array($paging, $table, $paging, $footer));
    $templateWidget->addItem($form);
}
$templateWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 12
0
    $openState = CProfile::get('web.latest.toggle_other', null, $host['hostid']);
    $toggle = new CDiv(null, 'app-list-toggle icon-plus-9x9');
    if ($openState) {
        $toggle->addClass('icon-minus-9x9');
    }
    $toggle->setAttribute('data-app-id', '0_' . $host['hostid']);
    $toggle->setAttribute('data-open-state', $openState);
    $hostName = null;
    if (!$singleHostSelected) {
        $hostName = new CSpan($host['name'], 'link_menu menu-host' . ($host['status'] == HOST_STATUS_NOT_MONITORED ? ' not-monitored' : ''));
        $hostName->setMenuPopup(CMenuPopupHelper::getHost($host, $hostScripts[$host['hostid']]));
    }
    // add toggle row
    $table->addRow(array($toggle, '', $hostName, new CCol(array(bold('- ' . 'other' . ' -'), ' (' . _n('%1$s Item', '%1$s Items', $dbHost['item_cnt']) . ')'), null, $filter['showDetails'] ? 10 : 5)), 'odd_row');
    // add toggle sub rows
    foreach ($appRows as $row) {
        $row->setAttribute('parent_app_id', '0_' . $host['hostid']);
        $row->addClass('odd_row');
        if (!$openState) {
            $row->addClass('hidden');
        }
        $table->addRow($row);
    }
}
$goBox = new CComboBox('graphtype', GRAPH_TYPE_STACKED, null, array(GRAPH_TYPE_STACKED => _('Display stacked graph'), GRAPH_TYPE_NORMAL => _('Display graph')));
$goBox->setAttribute('id', 'action');
$goButton = new CSubmit('goButton', _('Go') . ' (0)');
$form->addItem(array($table, get_table_header(array($goBox, $goButton))));
$latestWidget->addItem($form);
$latestWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
                default:
                    $style = null;
                    $url = 'hosts.php?form=update&hostid=' . $linked_to_host['hostid'] . '&groupid=' . $_REQUEST['groupid'];
                    break;
            }
            $linked_to_output[] = new CLink($linked_to_host['name'], $url, $style);
            $linked_to_output[] = ', ';
        }
        array_pop($linked_to_output);
        $table->addRow(array(new CCheckBox('templates[' . $template['templateid'] . ']', NULL, NULL, $template['templateid']), $templates_output, $applications, $items, $triggers, $graphs, $screens, $discoveries, empty($linked_templates_output) ? '-' : new CCol($linked_templates_output, 'wraptext'), empty($linked_to_output) ? '-' : new CCol($linked_to_output, 'wraptext')));
    }
    // GO{
    $goBox = new CComboBox('go');
    $goBox->addItem('export', _('Export selected'));
    $goOption = new CComboItem('delete', _('Delete selected'));
    $goOption->setAttribute('confirm', _('Delete selected templates?'));
    $goBox->addItem($goOption);
    $goOption = new CComboItem('delete_and_clear', _('Delete selected with linked elements'));
    $goOption->setAttribute('confirm', _('Delete and clear selected templates? (Warning: all linked hosts will be cleared!)'));
    $goBox->addItem($goOption);
    // goButton name is necessary!!!
    $goButton = new CSubmit('goButton', _('Go') . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "templates";');
    $footer = get_table_header(array($goBox, $goButton));
    // }GO
    $form->addItem(array($paging, $table, $paging, $footer));
    $template_wdgt->addItem($form);
}
$template_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 14
0
        $table->setHeader(array(is_show_all_nodes() ? make_sorting_header(S_NODE, 'hostid') : null, make_sorting_header(S_HOST, 'host'), S_GROUP, make_sorting_header(S_NAME, 'pr_name'), make_sorting_header(S_OS, 'pr_os'), make_sorting_header(S_SERIALNO, 'pr_serialno'), make_sorting_header(S_TAG, 'pr_tag'), make_sorting_header(S_MACADDRESS, 'pr_macaddress')));
    } else {
        $table->setHeader(array(is_show_all_nodes() ? make_sorting_header(S_NODE, 'hostid') : null, make_sorting_header(S_HOST, 'host'), S_GROUP, make_sorting_header(S_DEVICE_OS_SHORT, 'pre_device_os_short'), make_sorting_header(S_DEVICE_HW_ARCH, 'pre_device_hw_arch'), make_sorting_header(S_DEVICE_TYPE, 'pre_device_type'), make_sorting_header(S_DEVICE_STATUS, 'pre_device_status')));
    }
    foreach ($hosts as $host) {
        $host_groups = array();
        foreach ($host['groups'] as $group) {
            $host_groups[] = $group['name'];
        }
        natcasesort($host_groups);
        $host_groups = implode(', ', $host_groups);
        $row = array(get_node_name_by_elid($host['hostid']), new CLink($host['host'], '?hostid=' . $host['hostid'] . url_param('groupid') . '&prof_type=' . $_REQUEST['prof_type']), $host_groups);
        if (0 == $_REQUEST['prof_type']) {
            $row[] = zbx_str2links($host['profile']['name']);
            $row[] = zbx_str2links($host['profile']['os']);
            $row[] = zbx_str2links($host['profile']['serialno']);
            $row[] = zbx_str2links($host['profile']['tag']);
            $row[] = zbx_str2links($host['profile']['macaddress']);
        } else {
            $row[] = zbx_str2links($host['profile_ext']['device_os_short']);
            $row[] = zbx_str2links($host['profile_ext']['device_hw_arch']);
            $row[] = zbx_str2links($host['profile_ext']['device_type']);
            $row[] = zbx_str2links($host['profile_ext']['device_status']);
        }
        $table->addRow($row);
    }
    $table = array($paging, $table, $paging);
    $hostprof_wdgt->addItem($table);
}
$hostprof_wdgt->show();
include_once 'include/page_footer.php';
Esempio n. 15
0
    $trigger_data = CTrigger::get($options);
    if (empty($trigger_data)) {
        unset($_REQUEST['triggerid']);
    } else {
        $trigger_data = reset($trigger_data);
        $host = reset($trigger_data['hosts']);
        $trigger_data['hostid'] = $host['hostid'];
        $trigger_data['host'] = $host['host'];
    }
}
if (isset($_REQUEST['triggerid'])) {
    $rep2_wdgt->addHeader(array(new CLink($trigger_data['host'], '?filter_groupid=' . $_REQUEST['groupid'] . '&filter_hostid=' . $trigger_data['hostid']), ' : ', expand_trigger_description_by_data($trigger_data)), SPACE);
    $table = new CTableInfo(null, 'graph');
    $table->addRow(new CImg('chart4.php?triggerid=' . $_REQUEST['triggerid']));
    $rep2_wdgt->addItem($table);
    $rep2_wdgt->show();
} else {
    if (isset($_REQUEST['hostid'])) {
        $r_form = new CForm();
        $r_form->setMethod('get');
        $cmbConf = new CComboBox('config', $config, 'submit()');
        $cmbConf->addItem(0, S_BY_HOST);
        $cmbConf->addItem(1, S_BY_TRIGGER_TEMPLATE);
        $r_form->addItem($cmbConf);
        $rep2_wdgt->addHeader(S_REPORT_BIG, array(S_MODE . SPACE, $r_form));
        // FILTER
        $filterForm = get_report2_filter($config, $PAGE_GROUPS, $PAGE_HOSTS);
        $rep2_wdgt->addFlicker($filterForm, CProfile::get('web.avail_report.filter.state', 0));
        //-------
        $options = array('output' => array('triggerid', 'description', 'expression', 'value'), 'expandDescription' => true, 'expandData' => true, 'monitored' => true, 'filter' => array());
        if (0 == $config) {
Esempio n. 16
0
    $data['iconList'][$icon['imageid']] = $icon['name'];
}
$inventoryFields = getHostInventories();
foreach ($inventoryFields as $field) {
    $data['inventoryList'][$field['nr']] = $field['title'];
}
if (isset($_REQUEST['form'])) {
    if ($data['form_refresh'] || $_REQUEST['form'] === 'clone') {
        $data['iconmap'] = get_request('iconmap');
    } elseif (isset($_REQUEST['iconmapid'])) {
        $data['iconmap'] = reset($iconMap);
    } else {
        $firstIcon = reset($iconList);
        $data['iconmap'] = array('name' => '', 'default_iconid' => $firstIcon['imageid'], 'mappings' => array());
    }
    $iconMapView = new CView('administration.general.iconmap.edit', $data);
} else {
    $iconMapWidget->addHeader(_('Icon mapping'));
    $data['iconmaps'] = API::IconMap()->get(array('output' => API_OUTPUT_EXTEND, 'editable' => true, 'preservekeys' => true, 'selectMappings' => API_OUTPUT_EXTEND));
    order_result($data['iconmaps'], 'name');
    // nodes
    foreach ($data['iconmaps'] as &$iconMap) {
        order_result($iconMap['mappings'], 'sortorder');
        $iconMap['nodename'] = $data['displayNodes'] ? get_node_name_by_elid($iconMap['iconmapid'], true) : '';
    }
    unset($iconMap);
    $iconMapView = new CView('administration.general.iconmap.list', $data);
}
$iconMapWidget->addItem($iconMapView->render());
$iconMapWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
                    $caption[] = ')';
                }
                $hostTemplates[] = $caption;
                $hostTemplates[] = ', ';
            }
            if ($hostTemplates) {
                array_pop($hostTemplates);
            }
        }
        $table->addRow(array(new CCheckBox('hosts[' . $host['hostid'] . ']', null, null, $host['hostid']), $displayNodes ? get_node_name_by_elid($host['hostid'], true) : null, $description, $applications, $items, $triggers, $graphs, $discoveries, $httpTests, $hostInterface, new CCol($hostTemplates, 'wraptext'), $status, getAvailabilityTable($host)));
    }
    $goBox = new CComboBox('go');
    $goBox->addItem('export', _('Export selected'));
    $goBox->addItem('massupdate', _('Mass update'));
    $goOption = new CComboItem('activate', _('Enable selected'));
    $goOption->setAttribute('confirm', _('Enable selected hosts?'));
    $goBox->addItem($goOption);
    $goOption = new CComboItem('disable', _('Disable selected'));
    $goOption->setAttribute('confirm', _('Disable selected hosts?'));
    $goBox->addItem($goOption);
    $goOption = new CComboItem('delete', _('Delete selected'));
    $goOption->setAttribute('confirm', _('Delete selected hosts?'));
    $goBox->addItem($goOption);
    $goButton = new CSubmit('goButton', _('Go') . ' (0)');
    $goButton->setAttribute('id', 'goButton');
    zbx_add_post_js('chkbxRange.pageGoName = "hosts";');
    $form->addItem(array($paging, $table, $paging, get_table_header(array($goBox, $goButton))));
    $hostsWidget->addItem($form);
}
$hostsWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 18
0
 * Graph in
 */
$graphInScreen = new CScreenBase(array('resourcetype' => SCREEN_RESOURCE_GRAPH, 'mode' => SCREEN_MODE_PREVIEW, 'dataId' => 'graph_in', 'profileIdx' => 'web.httptest', 'profileIdx2' => get_request('httptestid'), 'period' => get_request('period'), 'stime' => get_request('stime')));
$graphInScreen->timeline['starttime'] = date(TIMESTAMP_FORMAT, get_min_itemclock_by_itemid($itemIds));
$src = 'chart3.php?height=150' . '&name=' . $httpTest['name'] . '&http_item_type=' . HTTPSTEP_ITEM_TYPE_IN . '&httptestid=' . $httpTest['httptestid'] . '&graphtype=' . GRAPH_TYPE_STACKED . '&period=' . $graphInScreen->timeline['period'] . '&stime=' . $graphInScreen->timeline['stime'] . '&profileIdx=' . $graphInScreen->profileIdx . '&profileIdx2=' . $graphInScreen->profileIdx2;
$graphInContainer = new CDiv(new CLink(null, $src), 'flickerfreescreen', 'flickerfreescreen_graph_in');
$graphInContainer->setAttribute('style', 'position: relative');
$graphInContainer->setAttribute('data-timestamp', time());
$graphTable->addRow(array(bold(_('Speed')), $graphInContainer));
$timeControlData = array('id' => 'graph_in', 'containerid' => 'flickerfreescreen_graph_in', 'src' => $src, 'objDims' => $graphDims, 'loadSBox' => 1, 'loadImage' => 1, 'periodFixed' => CProfile::get('web.httptest.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD);
zbx_add_post_js('timeControl.addObject("graph_in", ' . zbx_jsvalue($graphInScreen->timeline) . ', ' . zbx_jsvalue($timeControlData) . ');');
$graphInScreen->insertFlickerfreeJs();
/*
 * Graph time
 */
$graphTimeScreen = new CScreenBase(array('resourcetype' => SCREEN_RESOURCE_GRAPH, 'mode' => SCREEN_MODE_PREVIEW, 'dataId' => 'graph_time', 'profileIdx' => 'web.httptest', 'profileIdx2' => get_request('httptestid'), 'period' => get_request('period'), 'stime' => get_request('stime')));
$src = 'chart3.php?height=150' . '&name=' . $httpTest['name'] . '&http_item_type=' . HTTPSTEP_ITEM_TYPE_TIME . '&httptestid=' . $httpTest['httptestid'] . '&graphtype=' . GRAPH_TYPE_STACKED . '&period=' . $graphTimeScreen->timeline['period'] . '&stime=' . $graphTimeScreen->timeline['stime'] . '&profileIdx=' . $graphTimeScreen->profileIdx . '&profileIdx2=' . $graphTimeScreen->profileIdx2;
$graphTimeContainer = new CDiv(new CLink(null, $src), 'flickerfreescreen', 'flickerfreescreen_graph_time');
$graphTimeContainer->setAttribute('style', 'position: relative');
$graphTimeContainer->setAttribute('data-timestamp', time());
$graphTable->addRow(array(bold(_('Response time')), $graphTimeContainer));
$timeControlData = array('id' => 'graph_time', 'containerid' => 'flickerfreescreen_graph_time', 'src' => $src, 'objDims' => $graphDims, 'loadSBox' => 1, 'loadImage' => 1, 'periodFixed' => CProfile::get('web.httptest.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD);
zbx_add_post_js('timeControl.addObject("graph_time", ' . zbx_jsvalue($graphInScreen->timeline) . ', ' . zbx_jsvalue($timeControlData) . ');');
$graphTimeScreen->insertFlickerfreeJs();
// scroll
CScreenBuilder::insertScreenScrollJs(array('timeline' => $graphInScreen->timeline));
CScreenBuilder::insertScreenRefreshTimeJs();
CScreenBuilder::insertProcessObjectsJs();
$graphsWidget->addItem($graphTable);
$graphsWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 19
0
                    $ack = new CLink(S_YES, 'acknow.php?eventid=' . $event['eventid'] . '&backurl=' . $page['file']);
                } else {
                    $ack = new CLink(S_NO, 'acknow.php?eventid=' . $event['eventid'] . '&backurl=' . $page['file'], 'on');
                }
            }
            $description = expand_trigger_description_by_data(zbx_array_merge($trigger, array('clock' => $event['clock'])), ZBX_FLAG_EVENT);
            $tr_desc = new CSpan($description, 'pointer');
            $tr_desc->addAction('onclick', "create_mon_trigger_menu(event, " . " new Array({'triggerid': '" . $trigger['triggerid'] . "', 'lastchange': '" . $event['clock'] . "'})," . zbx_jsvalue($items, true) . ");");
            // Duration
            $tr_event = $event + $trigger;
            if ($next_event = get_next_event($tr_event, $events, $_REQUEST['hide_unknown'])) {
                $event['duration'] = zbx_date2age($tr_event['clock'], $next_event['clock']);
            } else {
                $event['duration'] = zbx_date2age($tr_event['clock']);
            }
            $table->addRow(array(new CLink(zbx_date2str(S_EVENTS_ACTION_TIME_FORMAT, $event['clock']), 'tr_events.php?triggerid=' . $event['objectid'] . '&eventid=' . $event['eventid'], 'action'), is_show_all_nodes() ? get_node_name_by_elid($event['objectid']) : null, $_REQUEST['hostid'] == 0 ? $host['host'] : null, new CSpan($tr_desc, 'link_menu'), new CCol(trigger_value2str($event['value']), get_trigger_value_style($event['value'])), new CCol(get_severity_description($trigger['priority']), get_severity_style($trigger['priority'], $event['value'])), $event['duration'], $config['event_ack_enable'] ? $ack : NULL, $actions));
        }
    }
    $table = array($paging, $table, $paging);
    $jsmenu = new CPUMenu(null, 170);
    $jsmenu->InsertJavaScript();
}
$events_wdgt->addItem($table);
// NAV BAR
$timeline = array('period' => $effectiveperiod, 'starttime' => date('YmdHis', $starttime), 'usertime' => date('YmdHis', $till));
$dom_graph_id = 'scroll_events_id';
$objData = array('id' => 'timeline_1', 'loadSBox' => 0, 'loadImage' => 0, 'loadScroll' => 1, 'dynamic' => 0, 'mainObject' => 1);
zbx_add_post_js('timeControl.addObject("' . $dom_graph_id . '",' . zbx_jsvalue($timeline) . ',' . zbx_jsvalue($objData) . ');');
zbx_add_post_js('timeControl.processObjects();');
$events_wdgt->show();
include_once 'include/page_footer.php';
Esempio n. 20
0
}
$icon = null;
$fs_icon = null;
if (isset($elementid) && $element) {
    if (infavorites('web.favorite.screenids', $elementid, 'screenid')) {
        $icon = new CDiv(SPACE, 'iconminus');
        $icon->setAttribute('title', S_REMOVE_FROM . ' ' . S_FAVOURITES);
        $icon->addAction('onclick', new CScript("javascript: rm4favorites('screenid','" . $elementid . "',0);"));
    } else {
        $icon = new CDiv(SPACE, 'iconplus');
        $icon->setAttribute('title', S_ADD_TO . ' ' . S_FAVOURITES);
        $icon->addAction('onclick', new CScript("javascript: add2favorites('screenid','" . $elementid . "');"));
    }
    $icon->setAttribute('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->setAttribute('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
    $fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
}
$screens_wdgt->addHeader(S_SCREENS_BIG, array($icon, $fs_icon));
$screens_wdgt->addHeader($text, $form);
$screens_wdgt->addItem($element);
$screens_wdgt->show();
$scroll_div = new CDiv();
$scroll_div->setAttribute('id', 'scroll_cntnr');
$scroll_div->setAttribute('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';
$hostinvent_wdgt->addItem(BR());
$table = new CTableInfo(_('No hosts defined.'));
$table->setHeader(array(make_sorting_header($groupFieldTitle === '' ? _('Field') : $groupFieldTitle, 'inventory_field'), make_sorting_header(_('Host count'), 'host_count')));
// to show a report, we will need a host group and a field to aggregate
if ($pageFilter->groupsSelected && $groupFieldTitle !== '') {
    $options = array('output' => array('hostid', 'name'), 'selectInventory' => array($_REQUEST['groupby']), 'withInventory' => true);
    if ($pageFilter->groupid > 0) {
        $options['groupids'] = $pageFilter->groupid;
    }
    $hosts = API::Host()->get($options);
    // aggregating data by chosen field value
    $report = array();
    foreach ($hosts as $host) {
        if ($host['inventory'][$_REQUEST['groupby']] !== '') {
            $lowerValue = zbx_strtolower($host['inventory'][$_REQUEST['groupby']]);
            if (!isset($report[$lowerValue])) {
                $report[$lowerValue] = array('inventory_field' => $host['inventory'][$_REQUEST['groupby']], 'host_count' => 1);
            } else {
                $report[$lowerValue]['host_count'] += 1;
            }
        }
    }
    order_result($report, getPageSortField('host_count'), getPageSortOrder());
    foreach ($report as $rep) {
        $row = array(new CSpan($rep['inventory_field'], 'pre'), new CLink($rep['host_count'], 'hostinventories.php?filter_field=' . $_REQUEST['groupby'] . '&filter_field_value=' . urlencode($rep['inventory_field']) . '&filter_set=1&filter_exact=1' . url_param('groupid')));
        $table->addRow($row);
    }
}
$hostinvent_wdgt->addItem($table);
$hostinvent_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 22
0
    $event_ack->addHeader(S_ACKNOWLEDGES);
    $right_tab->addRow($event_ack);
}
//----------------
// event sms actions
$actions_sms = new CWidget('hat_eventactionmsgs', get_action_msgs_for_event($_REQUEST['eventid']), CProfile::get('web.tr_events.hats.hat_eventactionmsgs.state', 1));
$actions_sms->addHeader(S_MESSAGE_ACTIONS);
$right_tab->addRow($actions_sms);
//----------------
// event cmd actions
$actions_cmd = new CWidget('hat_eventactionmcmds', get_action_cmds_for_event($_REQUEST['eventid']), CProfile::get('web.tr_events.hats.hat_eventactioncmds.state', 1));
$actions_cmd->addHeader(S_COMMAND_ACTIONS);
$right_tab->addRow($actions_cmd);
//----------------
// event history
$events_histry = new CWidget('hat_eventlist', make_small_eventlist($_REQUEST['eventid'], $trigger), CProfile::get('web.tr_events.hats.hat_eventlist.state', 1));
$events_histry->addHeader(S_EVENTS . SPACE . S_LIST . SPACE . '[' . S_PREVIOUS_EVENTS . ' 20]');
$right_tab->addRow($events_histry);
//----------------
$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));
$tr_event_wdgt->addItem($outer_table);
$tr_event_wdgt->show();
include_once 'include/page_footer.php';
$data = array();
$data['form_refresh'] = get_request('form_refresh', 0);
// form has been submitted
if ($data['form_refresh']) {
    $data['ok_period'] = get_request('ok_period');
    $data['blink_period'] = get_request('blink_period');
    $data['problem_unack_color'] = get_request('problem_unack_color');
    $data['problem_ack_color'] = get_request('problem_ack_color');
    $data['ok_unack_color'] = get_request('ok_unack_color');
    $data['ok_ack_color'] = get_request('ok_ack_color');
    $data['problem_unack_style'] = get_request('problem_unack_style');
    $data['problem_ack_style'] = get_request('problem_ack_style');
    $data['ok_unack_style'] = get_request('ok_unack_style');
    $data['ok_ack_style'] = get_request('ok_ack_style');
} else {
    $config = select_config(false);
    $data['ok_period'] = $config['ok_period'];
    $data['blink_period'] = $config['blink_period'];
    $data['problem_unack_color'] = $config['problem_unack_color'];
    $data['problem_ack_color'] = $config['problem_ack_color'];
    $data['ok_unack_color'] = $config['ok_unack_color'];
    $data['ok_ack_color'] = $config['ok_ack_color'];
    $data['problem_unack_style'] = $config['problem_unack_style'];
    $data['problem_ack_style'] = $config['problem_ack_style'];
    $data['ok_unack_style'] = $config['ok_unack_style'];
    $data['ok_ack_style'] = $config['ok_ack_style'];
}
$triggerDisplayingForm = new CView('administration.general.triggerDisplayOptions.edit', $data);
$cnf_wdgt->addItem($triggerDisplayingForm->render());
$cnf_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
$pMerge = array('info' => 'Info', 'notice' => 'Info', 'warn' => 'Warning', 'warning' => 'Warning', 'err' => 'Error', 'error' => 'Error', 'crit' => 'Critical', 'critical' => 'Critical');
$cMerge = array('Info' => 'low', 'Warning' => 'average', 'Error' => 'high', 'Critical' => 'disaster');
while ($row = mysql_fetch_assoc($results)) {
    $status = isset($pMerge[$row['priority']]) ? $pMerge[$row['priority']] : $row['priority'];
    $class = isset($cMerge[$status]) ? $cMerge[$status] : $status;
    $table->addRow(array($row['datetime'], $row['host'], $row['facility'], $row['tag'], new CCol($status, $class), isset($row['eventID']) ? $row['eventID'] : "", $row['msg']));
}
$paging = pager($total, $limit, $pager_page);
$table = array($paging, $table, $paging);
$eventsWidget->addItem($table);
$timeline = array('period' => $effectiveperiod, 'usertime' => date(TIMESTAMP_FORMAT, $till));
$objData = array('id' => 'timeline_1', 'loadSBox' => 0, 'loadImage' => 0, 'loadScroll' => 1, 'dynamic' => 0, 'mainObject' => 1, 'periodFixed' => CProfile::get('web.events.timelinefixed', 1), 'sliderMaximumTimePeriod' => ZBX_MAX_PERIOD);
zbx_add_post_js('jqBlink.blink();');
zbx_add_post_js('timeControl.addObject("scroll_events_id", ' . zbx_jsvalue($timeline) . ', ' . zbx_jsvalue($objData) . ');');
zbx_add_post_js('timeControl.processObjects();');
$eventsWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
function pager($items, $itemsPerPage, $currentPage, $urlParams = array(), $removeUrlParams = array())
{
    $startPage = 1;
    $pagesCount = floor($items / $itemsPerPage) + 1;
    $endPage = $pagesCount;
    $url = new Curl();
    $pageLine = array();
    if (is_array($urlParams) && $urlParams) {
        foreach ($urlParams as $key => $value) {
            $url->setArgument($key, $value);
        }
    }
    $removeUrlParams = array_merge($removeUrlParams, array('go', 'form', 'delete', 'cancel'));
    foreach ($removeUrlParams as $param) {
Esempio n. 25
0
    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();
createServiceTree($services, $treeServ);
//return into $treeServ parametr
//permission issue
$treeServ = del_empty_nodes($treeServ);
//----
if (isset($_REQUEST['msg']) && !empty($_REQUEST['msg'])) {
    show_messages(true, $_REQUEST['msg']);
}
//show_table_header(S_IT_SERVICES_BIG);
$tree = new CTree('service_conf_tree', $treeServ, array('caption' => bold(S_SERVICE), 'algorithm' => bold(S_STATUS_CALCULATION), 'description' => bold(S_TRIGGER)));
if ($tree) {
    $serv_wdgt = new CWidget();
    $serv_wdgt->addHeader(S_IT_SERVICES_BIG, SPACE);
    $serv_wdgt->addItem($tree->getHTML());
    $serv_wdgt->show();
} else {
    error(S_CANT_FORMAT_TREE);
}
$tr_ov_menu[] = array('test1', null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader')));
$tr_ov_menu[] = array('test2', null, null, array('outer' => array('pum_oheader'), 'inner' => array('pum_iheader')));
$jsmenu = new CPUMenu($tr_ov_menu, 170);
$jsmenu->InsertJavaScript();
include_once "include/page_footer.php";
Esempio n. 26
0
}
$imageWidget = new CWidget();
$imageWidget->addPageHeader(_('CONFIGURATION OF IMAGES'), $form);
$data = array('form' => get_request('form'), 'displayNodes' => is_array(get_current_nodeid()), 'widget' => &$imageWidget);
if (!empty($data['form'])) {
    if (isset($_REQUEST['imageid'])) {
        $data['imageid'] = $_REQUEST['imageid'];
        $data['imagename'] = $dbImage['name'];
        $data['imagetype'] = $dbImage['imagetype'];
    } else {
        $data['imageid'] = null;
        $data['imagename'] = get_request('name', '');
        $data['imagetype'] = get_request('imagetype', 1);
    }
    $imageForm = new CView('administration.general.image.edit', $data);
} else {
    $data['imagetype'] = get_request('imagetype', IMAGE_TYPE_ICON);
    $data['images'] = API::Image()->get(array('filter' => array('imagetype' => $data['imagetype']), 'output' => array('imageid', 'imagetype', 'name')));
    order_result($data['images'], 'name');
    // nodes
    if ($data['displayNodes']) {
        foreach ($data['images'] as &$image) {
            $image['nodename'] = get_node_name_by_elid($image['imageid'], true) . NAME_DELIMITER;
        }
        unset($image);
    }
    $imageForm = new CView('administration.general.image.list', $data);
}
$imageWidget->addItem($imageForm->render());
$imageWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 27
0
<?php

/*
** Zabbix
** Copyright (C) 2001-2014 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** 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.
**/
require_once dirname(__FILE__) . '/include/config.inc.php';
require_once dirname(__FILE__) . '/include/blocks.inc.php';
$page['title'] = _('Status of Zabbix');
$page['file'] = 'report1.php';
$page['hist_arg'] = array();
require_once dirname(__FILE__) . '/include/page_header.php';
$reportWidget = new CWidget();
$reportWidget->addPageHeader(_('STATUS OF ZABBIX'));
$reportWidget->addItem(make_status_of_zbx());
$reportWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
$rightColumn[] = $web_mon;
// discovery info
$drules = DBfetch(DBselect('SELECT COUNT(d.druleid) AS cnt FROM drules d WHERE ' . DBin_node('d.druleid') . ' AND d.status=' . DRULE_STATUS_ACTIVE));
if ($drules['cnt'] > 0 && check_right_on_discovery(PERM_READ_ONLY)) {
    $refresh_tab[] = array('id' => 'hat_dscvry', 'frequency' => CProfile::get('web.dashboard.rf_rate.hat_dscvry', 60));
    $refresh_menu = get_icon('menu', array('menu' => 'hat_dscvry'));
    $dcvr_mon = new CUIWidget('hat_dscvry', new CSpan(_('Loading...'), 'textcolorstyles'), CProfile::get('web.dashboard.hats.hat_dscvry.state', 1));
    $dcvr_mon->setHeader(_('Discovery status'), array($refresh_menu));
    $dcvr_mon->setFooter(new CDiv(SPACE, 'textwhite', 'hat_dscvry_footer'));
    $rightColumn[] = $dcvr_mon;
}
add_doll_objects($refresh_tab);
$dashboardTable = new CTable();
$dashboardTable->addRow(array(new CDiv($leftColumn, 'column'), new CDiv($rightColumn, 'column'), new CDiv(null, 'column')), 'top');
$dashboardWidget->addItem($dashboardTable);
$dashboardWidget->show();
// activating blinking
zbx_add_post_js('jqBlink.blink();');
?>
<script type="text/javascript">
	//<!--<![CDATA[
	function addPopupValues(list) {
		if (!isset('object', list)) {
			throw("Error hash attribute 'list' doesn't contain 'object' index");
			return false;
		}
		if ('undefined' == typeof(Ajax)) {
			throw('Prototype.js lib is required!');
			return false;
		}
		var favorites = {'graphid': 1, 'itemid': 1, 'screenid': 1, 'slideshowid': 1, 'sysmapid': 1};
Esempio n. 29
0
    order_result($httpTests, getPageSortField('name'), getPageSortOrder());
    // fetch the latest results of the web scenario
    $lastHttpTestData = Manager::HttpTest()->getLastData(array_keys($httpTests));
    foreach ($httpTests as $httpTest) {
        $lastData = isset($lastHttpTestData[$httpTest['httptestid']]) ? $lastHttpTestData[$httpTest['httptestid']] : null;
        // test has history data
        if ($lastData) {
            $lastcheck = zbx_date2str(_('d M Y H:i:s'), $lastData['lastcheck']);
            if ($lastData['lastfailedstep'] != 0) {
                $step_data = get_httpstep_by_no($httpTest['httptestid'], $lastData['lastfailedstep']);
                $status['msg'] = _s('Step "%1$s" [%2$s of %3$s] failed: %4$s', $step_data['name'], $lastData['lastfailedstep'], $httpTest['steps'], $lastData['error']);
                $status['style'] = 'disabled';
            } else {
                $status['msg'] = _('OK');
                $status['style'] = 'enabled';
            }
        } else {
            $lastcheck = _('Never');
            $status['msg'] = _('Unknown');
            $status['style'] = 'unknown';
        }
        $cpsan = new CSpan($httpTest['hostname'], $httpTest['host']['status'] == HOST_STATUS_NOT_MONITORED ? 'not-monitored' : '');
        $table->addRow(new CRow(array($displayNodes ? get_node_name_by_elid($httpTest['httptestid'], true) : null, $_REQUEST['hostid'] > 0 ? null : $cpsan, new CLink($httpTest['name'], 'httpdetails.php?httptestid=' . $httpTest['httptestid']), $httpTest['steps'], $lastcheck, new CSpan($status['msg'], $status['style']))));
    }
} else {
    $tmp = array();
    getPagingLine($tmp);
}
$httpmon_wdgt->addItem(array($paging, $table, $paging));
$httpmon_wdgt->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
Esempio n. 30
0
                                    if ($result && $USER_DETAILS['type'] > USER_TYPE_ZABBIX_USER) {
                                        $data = array('users' => $user, 'medias' => $user['user_medias']);
                                        $result = CUser::updateMedia($data);
                                    }
                                    $result = DBend($result);
                                    if (!$result) {
                                        error(CUser::resetErrors());
                                    }
                                    if ($result) {
                                        add_audit(AUDIT_ACTION_UPDATE, AUDIT_RESOURCE_USER, 'User alias [' . $USER_DETAILS['alias'] . '] Name [' . $USER_DETAILS['name'] . ']' . ' Surname [' . $USER_DETAILS['surname'] . '] profile id [' . $USER_DETAILS['userid'] . ']');
                                        ob_end_clean();
                                        redirect($USER_DETAILS['last_page']['url']);
                                    } else {
                                        show_messages($result, S_USER_UPDATED, S_CANNOT_UPDATE_USER);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
ob_end_flush();
$profile_wdgt = new CWidget();
$profile_wdgt->addPageHeader(S_USER_PROFILE_BIG . ' : ' . $USER_DETAILS['name'] . ' ' . $USER_DETAILS['surname']);
$profileForm = getUserForm($USER_DETAILS['userid'], 1);
$profile_wdgt->addItem($profileForm);
$profile_wdgt->show();
include_once 'include/page_footer.php';