• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Monitor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createApplication

 public function createApplication()
 {
     $ems = new Monitor();
     $ems->run();
     $app = $ems->getApp();
     $app['debug'] = true;
     unset($app['exception_handler']);
     return $app;
 }
开发者ID:bmh2f,项目名称:Cloud4SOA,代码行数:9,代码来源:MonitorTest.php


示例2: testGetMonitorOptions

 public function testGetMonitorOptions()
 {
     $monitors = Monitor::model()->getMonitorOptions();
     $this->assertTrue(3 === count($monitors));
     $this->assertTrue(is_array($monitors));
     $this->assertTrue(in_array('monitor1', $monitors));
     $this->assertFalse(in_array('monitor4', $monitors));
 }
开发者ID:nurielmeni,项目名称:nymedia,代码行数:8,代码来源:ScreenTest.php


示例3: actionUbah

 /**
  * Updates a particular model.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUbah($id)
 {
     $model = $this->loadModel($id);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Server'])) {
         $model->attributes = $_POST['Server'];
         $model->save();
     }
     $monitorListBukan = new Monitor('search');
     $monitorListBukan->unsetAttributes();
     $monitorListBukan->serverId = $id;
     $monitorList = new ServerMonitor('search');
     $monitorList->unsetAttributes();
     $monitorList->server_id = $id;
     $this->render('ubah', array('model' => $model, 'monitorListBukan' => $monitorListBukan, 'monitorList' => $monitorList));
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:21,代码来源:ServerController.php


示例4: actionSort

 public function actionSort()
 {
     $return = array('sukses' => false);
     if (isset($_POST['mon'])) {
         Monitor::model()->updateOrder($_POST['mon']);
         $return = array('sukses' => true);
     }
     $this->renderJSON($return);
 }
开发者ID:sufehmi,项目名称:ahadmon,代码行数:9,代码来源:DashboardController.php


示例5: outputToDevice

 public static function outputToDevice($deviceID)
 {
     if ($deviceID == 1) {
         Monitor::drawDataToMonitor();
     }
     if ($deviceID == 2) {
         Printer::sendDataToPrinter();
     }
 }
开发者ID:nahidacm,项目名称:designpatterns,代码行数:9,代码来源:io.php


示例6: getMonitors

 public static function getMonitors()
 {
     $monitors = array();
     $mrows = $GLOBALS['PW_DB']->executeSelect('*', 'monitors', '');
     foreach ($mrows as $m) {
         $monitors[] = Monitor::fetch($m);
     }
     return $monitors;
 }
开发者ID:jalopezsuarez,项目名称:phpwatch,代码行数:9,代码来源:GuiHelpers.php


示例7: actionMonitorDetail

 public function actionMonitorDetail($id, $serverId)
 {
     $namaTabel = "{$serverId}_{$id}";
     $model = new MonitorDetail($namaTabel);
     $model->scenario = 'search';
     $monitor = Monitor::model()->findByPk($id);
     $server = Server::model()->findByPk($serverId);
     $this->render('monitor_detail', ['model' => $model, 'server' => $server, 'monitor' => $monitor]);
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:9,代码来源:DashboardController.php


示例8: checkAll

 public static function checkAll()
 {
     $monitors = $GLOBALS['PW_DB']->executeSelect('*', 'monitors', '');
     foreach ($monitors as $mrow) {
         $monitor = Monitor::fetch($mrow);
         $up = $monitor->poll();
         echo $monitor->getAlias(), $up;
         $monitor->saveToDb();
     }
 }
开发者ID:ryanaverill,项目名称:phpwatch,代码行数:10,代码来源:ServiceChecker.php


示例9: runTestFunction

 /**
  * @param string $func_name
  * @param string $desc
  * @return array
  */
 private function runTestFunction($func_name, $desc)
 {
     $start_mem_usage = memory_get_usage();
     $start_time = Monitor::getMicroTime();
     for ($i = $this->num_runs; $i > 0; $i--) {
         $this->{$func_name}();
     }
     $memory = memory_get_usage() - $start_mem_usage;
     return array('function' => $func_name, 'description' => $desc, 'mem_usage' => round($memory / 1024 / 1024, 4), 'time' => bcsub(Monitor::getMicroTime(), $start_time, 4));
 }
开发者ID:alejofix,项目名称:Gape,代码行数:15,代码来源:AbstractFunctionComparison.php


示例10: processDelete

 public function processDelete($data)
 {
     $this->customProcessDelete();
     $mons = $GLOBALS['PW_DB']->executeSelect('*', 'monitors', 'WHERE ' . intval($this->id) . ' IN
         (notification_channels)');
     foreach ($mons as $mon) {
         $mhandle = Monitor::fetch($mon);
         $mhandle->deleteChannel($mhandle);
         $mhandle->saveToDb();
     }
     $GLOBALS['PW_DB']->executeDelete('channels', 'WHERE id=' . intval($this->id));
 }
开发者ID:jalopezsuarez,项目名称:phpwatch,代码行数:12,代码来源:Channel.php


示例11: pushError

 public function pushError($error)
 {
     $di = \Phalcon\DI::getDefault();
     if (isset($di['request'])) {
         $error['url'] = $di['request']->getHttpHost() . $di['request']->getUri();
     }
     if (isset($di['local']->rawData['service'])) {
         $error['callinfo'] = json_encode($di['local']->rawData);
         if ($di['local']->rawData['service'] == 'Api\\Services\\Monitor') {
             return;
         }
     }
     $error['app'] = Monitor::getProject();
     $error['serverip'] = sprintf("%u\n", ip2long(Monitor::getLocalip()));
     $di['remote']->swooleCall(array('service' => 'Api\\Services\\Monitor', 'method' => 'addlog', 'args' => array($error)));
 }
开发者ID:tianyunchong,项目名称:php,代码行数:16,代码来源:ApiException.php


示例12: run

 public function run()
 {
     $servers = ServerMonitor::model()->ambilServers($this->monitorId);
     $monitor = Monitor::model()->findByPk($this->monitorId);
     $tipeOutput = $monitor->outputType->nama;
     $tipeView = $monitor->viewType->nama;
     switch ($tipeView) {
         case 'linechart':
             $view = 'boxMonitorLineChart';
             break;
         case 'onoffstatus':
             $view = 'boxMonitorOnOffStatus';
             break;
         case 'text':
             $view = 'boxMonitorText';
             break;
     }
     $this->render($view, array('title' => $this->title, 'monitorId' => $this->monitorId, 'servers' => $servers, 'tipeOutput' => $tipeOutput));
 }
开发者ID:nurulimamnotes,项目名称:ahadmon,代码行数:19,代码来源:MonitorWidget.php


示例13: disabletestMaxSize

 /**
  * test file writing stops at max size. max size is set to 10 in setUp, so there is only space for 1 log
  * @todo doesn't work as fileSize always returns the same value as at first read. So test manually instead.
  */
 public function disabletestMaxSize()
 {
     AmfphpMonitor::addTime('test time 0 ');
     $this->object->filterSerializedResponse(null);
     AmfphpMonitor::addTime('should not log');
     $this->object->filterSerializedResponse(null);
     $this->object->filterSerializedResponse(null);
     $this->object->filterSerializedResponse(null);
     $this->object->filterSerializedResponse(null);
     $log = file_get_contents($this->logPath);
     //echo $log;
     //echo "ertert " . filesize($this->logPath);
     $this->assertTrue(strpos($log, 'should not log') === false);
 }
开发者ID:hackazon,项目名称:amfphp-2.0,代码行数:18,代码来源:AmfphpMonitorTest.php


示例14: loadModel

 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Monitor the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Monitor::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:jencina,项目名称:checklist,代码行数:15,代码来源:MonitorController.php


示例15: generate_entity


//.........这里部分代码省略.........
                          'cartridgeitems_id'  => $ctypeID,
                          'printers_id'        => $printID,
                          'date_in'            => date("Y-m-d",$date1),
                          'date_use'           => date("Y-m-d",$date1+$j*$inter),
                          'date_out'           => date("Y-m-d",$date1+($j+1)*$inter),
                          'pages'              => $printed));
         }

         // Add current cartridges
         $c->add(array('entities_id'        => $ID_entity,
                       'cartridgeitems_id'  => $ctypeID,
                       'printers_id'        => $printID,
                       'date_in'            => $date,
                       'date_use'           => date("Y-m-d",$date2)));
      }

      $iface = mt_rand(1,$MAX['iface']);

      // Add networking ports
      addNetworkEthernetPort('Printer', $printID, $ID_entity, $i);
   }
   unset($NET_LOC);
   $LAST["networking"] = getMaxItem("glpi_networkequipments");


   //////////// INVENTORY

   // glpi_computers
   $FIRST["computers"]   = getMaxItem("glpi_computers")+1;
   $FIRST["monitors"]    = getMaxItem("glpi_monitors")+1;
   $FIRST["phones"]      = getMaxItem("glpi_phones")+1;
   $FIRST["peripherals"] = getMaxItem("glpi_peripherals")+1;
   $c       = new Computer();
   $mon     = new Monitor();

   $cdevmb    = new Item_DeviceMotherBoard();
   $cdevproc  = new Item_DeviceProcessor();
   $cdevmem   = new Item_DeviceMemory();
   $cdevhd    = new Item_DeviceHardDrive();
   $cdevnc    = new Item_DeviceNetworkCard();
   $cdevdr    = new Item_DeviceDrive();
   $cdevcon   = new Item_DeviceControl();
   $cdevgc    = new Item_DeviceGraphicCard();
   $cdevsc    = new Item_DeviceSoundCard();
   $cdevpci   = new Item_DevicePci();
   $cdevcase  = new Item_DeviceCase();
   $cdevps    = new Item_DevicePowerSupply();

   $cdisk   = new ComputerDisk();
   $np      = new Netpoint();
   $ci      = new Computer_Item();
   $phone   = new Phone();
   $print   = new Printer();
   $periph  = new Peripheral();
   $cart    = new Cartridge();
   for ($i=0 ; $i<$MAX['computers'] ; $i++) {
      $loc       = mt_rand($FIRST["locations"],$LAST['locations']);
      $techID    = mt_rand($FIRST['users_sadmin'],$LAST['users_admin']);
      $userID    = mt_rand($FIRST['users_normal'],$LAST['users_postonly']);
      $groupID   = mt_rand($FIRST["groups"],$LAST["groups"]);
      $gtechID   = mt_rand($FIRST["techgroups"],$LAST["techgroups"]);
      $domainID  = mt_rand($FIRST['domain'],$LAST['domain']);
      $networkID = mt_rand(1,$MAX['network']);

      $compID = $c->add(toolbox::addslashes_deep(
                        array('entities_id'                    => $ID_entity,
开发者ID:KaneoGmbH,项目名称:glpi,代码行数:67,代码来源:generate_bigdump.function.php


示例16: array

<?php

include "../includes/Monitor.php";
$monitor = array();
$client = new Monitor();
//cantidad total de filas capturadas o encuestas ods2_mayo_14 mongodb
$monitor['totalEncuestas'] = $client->totalEncuestas();
// ultimos datos del log
$monitor['log'] = $client->getLog();
echo json_encode($monitor);
exit;
开发者ID:danieltorresr,项目名称:Encuestas2.0,代码行数:11,代码来源:monitor.php


示例17: importMonitor

 /**
  *
  * Import monitors from OCS
  * @since 1.0
  * @param $cfg_ocs OCSNG mode configuration
  * @param $computers_id computer's id in GLPI
  * @param $ocsservers_id OCS server id
  * @param $ocsid computer's id in OCS
  * @param entity the entity in which the monitor will be created
  * @param dohistory record in history link between monitor and computer
  */
 static function importMonitor($cfg_ocs, $computers_id, $ocsservers_id, $ocsid, $entity, $dohistory)
 {
     global $PluginOcsinventoryngDBocs, $DB;
     self::checkOCSconnection($ocsservers_id);
     if ($cfg_ocs["import_monitor"]) {
         $already_processed = array();
         $do_clean = true;
         $m = new Monitor();
         $conn = new Computer_Item();
         $query = "SELECT DISTINCT `CAPTION`, `MANUFACTURER`, `DESCRIPTION`, `SERIAL`, `TYPE`\n                   FROM `monitors`\n                   WHERE `HARDWARE_ID` = '{$ocsid}'";
         // Config says import monitor with serial number only
         // Restrict SQL query ony for monitors with serial present
         if ($cfg_ocs["import_monitor"] == 4) {
             $query = $query . " AND `SERIAL` NOT LIKE ''";
         }
         $result = $PluginOcsinventoryngDBocs->query($query);
         $lines = array();
         $checkserial = true;
         // First pass - check if all serial present
         if ($PluginOcsinventoryngDBocs->numrows($result) > 0) {
             while ($line = $PluginOcsinventoryngDBocs->fetch_array($result)) {
                 if (empty($line["SERIAL"])) {
                     $checkserial = false;
                 }
                 $lines[] = Toolbox::clean_cross_side_scripting_deep(Toolbox::addslashes_deep($line));
             }
         }
         if (count($lines) > 0 && ($cfg_ocs["import_monitor"] <= 2 || $checkserial)) {
             foreach ($lines as $line) {
                 $mon = array();
                 $mon["name"] = $line["CAPTION"];
                 if (empty($line["CAPTION"]) && !empty($line["MANUFACTURER"])) {
                     $mon["name"] = $line["MANUFACTURER"];
                 }
                 if (empty($line["CAPTION"]) && !empty($line["TYPE"])) {
                     if (!empty($line["MANUFACTURER"])) {
                         $mon["name"] .= " ";
                     }
                     $mon["name"] .= $line["TYPE"];
                 }
                 $mon["serial"] = $line["SERIAL"];
                 //Look for a monitor with the same name (and serial if possible) already connected
                 //to this computer
                 $query = "SELECT `m`.`id`, `gci`.`is_deleted`\n                         FROM `glpi_monitors` as `m`, `glpi_computers_items` as `gci`\n                         WHERE `m`.`id` = `gci`.`items_id`\n                            AND `gci`.`is_dynamic`='1'\n                            AND `computers_id`='{$computers_id}'\n                            AND `itemtype`='Monitor'\n                            AND `m`.`name`='" . $mon["name"] . "'";
                 if (!empty($mon["serial"])) {
                     $query .= " AND `m`.`serial`='" . $mon["serial"] . "'";
                 }
                 $results = $DB->query($query);
                 $id = false;
                 $lock = false;
                 if ($DB->numrows($results) == 1) {
                     $id = $DB->result($results, 0, 'id');
                     $lock = $DB->result($results, 0, 'is_deleted');
                 }
                 if ($id == false) {
                     // Clean monitor object
                     $m->reset();
                     $mon["manufacturers_id"] = Dropdown::importExternal('Manufacturer', $line["MANUFACTURER"]);
                     if ($cfg_ocs["import_monitor_comment"]) {
                         $mon["comment"] = $line["DESCRIPTION"];
                     }
                     $id_monitor = 0;
                     if ($cfg_ocs["import_monitor"] == 1) {
                         //Config says : manage monitors as global
                         //check if monitors already exists in GLPI
                         $mon["is_global"] = 1;
                         $query = "SELECT `id`\n                               FROM `glpi_monitors`\n                               WHERE `name` = '" . $mon["name"] . "'\n                                  AND `is_global` = '1'\n                                  AND `entities_id` = '{$entity}'";
                         $result_search = $DB->query($query);
                         if ($DB->numrows($result_search) > 0) {
                             //Periph is already in GLPI
                             //Do not import anything just get periph ID for link
                             $id_monitor = $DB->result($result_search, 0, "id");
                         } else {
                             $input = $mon;
                             if ($cfg_ocs["states_id_default"] > 0) {
                                 $input["states_id"] = $cfg_ocs["states_id_default"];
                             }
                             $input["entities_id"] = $entity;
                             $id_monitor = $m->add($input);
                         }
                     } else {
                         if ($cfg_ocs["import_monitor"] >= 2) {
                             //Config says : manage monitors as single units
                             //Import all monitors as non global.
                             $mon["is_global"] = 0;
                             // Try to find a monitor with the same serial.
                             if (!empty($mon["serial"])) {
                                 $query = "SELECT `id`\n                                  FROM `glpi_monitors`\n                                  WHERE `serial` LIKE '%" . $mon["serial"] . "%'\n                                     AND `is_global` = '0'\n                                     AND `entities_id` = '{$entity}'";
                                 $result_search = $DB->query($query);
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:ocsserver.class.php


示例18:

<?php

$monitor = Monitor::fetch(intval($_GET['id']));
if (FormHelpers::donePOST()) {
    $monitor->processDelete($_GET);
    ?>
<div class="message">
    The monitor has been deleted. <br />
    <a href="?page=monitors">Return to monitors</a>
</div>
        <?
    }
    else
    {
?>
<div class="form-field">
</div>
<?php 
    FormHelpers::startForm('POST', '?page=monitor-delete&id=' . $monitor->getId());
    FormHelpers::createHidden('confirmed', '1');
    ?>
<center>
    Are you sure you want to delete this monitor?<br />
    <?php 
    FormHelpers::createSubmit('Yes');
    ?>
</center>
<?php 
    FormHelpers::endForm();
}
开发者ID:neopunisher,项目名称:phpWatch,代码行数:30,代码来源:monitor-delete.php


示例19: tracker_monitor

 /**
  * Monitor constructor
  */
 function tracker_monitor($name = '', $monitorId = '', $metadata = '', $store = '')
 {
     parent::Monitor($name, $monitorId, $metadata, $store);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:7,代码来源:tracker_monitor.php


示例20: Monitor

if (empty($_POST["id"])) {
    exit;
}
if (!isset($_REQUEST['glpi_tab'])) {
    exit;
}
if (!isset($_POST["sort"])) {
    $_POST["sort"] = "";
}
if (!isset($_POST["order"])) {
    $_POST["order"] = "";
}
if (!isset($_POST["withtemplate"])) {
    $_POST["withtemplate"] = "";
}
$monitor = new Monitor();
if ($_POST["id"] > 0 && $monitor->can($_POST["id"], 'r')) {
    if (!empty($_POST["withtemplate"])) {
        switch ($_REQUEST['glpi_tab']) {
            case 4:
                Infocom::showForItem($monitor, $_POST["withtemplate"]);
                Contract::showAssociated($monitor, $_POST["withtemplate"]);
                break;
            case 5:
                Document::showAssociated($monitor, $_POST["withtemplate"]);
                break;
            default:
                Plugin::displayAction($monitor, $_REQUEST['glpi_tab'], $_POST["withtemplate"]);
        }
    } else {
        switch ($_REQUEST['glpi_tab']) {
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:monitor.tabs.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP MonologLogger类代码示例发布时间:2022-05-23
下一篇:
PHP MongoDBRef类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap