本文整理汇总了PHP中substitute_host_data函数的典型用法代码示例。如果您正苦于以下问题:PHP substitute_host_data函数的具体用法?PHP substitute_host_data怎么用?PHP substitute_host_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了substitute_host_data函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: rrd_substitute_host_query_data
function rrd_substitute_host_query_data($txt_graph_item, $graph, $graph_item) {
/* replace host variables in graph elements */
$txt_graph_item = substitute_host_data($txt_graph_item, '|','|', $graph["host_id"]);
/* replace query variables in graph elements */
if (preg_match("/\|query_[a-zA-Z0-9_]+\|/", $txt_graph_item)) {
/* default to the graph data query information from the graph */
if (empty($graph_item["local_data_id"])) {
return substitute_snmp_query_data($txt_graph_item, $graph["host_id"], $graph["snmp_query_id"], $graph["snmp_index"]);
/* use the data query information from the data source if possible */
}else{
$data_local = db_fetch_row("select snmp_index,snmp_query_id,host_id from data_local where id='" . $graph_item["local_data_id"] . "'");
return substitute_snmp_query_data($txt_graph_item, $data_local["host_id"], $data_local["snmp_query_id"], $data_local["snmp_index"]);
}
}else{
return $txt_graph_item;
}
}
开发者ID:songchin,项目名称:Cacti,代码行数:18,代码来源:rrd.php
示例2: get_script_query_path
function get_script_query_path($args, $script_path, $host_id) {
global $config;
include_once($config["library_path"] . "/variables.php");
/* get any extra arguments that need to be passed to the script */
if (!empty($args)) {
$extra_arguments = substitute_host_data($args, "|", "|", $host_id);
}else{
$extra_arguments = "";
}
/* get a complete path for out target script */
return substitute_script_query_path($script_path) . " $extra_arguments";
}
开发者ID:songchin,项目名称:Cacti,代码行数:15,代码来源:data_query.php
示例3: expand_title
function expand_title($host_id, $snmp_query_id, $snmp_index, $title)
{
if (strstr($title, '|') && !empty($host_id)) {
if ($snmp_query_id != '0' && $snmp_index != '') {
return substitute_snmp_query_data(null_out_substitutions(substitute_host_data($title, '|', '|', $host_id)), $host_id, $snmp_query_id, $snmp_index, read_config_option('max_data_query_field_length'));
} else {
return null_out_substitutions(substitute_host_data($title, '|', '|', $host_id));
}
} else {
return null_out_substitutions($title);
}
}
开发者ID:MrWnn,项目名称:cacti,代码行数:12,代码来源:variables.php
示例4: expand_title
function expand_title($host_id, $snmp_query_id, $snmp_index, $title) {
if ((strstr($title, "|")) && (!empty($host_id))) {
if (($snmp_query_id != "0") && ($snmp_index != "")) {
return substitute_snmp_query_data(null_out_substitutions(substitute_host_data($title, "|", "|", $host_id)), $host_id, $snmp_query_id, $snmp_index, read_config_option("max_data_query_field_length"));
}else{
return null_out_substitutions(substitute_host_data($title, "|", "|", $host_id));
}
}else{
return null_out_substitutions($title);
}
}
开发者ID:songchin,项目名称:Cacti,代码行数:11,代码来源:variables.php
示例5: rrd_substitute_host_query_data
function rrd_substitute_host_query_data($txt_graph_item, $graph, $graph_item)
{
/* replace host variables in graph elements */
$host_id = 0;
if (empty($graph["host_id"])) {
/* if graph has no associated host determine host_id from graph item data source */
if (!empty($graph_item["local_data_id"])) {
$host_id = db_fetch_cell("SELECT host_id FROM data_local WHERE id='" . $graph_item["local_data_id"] . "'");
}
} else {
$host_id = $graph["host_id"];
}
$txt_graph_item = substitute_host_data($txt_graph_item, '|', '|', $host_id);
/* replace query variables in graph elements */
if (preg_match("/\\|query_[a-zA-Z0-9_]+\\|/", $txt_graph_item)) {
/* default to the graph data query information from the graph */
if (empty($graph_item["local_data_id"])) {
$txt_graph_item = substitute_snmp_query_data($txt_graph_item, $graph["host_id"], $graph["snmp_query_id"], $graph["snmp_index"]);
/* use the data query information from the data source if possible */
} else {
$data_local = db_fetch_row("SELECT snmp_index,snmp_query_id,host_id FROM data_local WHERE id='" . $graph_item["local_data_id"] . "'");
$txt_graph_item = substitute_snmp_query_data($txt_graph_item, $data_local["host_id"], $data_local["snmp_query_id"], $data_local["snmp_index"]);
}
}
/* replace query variables in graph elements */
if (preg_match("/\\|input_[a-zA-Z0-9_]+\\|/", $txt_graph_item)) {
return substitute_data_input_data($txt_graph_item, $graph, $graph_item["local_data_id"]);
}
return $txt_graph_item;
}
开发者ID:MrWnn,项目名称:cacti,代码行数:30,代码来源:rrd.php
注:本文中的substitute_host_data函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论