1. Go to this page and download the library: Download yidas/mtr-database library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
...
'general' => [
'mtrCmd' => 'mtr',
'timezone' => 'Asia/Taipei',
'category' => 'agent-01', // Category mark for distinguishing
],
'mtr' => [
'host' => 'your.host',
'period' => 10, // Minute
'count' => 60, // Report-cycles
'tcp' => false, // TCP mode
'port' => 443, // Port number for TCP mode
],
'api' => [
'key' => '', // API key must be the same bewteen agent and collector
'agent' => [
'enabled' => false, // To send MTR data to collector via API Agent (deafult is database)
'reportUrl' => '', // Collector's API URL
],
'collector' => [
'enabled' => false, // To receive MTR data from agent via API
],
],
...
'api' => [
'key' => 'your-own-api-key', // API key must be the same bewteen agent and collector
'agent' => [
'enabled' => false, // To send MTR data to collector via API Agent (deafult is database)
'reportUrl' => '', // Collector's API URL
],
'collector' => [
'enabled' => true, // To receive MTR data from agent via API
],
],
'database' => [
'api' => [
'key' => 'your-own-api-key', // API key must be the same bewteen agent and collector
'agent' => [
'enabled' => true, // To send MTR data to collector via API Agent (deafult is database)
'reportUrl' => 'https://your.host/mtr-database/collect.php', // Collector's API URL
],
'collector' => [
'enabled' => false, // To receive MTR data from agent via API
],
],