コード例 #1
0
ファイル: resource-monitor.php プロジェクト: kelubo/OpenQRM
                     }
                 }
             }
         }
     }
 }
 // in case the openQRM-server sends its stats we check
 // the states of all resources
 if ("{$resource_id}" == "0" && "{$OPENQRM_SERVER_IP_ADDRESS}" == "{$source_ip}") {
     // $event->log("update_info", $_SERVER['REQUEST_TIME'], 5, "resource-monitor", "Checking states of all resources", "", "", 0, 0, 0);
     $resource->check_all_states();
     // check if there are any image_authentications to manage
     $image_auth = new image_authentication();
     $image_auth->check_all_image_authentication();
     // gather stats
     $datacenter = new datacenter();
     $datacenter->statistics();
     // here a plugin hook for things which needs to be done periodically
     $plugin = new plugin();
     $enabled_plugins = $plugin->enabled();
     foreach ($enabled_plugins as $index => $plugin_name) {
         $plugin_monitor_hook = "{$RootDir}/plugins/{$plugin_name}/openqrm-{$plugin_name}-monitor-hook.php";
         if (file_exists($plugin_monitor_hook)) {
             // $event->log("plugin_monitor_hook", $_SERVER['REQUEST_TIME'], 5, "resource-monitor.php", "Found plugin $plugin_name handling monitor event.", "", "", 0, 0, $resource_id);
             require_once "{$plugin_monitor_hook}";
             $monitor_function = "openqrm_" . "{$plugin_name}" . "_monitor";
             $monitor_function = str_replace("-", "_", $monitor_function);
             $monitor_function();
         }
     }
 }
コード例 #2
0
 function statistics()
 {
     require_once $this->controller->openqrm->get('basedir') . '/web/base/server/aa_server/class/datacenter.class.php';
     $data = new datacenter();
     echo json_encode($data->get());
     exit(0);
 }