本文整理汇总了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)
示例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();
}