本文整理汇总了PHP中Check::get_check_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Check::get_check_id方法的具体用法?PHP Check::get_check_id怎么用?PHP Check::get_check_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Check
的用法示例。
在下文中一共展示了Check::get_check_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Check
$script_dir = "check-scripts";
// Get check info
// Create check object
$check = new Check($check_id);
// 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'];
示例2: displayAllChecks
function displayAllChecks()
{
//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("Add Check");
$toolIcons = array("add");
$toolHandlers = array("handleEvent('" . $_SERVER['PHP_SELF'] . "?action=addCheck')");
echo $tool->createNewTools($toolNames, $toolIcons, $toolHandlers);
$keyHandlers = array();
$keyData = array();
$keyTitle = array();
foreach (Check::get_checks() as $id => $name) {
$check = new Check($id);
array_push($keyHandlers, "handleEvent('" . $_SERVER['PHP_SELF'] . "?action=showCheck&checkid=" . $check->get_check_id() . "')");
array_push($keyData, $check->get_name());
array_push($keyData, $check->get_hostname());
array_push($keyData, $check->get_desc());
array_push($keyData, $check->get_interval());
array_push($keyData, $check->get_template_name());
}
$headings = array("Name", "Host", "Description", "Interval", "Template");
$form->setCols(5);
$form->setTableWidth("1024px");
$form->setData($keyData);
$form->setEventHandler($keyHandlers);
$form->setHeadings($headings);
$form->setSortable(true);
echo $form->showForm();
}