当前位置: 首页>>代码示例>>PHP>>正文


PHP get_accessible_hosts_by_user函数代码示例

本文整理汇总了PHP中get_accessible_hosts_by_user函数的典型用法代码示例。如果您正苦于以下问题:PHP get_accessible_hosts_by_user函数的具体用法?PHP get_accessible_hosts_by_user怎么用?PHP get_accessible_hosts_by_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_accessible_hosts_by_user函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bodyToString

 public function bodyToString()
 {
     global $USER_DETAILS;
     $this->cleanItems();
     $total = 0;
     $accessible_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid(true));
     $cond_from = '';
     if (remove_nodes_from_id($this->groupid) > 0) {
         $cond_from = ', hosts_groups hg ';
         $cond_where = 'AND hg.hostid=h.hostid AND hg.groupid=' . $this->groupid;
     } else {
         $cond_where = ' AND ' . DBin_node('h.hostid', $this->nodeid);
     }
     $db_host_cnt = DBselect('SELECT COUNT(DISTINCT h.hostid) as cnt ' . ' FROM hosts h' . $cond_from . ' WHERE h.available=' . HOST_AVAILABLE_TRUE . ' AND h.status IN (' . HOST_STATUS_MONITORED . ',' . HOST_STATUS_NOT_MONITORED . ') ' . ' AND ' . DBcondition('h.hostid', $accessible_hosts) . $cond_where);
     $host_cnt = DBfetch($db_host_cnt);
     $avail = $host_cnt['cnt'];
     $total += $host_cnt['cnt'];
     $db_host_cnt = DBselect('SELECT COUNT(DISTINCT h.hostid) as cnt ' . ' FROM hosts h' . $cond_from . ' WHERE h.available=' . HOST_AVAILABLE_FALSE . ' AND h.status IN (' . HOST_STATUS_MONITORED . ',' . HOST_STATUS_NOT_MONITORED . ') ' . ' AND ' . DBcondition('h.hostid', $accessible_hosts) . $cond_where);
     $host_cnt = DBfetch($db_host_cnt);
     $notav = $host_cnt['cnt'];
     $total += $host_cnt['cnt'];
     $db_host_cnt = DBselect('SELECT COUNT(DISTINCT h.hostid) as cnt ' . ' FROM hosts h' . $cond_from . ' WHERE h.available=' . HOST_AVAILABLE_UNKNOWN . ' AND h.status IN (' . HOST_STATUS_MONITORED . ',' . HOST_STATUS_NOT_MONITORED . ') ' . ' AND ' . DBcondition('h.hostid', $accessible_hosts) . $cond_where);
     $host_cnt = DBfetch($db_host_cnt);
     $uncn = $host_cnt['cnt'];
     $total += $host_cnt['cnt'];
     $node = get_node_by_nodeid($this->nodeid);
     $header_str = S_HOSTS_INFO . SPACE;
     $header_str .= S_FOR_GROUP_SMALL . SPACE . '"';
     if ($node > 0) {
         $header_str .= '(' . $node['name'] . ')' . SPACE;
     }
     if (remove_nodes_from_id($this->groupid) > 0) {
         $group = get_hostgroup_by_groupid($this->groupid);
         $header_str .= $group['name'] . '"';
     } else {
         $header_str .= S_ALL_S . '"';
     }
     $header = new CCol($header_str, "header");
     if ($this->style == STYLE_HORISONTAL) {
         $header->SetColspan(4);
     }
     $this->addRow($header);
     $avail = new CCol($avail . '  ' . S_AVAILABLE, 'avail');
     $notav = new CCol($notav . '  ' . S_NOT_AVAILABLE, 'notav');
     $uncn = new CCol($uncn . '  ' . S_UNKNOWN, 'uncn');
     $total = new CCol($total . '  ' . S_TOTAL, 'total');
     if ($this->style == STYLE_HORISONTAL) {
         $this->addRow(array($avail, $notav, $uncn, $total));
     } else {
         $this->addRow($avail);
         $this->addRow($notav);
         $this->addRow($uncn);
         $this->addRow($total);
     }
     return parent::bodyToString();
 }
开发者ID:rennhak,项目名称:zabbix,代码行数:56,代码来源:class.chostsinfo.php

示例2: CZabbixXMLImport

 function CZabbixXMLImport()
 {
     global $USER_DETAILS;
     $this->main_node = null;
     $this->sub_node = null;
     $this->data = null;
     $this->host = array('exist' => 0, 'missed' => 0);
     $this->template = array('exist' => 0, 'missed' => 0);
     $this->item = array('exist' => 0, 'missed' => 0);
     $this->trigger = array('exist' => 0, 'missed' => 0);
     $this->graph = array('exist' => 0, 'missed' => 0);
     $this->available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_WRITE);
     $this->available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_WRITE);
     $this->available_nodes = get_accessible_nodes_by_user($USER_DETAILS, PERM_READ_WRITE, PERM_RES_IDS_ARRAY);
 }
开发者ID:phedders,项目名称:zabbix,代码行数:15,代码来源:import.inc.php

示例3: sysmap_accessible

function sysmap_accessible($sysmapid, $perm)
{
    global $USER_DETAILS;
    $result = false;
    $sql = 'SELECT * ' . ' FROM sysmaps_elements ' . ' WHERE sysmapid=' . $sysmapid . ' AND ' . DBin_node('sysmapid', get_current_nodeid(null, $perm));
    if ($db_result = DBselect($sql)) {
        $result = true;
        $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, $perm, PERM_RES_IDS_ARRAY, get_current_nodeid(true));
        //SDI($available_hosts);
        while (($se_data = DBfetch($db_result)) && $result) {
            switch ($se_data['elementtype']) {
                case SYSMAP_ELEMENT_TYPE_HOST:
                    if (!isset($available_hosts[$se_data['elementid']])) {
                        $result = false;
                    }
                    break;
                case SYSMAP_ELEMENT_TYPE_MAP:
                    $result = sysmap_accessible($se_data['elementid'], $perm);
                    break;
                case SYSMAP_ELEMENT_TYPE_TRIGGER:
                    $available_triggers = get_accessible_triggers($perm, array(), PERM_RES_IDS_ARRAY);
                    if (!isset($available_triggers[$se_data['elementid']])) {
                        $result = false;
                    }
                    break;
                case SYSMAP_ELEMENT_TYPE_HOST_GROUP:
                    $available_groups = get_accessible_groups_by_user($USER_DETAILS, $perm);
                    if (!isset($available_groups[$se_data['elementid']])) {
                        $result = false;
                    }
                    break;
            }
        }
        //SDI($se_data['elementid']);
    } else {
        if (DBselect('SELECT sysmapid FROM sysmaps WHERE sysmapid=' . $sysmapid . ' AND ' . DBin_node('sysmapid', get_current_nodeid($perm)))) {
            $result = true;
        }
    }
    return $result;
}
开发者ID:rennhak,项目名称:zabbix,代码行数:41,代码来源:maps.inc.php

示例4: get_accessible_maintenance_by_user

function get_accessible_maintenance_by_user($perm, $perm_res = null, $nodeid = null, $hostid = null, $cache = 1)
{
    global $USER_DETAILS;
    static $available_maintenances;
    $result = array();
    if (is_null($perm_res)) {
        $perm_res = PERM_RES_IDS_ARRAY;
    }
    $nodeid_str = is_array($nodeid) ? implode('', $nodeid) : strval($nodeid);
    $hostid_str = is_array($hostid) ? implode('', $hostid) : strval($hostid);
    if ($cache && isset($available_maintenances[$perm][$perm_res][$nodeid_str][$hostid_str])) {
        return $available_maintenances[$perm][$perm_res][$nodeid_str][$hostid_str];
    }
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, $perm, PERM_RES_IDS_ARRAY, $nodeid);
    $denied_maintenances = array();
    $available_maintenances = array();
    $sql = 'SELECT DISTINCT m.maintenanceid ' . ' FROM maintenances m, maintenances_hosts mh, maintenances_groups mg, hosts_groups hg ' . ' WHERE ' . DBcondition('hg.hostid', $available_hosts, true) . (!empty($hostid) ? ' AND hg.hostid=' . $hostid : '') . ' AND (' . '(mh.hostid=hg.hostid AND m.maintenanceid=mh.maintenanceid)' . ' OR (mg.groupid=hg.groupid AND m.maintenanceid=mg.maintenanceid))';
    //SDI($sql);
    $db_maintenances = DBselect($sql);
    while ($maintenance = DBfetch($db_maintenances)) {
        $denied_maintenances[] = $maintenance['maintenanceid'];
    }
    $sql = 'SELECT m.maintenanceid ' . ' FROM maintenances m ' . ' WHERE ' . DBin_node('m.maintenanceid') . ' AND ' . DBcondition('m.maintenanceid', $denied_maintenances, true);
    //SDI($sql);
    $db_maintenances = DBselect($sql);
    while ($maintenance = DBfetch($db_maintenances)) {
        $result[$maintenance['maintenanceid']] = $maintenance['maintenanceid'];
    }
    if (PERM_RES_STRING_LINE == $perm_res) {
        if (count($result) == 0) {
            $result = '-1';
        } else {
            $result = implode(',', $result);
        }
    }
    $available_maintenances[$perm][$perm_res][$nodeid_str][$hostid_str] = $result;
    return $result;
}
开发者ID:rennhak,项目名称:zabbix,代码行数:38,代码来源:maintenances.inc.php

示例5: foreach

foreach ($options as $option) {
    $params[$option] = 1;
}
$PAGE_GROUPS = get_viewed_groups(PERM_READ_ONLY, $params);
$PAGE_HOSTS = get_viewed_hosts(PERM_READ_ONLY, $PAGE_GROUPS['selected'], $params);
validate_group_with_host($PAGE_GROUPS, $PAGE_HOSTS);
// SDI($_REQUEST['groupid'].' : '.$_REQUEST['hostid']);
$rep2_wdgt = new CWidget();
// HEADER
if (0 == $config) {
    $available_groups = $PAGE_GROUPS['groupids'];
    $available_hosts = $PAGE_HOSTS['hostids'];
} else {
    $available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_ONLY);
    if ($PAGE_HOSTS['selected'] != 0) {
        $PAGE_HOSTS['hostids'] = $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY);
    } else {
        $available_hosts = $PAGE_HOSTS['hostids'];
    }
}
$rep2_wdgt->addPageHeader(S_AVAILABILITY_REPORT_BIG);
//	show_report2_header($config, $PAGE_GROUPS, $PAGE_HOSTS);
if (isset($_REQUEST['triggerid'])) {
    $options = array('triggerids' => $_REQUEST['triggerid'], 'output' => API_OUTPUT_EXTEND, 'select_hosts' => API_OUTPUT_EXTEND, 'nodeids' => get_current_nodeid(true));
    $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'];
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:report2.php

示例6: array

 $table->setHeader(array(S_TEMPLATES, S_HOSTS));
 $sql_from = '';
 $sql_where = '';
 if ($_REQUEST['groupid'] > 0) {
     $sql_from .= ',hosts_groups hg ';
     $sql_where .= ' AND hg.groupid=' . $_REQUEST['groupid'] . ' AND hg.hostid=h.hostid ';
 }
 $templates = array();
 $templateids = array();
 $sql = 'SELECT h.hostid, h.host ' . ' FROM hosts h ' . $sql_from . ' WHERE ' . DBcondition('h.hostid', $available_hosts) . $sql_where . ' ORDER BY h.host';
 $result = DBSelect($sql);
 while ($template = DBfetch($result)) {
     $templateids[$template['hostid']] = $template['hostid'];
     $templates[$template['hostid']] = $template;
 }
 $allowed_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY);
 $sql = 'SELECT h.host, h.hostid, h.status, ht.templateid ' . ' FROM hosts h, hosts_templates ht ' . ' WHERE ht.hostid=h.hostid ' . ' AND ' . DBcondition('h.hostid', $allowed_hosts) . ' AND ' . DBcondition('ht.templateid', $templateids) . ' ORDER BY host';
 $result = DBSelect($sql);
 while ($host = DBfetch($result)) {
     if (!isset($templates[$host['templateid']]['hosts'])) {
         $templates[$host['templateid']]['hosts'] = array();
     }
     $templates[$host['templateid']]['hosts'][] = $host;
 }
 foreach ($templates as $templateid => $template) {
     $host_list = array();
     if (isset($template['hosts'])) {
         foreach ($template['hosts'] as $host) {
             switch ($host['status']) {
                 case HOST_STATUS_NOT_MONITORED:
                     $style = 'on';
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:hosts.php

示例7: bar_report_form3

function bar_report_form3()
{
    global $USER_DETAILS;
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY);
    $config = get_request('config', 1);
    $title = get_request('title', S_REPORT . ' 3');
    $xlabel = get_request('xlabel', '');
    $ylabel = get_request('ylabel', '');
    $sorttype = get_request('sorttype', 0);
    $scaletype = get_request('scaletype', TIMEPERIOD_TYPE_WEEKLY);
    $avgperiod = get_request('avgperiod', TIMEPERIOD_TYPE_DAILY);
    $report_timesince = get_request('report_timesince', date('YmdHis', time() - 86400));
    $report_timetill = get_request('report_timetill', date('YmdHis'));
    $captions = get_request('captions', array());
    $items = get_request('items', array());
    $hostids = get_request('hostids', array());
    $hostids = zbx_toHash($hostids);
    $showlegend = get_request('showlegend', 0);
    $palette = get_request('palette', 0);
    $palettetype = get_request('palettetype', 0);
    $reportForm = new CFormTable(null, null, 'get');
    //,'events.php?report_set=1','POST',null,'sform');
    $reportForm->setAttribute('name', 'zbx_report');
    $reportForm->setAttribute('id', 'zbx_report');
    //	$reportForm->setMethod('post');
    if (isset($_REQUEST['report_show']) && !empty($items)) {
        $reportForm->addVar('report_show', 'show');
    }
    $reportForm->addVar('config', $config);
    $reportForm->addVar('report_timesince', date('YmdHis', $report_timesince));
    $reportForm->addVar('report_timetill', date('YmdHis', $report_timetill));
    //	$reportForm->addVar('items',$items); 				//params are set later!!
    //	$reportForm->addVar('periods',$periods);
    $reportForm->addRow(S_TITLE, new CTextBox('title', $title, 40));
    $reportForm->addRow(S_X . SPACE . S_LABEL, new CTextBox('xlabel', $xlabel, 40));
    $reportForm->addRow(S_Y . SPACE . S_LABEL, new CTextBox('ylabel', $ylabel, 40));
    $reportForm->addRow(S_LEGEND, new CCheckBox('showlegend', $showlegend, null, 1));
    $reportForm->addVar('sortorder', 0);
    // GROUPS
    $groupids = get_request('groupids', array());
    $group_tb = new CTweenBox($reportForm, 'groupids', $groupids, 10);
    $options = array('real_hosts' => 1, 'output' => 'extend');
    $db_groups = CHostGroup::get($options);
    order_result($db_groups, 'name');
    foreach ($db_groups as $gnum => $group) {
        $groupids[$group['groupid']] = $group['groupid'];
        $group_tb->addItem($group['groupid'], $group['name']);
    }
    $reportForm->addRow(S_GROUPS, $group_tb->Get(S_SELECTED_GROUPS, S_OTHER . SPACE . S_GROUPS));
    // ----------
    // HOSTS
    //	validate_group(PERM_READ_ONLY,array('real_hosts'),'web.last.conf.groupid');
    $groupid = get_request('groupid', 0);
    $cmbGroups = new CComboBox('groupid', $groupid, 'submit()');
    $cmbGroups->addItem(0, S_ALL_S);
    foreach ($db_groups as $gnum => $group) {
        $cmbGroups->addItem($group['groupid'], $group['name']);
    }
    $td_groups = new CCol(array(S_GROUP, SPACE, $cmbGroups));
    $td_groups->setAttribute('style', 'text-align: right;');
    $host_tb = new CTweenBox($reportForm, 'hostids', $hostids, 10);
    $options = array('real_hosts' => 1, 'output' => array('hostid', 'host'));
    if ($groupid > 0) {
        $options['groupids'] = $groupid;
    }
    $db_hosts = CHost::get($options);
    $db_hosts = zbx_toHash($db_hosts, 'hostid');
    order_result($db_hosts, 'host');
    foreach ($db_hosts as $hnum => $host) {
        $host_tb->addItem($host['hostid'], $host['host']);
    }
    $options = array('real_hosts' => 1, 'output' => array('hostid', 'host'), 'hostids' => $hostids);
    $db_hosts2 = CHost::get($options);
    order_result($db_hosts2, 'host');
    foreach ($db_hosts2 as $hnum => $host) {
        if (!isset($db_hosts[$host['hostid']])) {
            $host_tb->addItem($host['hostid'], $host['host']);
        }
    }
    $reportForm->addRow(S_HOSTS, $host_tb->Get(S_SELECTED_HOSTS, array(S_OTHER . SPACE . S_HOSTS . SPACE . '|' . SPACE . S_GROUP . SPACE, $cmbGroups)));
    // ----------
    //*/
    // PERIOD
    $clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer');
    $clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_since'].clndr.clndrshow(pos.top,pos.left);");
    $reporttimetab = new CTable(null, 'calendar');
    $reporttimetab->setAttribute('width', '10%');
    $reporttimetab->setCellPadding(0);
    $reporttimetab->setCellSpacing(0);
    $reporttimetab->addRow(array(S_FROM, new CNumericBox('report_since_day', $report_timesince > 0 ? date('d', $report_timesince) : '', 2), '/', new CNumericBox('report_since_month', $report_timesince > 0 ? date('m', $report_timesince) : '', 2), '/', new CNumericBox('report_since_year', $report_timesince > 0 ? date('Y', $report_timesince) : '', 4), SPACE, new CNumericBox('report_since_hour', $report_timesince > 0 ? date('H', $report_timesince) : '', 2), ':', new CNumericBox('report_since_minute', $report_timesince > 0 ? date('i', $report_timesince) : '', 2), $clndr_icon));
    zbx_add_post_js('create_calendar(null,' . '["report_since_day","report_since_month","report_since_year","report_since_hour","report_since_minute"],' . '"avail_report_since",' . '"report_timesince");');
    $clndr_icon->addAction('onclick', 'javascript: ' . 'var pos = getPosition(this); ' . 'pos.top+=10; ' . 'pos.left+=16; ' . "CLNDR['avail_report_till'].clndr.clndrshow(pos.top,pos.left);");
    $reporttimetab->addRow(array(S_TILL, new CNumericBox('report_till_day', $report_timetill > 0 ? date('d', $report_timetill) : '', 2), '/', new CNumericBox('report_till_month', $report_timetill > 0 ? date('m', $report_timetill) : '', 2), '/', new CNumericBox('report_till_year', $report_timetill > 0 ? date('Y', $report_timetill) : '', 4), SPACE, new CNumericBox('report_till_hour', $report_timetill > 0 ? date('H', $report_timetill) : '', 2), ':', new CNumericBox('report_till_minute', $report_timetill > 0 ? date('i', $report_timetill) : '', 2), $clndr_icon));
    zbx_add_post_js('create_calendar(null,' . '["report_till_day","report_till_month","report_till_year","report_till_hour","report_till_minute"],' . '"avail_report_till",' . '"report_timetill");');
    zbx_add_post_js('addListener($("filter_icon"),' . '"click",' . 'CLNDR[\'avail_report_since\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_since\'].clndr));' . 'addListener($("filter_icon"),' . '"click",' . 'CLNDR[\'avail_report_till\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'avail_report_till\'].clndr));');
    $reportForm->addRow(S_PERIOD, $reporttimetab);
    //-----------
    $scale = new CComboBox('scaletype', $scaletype);
    $scale->addItem(TIMEPERIOD_TYPE_HOURLY, S_HOURLY);
    $scale->addItem(TIMEPERIOD_TYPE_DAILY, S_DAILY);
//.........这里部分代码省略.........
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:reports.inc.php

示例8: get_accessible_graphs

function get_accessible_graphs($perm, $hostids, $perm_res = null, $nodeid = null, $cache = 1)
{
    global $USER_DETAILS;
    static $available_graphs;
    if (is_null($perm_res)) {
        $perm_res = PERM_RES_IDS_ARRAY;
    }
    $nodeid_str = is_array($nodeid) ? implode('', $nodeid) : strval($nodeid);
    $hostid_str = implode('', $hostids);
    $cache_hash = md5($perm . $perm_res . $nodeid_str . $hostid_str);
    if ($cache && isset($available_graphs[$cache_hash])) {
        return $available_graphs[$cache_hash];
    }
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, $perm, PERM_RES_IDS_ARRAY, $nodeid);
    $denied_graphs = array();
    $result = array();
    $sql_where = '';
    if (!empty($hostids)) {
        $sql_where .= ' AND ' . DBcondition('i.hostid', $hostids);
    }
    $sql = 'SELECT DISTINCT g.graphid ' . ' FROM graphs g, graphs_items gi, items i ' . ' WHERE g.graphid=gi.graphid ' . ' AND i.itemid=gi.itemid ' . $sql_where . ' AND ' . DBcondition('i.hostid', $available_hosts, true);
    $db_graphs = DBselect($sql);
    while ($graph = DBfetch($db_graphs)) {
        $denied_graphs[] = $graph['graphid'];
    }
    $sql = 'SELECT DISTINCT g.graphid ' . ' FROM graphs g, graphs_items gi, items i ' . ' WHERE g.graphid=gi.graphid ' . ' AND i.itemid=gi.itemid ' . $sql_where . (!empty($denied_graphs) ? ' AND ' . DBcondition('g.graphid', $denied_graphs, true) : '');
    $db_graphs = DBselect($sql);
    while ($graph = DBfetch($db_graphs)) {
        $result[$graph['graphid']] = $graph['graphid'];
    }
    if (PERM_RES_STRING_LINE == $perm_res) {
        if (count($result) == 0) {
            $result = '-1';
        } else {
            $result = implode(',', $result);
        }
    }
    $available_graphs[$cache_hash] = $result;
    return $result;
}
开发者ID:phedders,项目名称:zabbix,代码行数:40,代码来源:graphs.inc.php

示例9: array

**
** 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., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once "include/config.inc.php";
require_once "include/items.inc.php";
$page["title"] = "S_QUEUE_BIG";
$page["file"] = "queue.php";
$page['hist_arg'] = array('show');
define('ZBX_PAGE_DO_REFRESH', 1);
include_once "include/page_header.php";
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array("show" => array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1,2"), NULL));
check_fields($fields);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
?>

<?php 
$_REQUEST["show"] = get_request("show", 0);
$form = new CForm();
$form->SetMethod('get');
$cmbMode = new CComboBox("show", $_REQUEST["show"], "submit();");
$cmbMode->AddItem(0, S_OVERVIEW);
$cmbMode->AddItem(1, S_OVERVIEW_BY_PROXY);
$cmbMode->AddItem(2, S_DETAILS);
$form->AddItem($cmbMode);
show_table_header(S_QUEUE_OF_ITEMS_TO_BE_UPDATED_BIG, $form);
?>

<?php 
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:queue.php

示例10: check_right_on_trigger_by_expression

function check_right_on_trigger_by_expression($permission, $expression)
{
    global $USER_DETAILS;
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, $permission, null, get_current_nodeid(true));
    $db_hosts = get_hosts_by_expression($expression);
    while ($host_data = DBfetch($db_hosts)) {
        if (!isset($available_hosts[$host_data['hostid']])) {
            return false;
        }
    }
    return true;
}
开发者ID:rennhak,项目名称:zabbix,代码行数:12,代码来源:triggers.inc.php

示例11: define

$page['file'] = 'scripts_exec.php';
define('ZBX_PAGE_NO_MENU', 1);
include_once "include/page_header.php";
//---------------------------------- CHECKS ------------------------------------
//		VAR							TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({execute})'), 'scriptid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({execute})'), 'execute' => array(T_ZBX_INT, O_OPT, P_ACT, IN('0,1'), null));
check_fields($fields);
if (isset($_REQUEST['execute'])) {
    if ($script = get_script_by_scriptid($_REQUEST['scriptid'])) {
        if ($script['host_access'] == PERM_READ_WRITE) {
            $hosts_read_write = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_WRITE, PERM_RES_IDS_ARRAY);
            if (uint_in_array($_REQUEST['hostid'], $hosts_read_write)) {
                //SDI('WRITE: '.$_REQUEST['scriptid'].' : '.$_REQUEST['hostid']);
                //				$result = execute_script($_REQUEST['scriptid'],$_REQUEST['hostid']);
                //				insert_command_result_form($result["flag"],$result["message"]);
                insert_command_result_form($_REQUEST['scriptid'], $_REQUEST['hostid']);
                /*				echo nl2br(htmlspecialchars($result));*/
            }
        } else {
            $hosts_read_only = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
            if (uint_in_array($_REQUEST['hostid'], $hosts_read_only)) {
                //SDI('READ: '.$_REQUEST['scriptid'].' : '.$_REQUEST['hostid']);
                //				$result = execute_script($_REQUEST['scriptid'],$_REQUEST['hostid']);
                //				insert_command_result_form($result["flag"],$result["message"]);
                insert_command_result_form($_REQUEST['scriptid'], $_REQUEST['hostid']);
                /*				echo nl2br(htmlspecialchars($result));*/
            }
        }
    }
}
include_once "include/page_footer.php";
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:scripts_exec.php

示例12: get_viewed_hosts

function get_viewed_hosts($perm, $groupid = 0, $options = array(), $nodeid = null, $sql = array('monitored_hosts' => 1))
{
    global $USER_DETAILS;
    global $page;
    $def_sql = array('from' => array('hosts h'), 'where' => array());
    $def_options = array('allow_all' => 0, 'select_first_host' => 0, 'select_first_host_if_empty' => 0, 'select_host_on_group_switch' => 0, 'do_not_select' => 0, 'do_not_select_if_empty' => 0, 'monitored_hosts' => 0, 'templated_hosts' => 0, 'real_hosts' => 0, 'not_proxy_hosts' => 0, 'with_items' => 0, 'with_monitored_items' => 0, 'with_historical_items' => 0, 'with_triggers' => 0, 'with_monitored_triggers' => 0, 'with_httptests' => 0, 'with_monitored_httptests' => 0, 'with_graphs' => 0, 'only_current_node' => 0);
    $def_options = array_merge($def_options, $options);
    $dd_first_entry = ZBX_DROPDOWN_FIRST_ENTRY;
    if ($dd_first_entry == ZBX_DROPDOWN_FIRST_ZBX162) {
        $def_options['select_first_host_if_empty'] = 1;
        $dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;
    }
    if ($def_options['allow_all']) {
        $dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;
    }
    if ($dd_first_entry == ZBX_DROPDOWN_FIRST_ALL) {
        $def_options['select_host_on_group_switch'] = 1;
    }
    $result = array('original' => -1, 'selected' => 0, 'hosts' => array(), 'hostids' => array());
    $hosts =& $result['hosts'];
    $hostids =& $result['hostids'];
    $first_entry = $dd_first_entry == ZBX_DROPDOWN_FIRST_NONE ? S_NOT_SELECTED_SMALL : S_ALL_SMALL;
    $hosts['0'] = $first_entry;
    $hostids['0'] = '0';
    if (!is_array($groupid) && $groupid == 0) {
        if ($dd_first_entry == ZBX_DROPDOWN_FIRST_NONE) {
            return $result;
        }
    } else {
        zbx_value2array($groupid);
        $def_sql['from'][] = 'hosts_groups hg';
        $def_sql['where'][] = DBcondition('hg.groupid', $groupid);
        $def_sql['where'][] = 'hg.hostid=h.hostid';
    }
    $_REQUEST['hostid'] = $result['original'] = get_request('hostid', -1);
    //-----
    $nodeid = is_null($nodeid) ? get_current_nodeid(!$def_options['only_current_node']) : $nodeid;
    $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, $perm, PERM_RES_IDS_ARRAY, $nodeid, AVAILABLE_NOCACHE);
    // hosts
    if ($def_options['monitored_hosts']) {
        $def_sql['where'][] = 'h.status=' . HOST_STATUS_MONITORED;
    } else {
        if ($def_options['real_hosts']) {
            $def_sql['where'][] = 'h.status IN(' . HOST_STATUS_MONITORED . ',' . HOST_STATUS_NOT_MONITORED . ')';
        } else {
            if ($def_options['templated_hosts']) {
                $def_sql['where'][] = 'h.status=' . HOST_STATUS_TEMPLATE;
            } else {
                if ($def_options['not_proxy_hosts']) {
                    $def_sql['where'][] = 'h.status<>' . HOST_STATUS_PROXY;
                }
            }
        }
    }
    // items
    if ($def_options['with_items']) {
        $def_sql['where'][] = 'EXISTS (SELECT i.hostid FROM items i WHERE h.hostid=i.hostid )';
    } else {
        if ($def_options['with_monitored_items']) {
            $def_sql['where'][] = 'EXISTS (SELECT i.hostid FROM items i WHERE h.hostid=i.hostid AND i.status=' . ITEM_STATUS_ACTIVE . ')';
        } else {
            if ($def_options['with_historical_items']) {
                $def_sql['where'][] = 'EXISTS (SELECT i.hostid FROM items i WHERE h.hostid=i.hostid AND (i.status=' . ITEM_STATUS_ACTIVE . ' OR i.status=' . ITEM_STATUS_NOTSUPPORTED . ') AND i.lastvalue IS NOT NULL)';
            }
        }
    }
    // triggers
    if ($def_options['with_triggers']) {
        $def_sql['where'][] = 'EXISTS( SELECT i.itemid ' . ' FROM items i, functions f, triggers t' . ' WHERE i.hostid=h.hostid ' . ' AND i.itemid=f.itemid ' . ' AND f.triggerid=t.triggerid)';
    } else {
        if ($def_options['with_monitored_triggers']) {
            $def_sql['where'][] = 'EXISTS( SELECT i.itemid ' . ' FROM items i, functions f, triggers t' . ' WHERE i.hostid=h.hostid ' . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND i.itemid=f.itemid ' . ' AND f.triggerid=t.triggerid ' . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ')';
        }
    }
    // httptests
    if ($def_options['with_httptests']) {
        $def_sql['where'][] = 'EXISTS( SELECT a.applicationid ' . ' FROM applications a, httptest ht ' . ' WHERE a.hostid=h.hostid ' . ' AND ht.applicationid=a.applicationid)';
    } else {
        if ($def_options['with_monitored_httptests']) {
            $def_sql['where'][] = 'EXISTS( SELECT a.applicationid ' . ' FROM applications a, httptest ht ' . ' WHERE a.hostid=h.hostid ' . ' AND ht.applicationid=a.applicationid ' . ' AND ht.status=' . HTTPTEST_STATUS_ACTIVE . ')';
        }
    }
    // graphs
    if ($def_options['with_graphs']) {
        $def_sql['where'][] = 'EXISTS( SELECT DISTINCT i.itemid ' . ' FROM items i, graphs_items gi ' . ' WHERE i.hostid=h.hostid ' . ' AND i.itemid=gi.itemid)';
    }
    //------
    foreach ($sql as $key => $value) {
        zbx_value2array($value);
        if (isset($def_sql[$key])) {
            $def_sql[$key] = array_merge($def_sql[$key], $value);
        } else {
            $def_sql[$key] = $value;
        }
    }
    $def_sql['from'] = array_unique($def_sql['from']);
    $def_sql['where'] = array_unique($def_sql['where']);
    $sql_from = '';
    $sql_where = '';
    if (!empty($def_sql['from'])) {
//.........这里部分代码省略.........
开发者ID:rennhak,项目名称:zabbix,代码行数:101,代码来源:hosts.inc.php

示例13: get_screen


//.........这里部分代码省略.........
                                } else {
                                    $item = $image_map;
                                    //						$item = new CLink($image_map, $action);
                                }
                            } else {
                                if ($screenitemid != 0 && $resourcetype == SCREEN_RESOURCE_PLAIN_TEXT) {
                                    // Host feature
                                    if ($dynamic == SCREEN_DYNAMIC_ITEM && isset($_REQUEST['hostid']) && $_REQUEST['hostid'] > 0) {
                                        if ($newitemid = get_same_item_for_host($resourceid, $_REQUEST['hostid'])) {
                                            $resourceid = $newitemid;
                                        } else {
                                            $resourceid = 0;
                                        }
                                    }
                                    //-------------
                                    $item = array(get_screen_plaintext($resourceid, $elements, $style));
                                    if ($editmode == 1) {
                                        array_push($item, new CLink(S_CHANGE, $action));
                                    }
                                } else {
                                    if ($screenitemid != 0 && $resourcetype == SCREEN_RESOURCE_STATUS_OF_TRIGGERS) {
                                        $params = array();
                                        $params['groupid'] = get_request('tr_groupid', get_profile('web.screens.tr_groupid', 0));
                                        $params['hostid'] = get_request('tr_hostid', get_profile('web.screens.tr_hostid', 0));
                                        $params['limit'] = $elements;
                                        update_profile('web.screens.tr_groupid', $params['groupid'], PROFILE_TYPE_ID);
                                        update_profile('web.screens.tr_hostid', $params['hostid'], PROFILE_TYPE_ID);
                                        $tr_form = new CForm();
                                        $cmbGroup = new CComboBox('tr_groupid', $params['groupid'], 'submit()');
                                        $cmbHosts = new CComboBox('tr_hostid', $params['hostid'], 'submit()');
                                        $cmbGroup->addItem(0, S_ALL_SMALL);
                                        $cmbHosts->addItem(0, S_ALL_SMALL);
                                        $available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_ONLY);
                                        $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY);
                                        $available_triggers = get_accessible_triggers(PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
                                        $sql = 'SELECT DISTINCT g.groupid,g.name ' . ' FROM groups g, hosts_groups hg, hosts h ' . ' WHERE ' . DBcondition('g.groupid', $available_groups) . ' AND hg.groupid=g.groupid ' . ' AND h.hostid=hg.hostid ' . ' AND h.status=' . HOST_STATUS_MONITORED . ' AND EXISTS(SELECT i.itemid FROM items i WHERE i.status=' . ITEM_STATUS_ACTIVE . ' AND i.hostid=h.hostid ) ' . ' ORDER BY g.name';
                                        $tresult = DBselect($sql);
                                        while ($tr_row = DBfetch($tresult)) {
                                            $cmbGroup->addItem($tr_row['groupid'], get_node_name_by_elid($tr_row['groupid']) . $tr_row['name']);
                                        }
                                        $tr_form->addItem(array(S_GROUP . SPACE, $cmbGroup));
                                        $sql_from = '';
                                        $sql_where = '';
                                        if ($params['groupid'] > 0) {
                                            $sql_from .= ',hosts_groups hg ';
                                            $sql_where .= ' AND hg.hostid=h.hostid AND hg.groupid=' . $params['groupid'];
                                        }
                                        $sql = 'SELECT DISTINCT h.hostid,h.host ' . ' FROM hosts h, items i, functions f, triggers t ' . $sql_from . ' WHERE h.status=' . HOST_STATUS_MONITORED . $sql_where . ' AND h.hostid=i.hostid ' . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND i.itemid=f.itemid ' . ' AND f.triggerid=t.triggerid ' . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND ' . DBcondition('h.hostid', $available_hosts) . ' ORDER BY h.host';
                                        $tresult = DBselect($sql);
                                        while ($tr_row = DBfetch($tresult)) {
                                            $cmbHosts->addItem($tr_row['hostid'], get_node_name_by_elid($tr_row['hostid']) . $tr_row['host']);
                                        }
                                        $tr_form->addItem(array(SPACE . S_HOST . SPACE, $cmbHosts));
                                        $item = array(get_table_header(array(S_STATUS_OF_TRIGGERS_BIG, SPACE, date('[H:i:s]', time())), $tr_form));
                                        //*/
                                        //					$item = array();
                                        $item[] = make_latest_issues($params);
                                        if ($editmode == 1) {
                                            array_push($item, new CLink(S_CHANGE, $action));
                                        }
                                    } else {
                                        if ($screenitemid != 0 && $resourcetype == SCREEN_RESOURCE_SYSTEM_STATUS) {
                                            $item = array(get_table_header(array(S_SYSTEM_STATUSBIG, SPACE, date('[H:i:s]', time()))));
                                            $item[] = make_system_summary();
                                            if ($editmode == 1) {
                                                array_push($item, new CLink(S_CHANGE, $action));
开发者ID:phedders,项目名称:zabbix,代码行数:67,代码来源:screens.inc.php

示例14: array

require_once 'include/forms.inc.php';
$page['title'] = "S_CONFIGURATION_OF_GRAPHS";
$page['file'] = 'graphs.php';
$page['hist_arg'] = array();
$page['scripts'] = array('graphs.js');
include_once 'include/page_header.php';
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, NULL, DB_ID, NULL), 'hostid' => array(T_ZBX_INT, O_OPT, NULL, DB_ID, NULL), 'copy_type' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), 'isset({copy})'), 'copy_mode' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0'), NULL), 'graphid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, '(isset({form})&&({form}=="update"))'), 'name' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({save})'), 'width' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), 'isset({save})'), 'height' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), 'isset({save})'), 'ymin_type' => array(T_ZBX_INT, O_OPT, NULL, IN('0,1,2'), null), 'ymax_type' => array(T_ZBX_INT, O_OPT, NULL, IN('0,1,2'), null), 'graphtype' => array(T_ZBX_INT, O_OPT, NULL, IN('0,1,2,3'), 'isset({save})'), 'yaxismin' => array(T_ZBX_DBL, O_OPT, NULL, null, 'isset({save})&&(({graphtype} == 0) || ({graphtype} == 1))'), 'yaxismax' => array(T_ZBX_DBL, O_OPT, NULL, null, 'isset({save})&&(({graphtype} == 0) || ({graphtype} == 1))'), 'graph3d' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'legend' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), "ymin_itemid" => array(T_ZBX_INT, O_OPT, NULL, DB_ID, 'isset({save})&&isset({ymin_type})&&({ymin_type}==3)'), "ymax_itemid" => array(T_ZBX_INT, O_OPT, NULL, DB_ID, 'isset({save})&&isset({ymax_type})&&({ymax_type}==3)'), 'percent_left' => array(T_ZBX_DBL, O_OPT, NULL, BETWEEN(0, 100), null), 'percent_right' => array(T_ZBX_DBL, O_OPT, NULL, BETWEEN(0, 100), null), 'visible' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 1), null), 'items' => array(T_ZBX_STR, O_OPT, NULL, null, null), 'new_graph_item' => array(T_ZBX_STR, O_OPT, NULL, null, null), 'group_gid' => array(T_ZBX_STR, O_OPT, NULL, null, null), 'move_up' => array(T_ZBX_INT, O_OPT, NULL, null, null), 'move_down' => array(T_ZBX_INT, O_OPT, NULL, null, null), 'showworkperiod' => array(T_ZBX_INT, O_OPT, NULL, IN('1'), NULL), 'showtriggers' => array(T_ZBX_INT, O_OPT, NULL, IN('1'), NULL), 'group_graphid' => array(T_ZBX_INT, O_OPT, NULL, DB_ID, NULL), 'copy_targetid' => array(T_ZBX_INT, O_OPT, NULL, DB_ID, NULL), 'filter_groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({copy})&&(isset({copy_type})&&({copy_type}==0))'), 'add_item' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'delete_item' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'clone' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'copy' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'delete' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'form_copy_to' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'form_refresh' => array(T_ZBX_INT, O_OPT, NULL, NULL, NULL));
check_fields($fields);
validate_sort_and_sortorder('g.name', ZBX_SORT_UP);
$_REQUEST['items'] = get_request('items', array());
$_REQUEST['group_gid'] = get_request('group_gid', array());
$_REQUEST['graph3d'] = get_request('graph3d', 0);
$_REQUEST['legend'] = get_request('legend', 0);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_WRITE);
$available_hosts_all_nodes = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_WRITE, null, get_current_nodeid(true));
$available_graphs = get_accessible_graphs(PERM_READ_WRITE, array(), null, get_current_nodeid(true));
// OPTIMAZE
// ---- <ACTIONS> ----
if (isset($_REQUEST['clone']) && isset($_REQUEST['graphid'])) {
    unset($_REQUEST['graphid']);
    $_REQUEST['form'] = 'clone';
} else {
    if (isset($_REQUEST['save'])) {
        $items = get_request('items', array());
        $itemids = array();
        foreach ($items as $gitem) {
            $itemids[$gitem['itemid']] = $gitem['itemid'];
        }
        if (!empty($itemids)) {
            $sql = 'SELECT h.hostid ' . ' FROM hosts h,items i ' . ' WHERE h.hostid=i.hostid ' . ' AND ' . DBcondition('i.itemid', $itemids) . ' AND ' . DBcondition('h.hostid', $available_hosts_all_nodes, true);
开发者ID:rennhak,项目名称:zabbix,代码行数:31,代码来源:graphs.php

示例15: array

**
** 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., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
require_once 'include/config.inc.php';
require_once 'include/hosts.inc.php';
require_once 'include/maintenances.inc.php';
require_once 'include/forms.inc.php';
$page['title'] = "S_HOSTS";
$page['file'] = 'hosts.php';
$page['hist_arg'] = array('groupid', 'config', 'hostid');
include_once 'include/page_header.php';
$_REQUEST['config'] = get_request('config', 'hosts.php');
$available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_WRITE);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_WRITE);
if (isset($_REQUEST['groupid']) && $_REQUEST['groupid'] > 0 && !isset($available_groups[$_REQUEST['groupid']])) {
    access_deny();
}
if (isset($_REQUEST['hostid']) && $_REQUEST['hostid'] > 0 && !isset($available_hosts[$_REQUEST['hostid']])) {
    access_deny();
}
if (isset($_REQUEST['apphostid']) && $_REQUEST['apphostid'] > 0 && !isset($available_hosts[$_REQUEST['apphostid']])) {
    access_deny();
}
//		VAR			TYPE	OPTIONAL FLAGS	VALIDATION	EXCEPTION
$fields = array('config' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'hosts' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groups' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'hostids' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groupids' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'applications' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form})&&({form}=="update")'), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form})&&({form}=="update")'), 'host' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({save})&&!isset({massupdate})'), 'proxy_hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({save})&&!isset({massupdate})'), 'dns' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({save})&&!isset({massupdate})'), 'useip' => array(T_ZBX_STR, O_OPT, NULL, IN('0,1'), 'isset({save})&&!isset({massupdate})'), 'ip' => array(T_ZBX_IP, O_OPT, NULL, NULL, 'isset({save})&&!isset({massupdate})'), 'port' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), 'isset({save})&&!isset({massupdate})'), 'status' => array(T_ZBX_INT, O_OPT, NULL, IN('0,1,3'), 'isset({save})&&!isset({massupdate})'), 'newgroup' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'templates' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, NULL), 'clear_templates' => array(T_ZBX_INT, O_OPT, NULL, DB_ID, NULL), 'useipmi' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'ipmi_ip' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_port' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_authtype' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(-1, 6), 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_privilege' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(1, 5), 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_username' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_password' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useipmi})&&!isset({massupdate})'), 'useprofile' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'devicetype' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'name' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'os' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'serialno' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'tag' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'macaddress' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'hardware' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'software' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'contact' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'location' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'notes' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'useprofile_ext' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'ext_host_profiles' => array(T_ZBX_STR, O_OPT, P_UNSET_EMPTY, NULL, NULL), 'massupdate' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'visible' => array(T_ZBX_STR, O_OPT, null, null, null), 'go' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'add_to_group' => array(T_ZBX_INT, O_OPT, P_SYS | P_ACT, DB_ID, NULL), 'delete_from_group' => array(T_ZBX_INT, O_OPT, P_SYS | P_ACT, DB_ID, NULL), 'unlink' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'unlink_and_clear' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'save' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'clone' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'full_clone' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'delete' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'delete_and_clear' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'cancel' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'form' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'form_refresh' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL));
check_fields($fields);
validate_sort_and_sortorder('h.host', ZBX_SORT_UP);
$_REQUEST['go'] = get_request('go', 'none');
/************ ACTIONS FOR HOSTS ****************/
开发者ID:phedders,项目名称:zabbix,代码行数:31,代码来源:hosts.php


注:本文中的get_accessible_hosts_by_user函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。