PHP code example of libremap / librenms-plugin
1. Go to this page and download the library: Download libremap/librenms-plugin 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/ */
libremap / librenms-plugin example snippets
return [
'prefixes' => ['hk-'],
'stale_after' => 900,
// Device ID => ['role' => 'AGG'|'ER'|'OTHER', 'site' => 'rossa1'].
'overrides' => [
42 => ['role' => 'AGG', 'site' => 'rossa1'],
],
// Fail explicitly instead of displaying a silently truncated topology.
'max_devices' => 2000,
'max_links' => 10000,
];
'world_bounds' => ['south' => 57.8, 'west' => 4.3, 'north' => 71.3, 'east' => 31.3], // or null
'world_outline' => 'norway', // follow Norway's outline inside the box; null for the box alone
'world_tiles' => 'https://tiles.example.net/{z}/{x}/{y}.png', // {s} becomes a, b or c
'world_attribution' => '© OpenStreetMap contributors',
'world_max_zoom' => 18,
'weather_warnings' => true,
'weather_lang' => 'en', // or 'no'
'weather_contact' => '[email protected] ', // email address or URL
sh
composer config repositories.libremap path /opt/libremap
composer emap-assets --force
php artisan vendor:publish --tag=libremap-config
php artisan migrate --path=/opt/libremap/database/migrations --realpath
sh
php artisan optimize:clear
sh
php artisan route:cache
DBTEST=1 vendor/bin/phpunit /opt/libremap/tests/Host/CachedRoutesIntegrationTest.php
php artisan route:clear
sh
composer remove libremap/librenms-plugin
composer config --unset repositories.libremap
php artisan optimize:clear