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


PHP Check::get_key1方法代码示例

本文整理汇总了PHP中Check::get_key1方法的典型用法代码示例。如果您正苦于以下问题:PHP Check::get_key1方法的具体用法?PHP Check::get_key1怎么用?PHP Check::get_key1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Check的用法示例。


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

示例1: exec_check

// Start timer and exec check script
$time_start = microtime(true);
$script = "{$script_dir}/" . $check->get_parsed_check_script();
$check_result = exec_check($script);
// Now create a new Event object
// Store the info we know from Check object
// and check results
$event = new Event();
$event->set_status($check_result['status']);
$event->set_info_msg($check_result['message']);
$event->set_performance_data($check_result['perf_data']);
$event->set_check_id($check->get_check_id());
$event->set_script($script);
$event->set_check_name($check->get_name());
$event->set_hostname($check->get_hostname());
$event->set_key1($check->get_key1());
$event->set_key2($check->get_key2());
// Now  we can use handle_event() to figure out if this is a new
// or exitsing event. It will do all the updating for us
// and call notify() in the event class
$event->handle_event();
$time_end = microtime(true);
$time = $time_end - $time_start;
//print status line
print "{$script} => status: " . $event->get_status() . "  " . trim($event->get_info_msg());
if ($check_result['perf_data'] != "") {
    print " | " . $check_result['perf_data'];
}
print " -- ({$time} sec)\n";
// This function does the actual execution
function exec_check($script)
开发者ID:precurse,项目名称:netharbour,代码行数:31,代码来源:monpol.php

示例2: displayCheckDetails

function displayCheckDetails()
{
    //global the tool and make a tool bar for adding a device and display all the archived device, and displaying the IP Report
    global $tool, $form, $status_array, $status_collors;
    $toolNames = array("Edit Check", "Delete Check", "Create Report");
    $toolIcons = array("edit", "delete", "report");
    $toolHandlers = array("handleEvent('" . $_SERVER['PHP_SELF'] . "?action=editCheck&checkid=" . $_GET[checkid] . "')", "handleEvent('" . $_SERVER['PHP_SELF'] . "?action=deleteCheck&checkid=" . $_GET[checkid] . "')", "handleEvent('" . $_SERVER['PHP_SELF'] . "?action=renderCheckReportForm&checkid=" . $_GET[checkid] . "')");
    echo $tool->createNewTools($toolNames, $toolIcons, $toolHandlers);
    $keyHandlers = array();
    $keyData = array();
    $keyTitle = array();
    if (is_numeric($_GET[checkid])) {
        $check = new Check($_GET[checkid]);
    } else {
        $form->warning("Invalid check id");
        return;
    }
    $keyData = array($check->get_name(), $check->get_hostname(), $check->get_desc(), $check->get_interval() . " Minutes", $check->get_template_name(), $check->get_arguments(), $check->get_key1(), $check->get_key2(), nl2br($check->get_notes()));
    $headings = array("Check Details");
    $key1 = "Key1<br><small>" . $check->get_key1_name() . "</small>";
    $key2 = "Key2<br><i><small>" . $check->get_key2_name() . "</small></i>";
    $keyTitle = array("Name.tip.descriptive name for this chesk", "Hostname", "Description.tip.A usefull description", "Interval.tip.Check interval in Minutes", "Template", "Arguments", "{$key1}", "{$key2}", "Notes");
    $form->setCols(2);
    $form->setTableWidth("450px");
    $form->setData($keyData);
    $form->setTitles($keyTitle);
    $form->setEventHandler($keyHandlers);
    $form->setHeadings($headings);
    $form->setSortable(false);
    return $form->showForm();
}
开发者ID:precurse,项目名称:netharbour,代码行数:31,代码来源:monitor.php


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