Download the PHP package libremap/librenms-plugin without Composer

On this page you can find all versions of the php package libremap/librenms-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package librenms-plugin

LibreMap

An AGG-first topology map for LibreNMS, with a permission-scoped live data endpoint, private saved views, and a runnable interactive demo.

See VERIFICATION.md for execution evidence and limitations.

Requirements

Component Requirement
Node.js 20.19+ or 22.12+ (build tooling only; not needed on the LibreNMS host)
PHP 8.2+
Laravel 12.x, as shipped with the LibreNMS host
LibreNMS A release providing the plugin system's PluginManagerInterface and MenuEntryHook

The host CI targets LibreNMS 26.7.0 and 26.8.0 on PHP 8.4, with MySQL 8.0 and MariaDB 11.7. Port status handling accepts both enum casts and older string attributes. The host workflow passes on all four combinations.

Run the demo

Open http://127.0.0.1:5173. The demo is explicitly labeled and uses illustrative data. Production pages never fall back to demo data on errors.

Implemented

Build assets

Keep the entire dist/ directory, including dist/assets/, alongside the PHP package. The ELK layout worker is a separate local asset. No CDN, API token, or additional polling service is needed.

dist/ is committed so Composer installations include the assets. Rebuild it whenever frontend source changes; CI checks that the shipped bundle matches the source.

Install on a LibreNMS staging host

These are staging instructions, not evidence of an installation.

From Packagist

Packagist with lnms plugin:add, replaces previously published assets, publishes default config, runs this package's migrations, enables the plugin and clears caches. Run it on the LibreNMS host as the application user:

Rerun it to upgrade. Use --dir for a LibreNMS checkout outside /opt/librenms, or --version to install a specific release. An existing config/libremap.php is kept. If a source install left a repositories.libremap path entry, the script removes it, because Composer would otherwise keep resolving the package from that path. The script requires LibreNMS with lnms plugin:add.

From source

1. Build, then copy. Run npm run build locally and copy this project, including the built dist/, to /opt/libremap on the LibreNMS host.

2. Register the package. Run these commands as the LibreNMS application user from /opt/librenms:

These alter the host Composer configuration and lockfile; retain those changes through your normal upgrade process. Removing public/vendor/libremap first drops the previous build's hashed worker file, which vendor:publish would otherwise leave behind.

3. Enable, then clear caches. Enable libremap in LibreNMS plugin administration, then run:

4. Open the map. Click Maps → Topology Map in the LibreNMS navigation bar (also listed under Plugins), or go to /libremap under the instance's base URL.

Navigation bar

LibreNMS offers plugins no hook inside the Maps dropdown, but its navigation bar includes one optional menu.custom view. While libremap is enabled, the package supplies that view and uses JavaScript to add Topology Map, World Map and Custom Maps to the existing Maps dropdown. Each LibreMap page also links to the others from its header. A host's own resources/views/menu/custom.blade.php keeps working: LibreMap also renders it. As with routes, clear caches after enabling or disabling the plugin.

Route cache

Clear the route cache whenever you enable or disable the plugin. The provider registers this package's routes only while libremap is enabled, and Laravel skips that registration entirely when routes are cached, which php artisan optimize and route:cache do. Enabling libremap on a host with a warm route cache leaves /libremap returning 404 until php artisan optimize:clear (or route:clear) runs. Disabling needs no clear: the request middleware still returns 404 for routes served from cache.

Database migration

The migrations add libremap_views, libremap_view_owners and libremap_custom_maps; they do not change LibreNMS topology tables. The owner table supplies one stable lock row per owner so simultaneous creates cannot bypass the 50-view cap, including the first create. Rows remain after deleting the last view. The explicit --path runs only this package's migrations on an existing LibreNMS database. These options are supported by Laravel's migration command. Apply it through your usual staging/deployment process. If a required table is absent, the affected saved-view operation reports an error while the topology map remains available.

No migration has been run on your LibreNMS server from this workspace.

Updating an existing installation

For a Packagist install, rerun scripts/install.sh. For a source install, rebuild the assets, remove public/vendor/libremap, republish them with php artisan vendor:publish --tag=libremap-assets --force, apply any new plugin migration, and clear application caches. The map page adds the published bundle's modification time to its asset URLs, so browsers load the new build instead of a cached one.

Custom maps require the libremap_custom_maps migration; until it runs, the Custom Maps page reports that an administrator must run it, and the topology map is unaffected.

This update requires the new owner-lock migration before creating saved views. From the LibreNMS checkout, run php artisan migrate --path=/opt/libremap/database/migrations --realpath. Existing saved views are preserved; owner rows are created on demand.

Saved views and pins

Select a Device group to focus on a LibreNMS device group the signed-in user may view, or select an AGG root to focus its discovered site branch. Device-group, AGG-root, site, search and backbone filters intersect; search context does not bypass them. Devices not classified as AGG or ER are hidden initially. Show other devices reveals them without escaping the selected device group, AGG branch, or active site/search filters. Click a device and choose Pin position to preserve its current coordinates. Re-layout moves unpinned devices only.

Use Save view to create a named workspace or update the selected view. Save as new makes a separate copy. Views are private to their owner, including when another user is an administrator, and are deleted with the owner's LibreNMS account. A user can store up to 50 views, each with at most 2,000 positions, or max_devices positions when that is higher. Saved views contain device IDs and display preferences, not copied device records or traffic history. Reads redact device references that the owner can no longer access; writes reject unavailable device IDs.

Names support 100 Unicode characters; site and search filters support 200. Listing views resolves device access once for the union of referenced IDs, then redacts each view independently.

When another tab has changed a view, the save/delete operation returns a conflict. Reload views loads the current revision and applies its saved state. Browser workspace autosave remains separate from explicit named saves, and is never overwritten while no topology is loaded. Existing position-only browser data is read on first load of this version.

Configuration

Published config/libremap.php supports prefixes, freshness cutoff, size limits, and explicit classification overrides. No hostname prefix is stripped by default; this example strips hk-:

The default role rule requires a site ending in a digit before agg or er, preventing server01 from being classified as ER. When the hostname does not match, as for devices added by IP address, the device's sysName is tried next. Map labels use the device's LibreNMS display name; when that resolves to an IP address and a sysName is known, the sysName is shown instead. Search also matches the hostname and sysName. Use overrides for other conventions. Config entries of the wrong type are ignored rather than failing the map. Names classify placement only; links come from active LibreNMS neighbor records whose remote device LibreNMS has identified. When it identified the neighbor device but not its port, as often happens with LLDP neighbors that report a description or MAC address as their port, the link is still shown with the port name the neighbor reported, marked as unmatched; a record from the other end that resolves the same cable takes its place. Neighbors LibreNMS has not matched to a device, and unauthorized endpoints, are omitted. LAG grouping, discovery-history retention and manual links are planned.

Exceeding max_devices or max_links returns an error rather than a partial graph. The role-visibility toggle is a display filter and does not weaken these server-side safety limits. A host with 2,048 authorized devices must set max_devices above that count (for example, 3000) in /opt/librenms/config/libremap.php, then run php artisan optimize:clear as the LibreNMS application user.

Measurement and display

Unknown speeds and missing rates display N/A. A port shut down administratively at either end displays DISABLED rather than DOWN, so intentional shutdowns are not mistaken for faults. Stale data displays STALE; staleness is judged on the server's clock, so a skewed browser clock does not change it. Bandwidth is measured at a deterministic endpoint and not added to the other endpoint's observation. Device root placement does not imply an active routing path.

Verification commands

Browser tests include the built production bundle, so build first. An existing Chromium can be selected with CHROMIUM_PATH instead of downloading one. PHP parsing is a syntax check, not a replacement for executing the plugin in LibreNMS.

Tests in tests/Host/ are intended to run with the LibreNMS PHPUnit bootstrap and a disposable test database, after installing the package and running its migration in that test environment. From the LibreNMS checkout:

PHPUnit loads these files by path, so no additional autoload wiring is required on the host. Do not point the host test environment at a production database. They run in the host CI workflow; they have not been executed locally.

The concurrency test requires Linux PHP with pcntl and posix, and MySQL/MariaDB. It uses committed transactions on separate connections under both REPEATABLE READ and READ COMMITTED, including deliberately held owner locks. The CI workflow requires this coverage to run rather than be skipped.

Run cached-route coverage separately in the same disposable environment, with libremap enabled and DB_CONNECTION=testing plus the DB_TEST_* connection settings exported:

Frontend CI runs domain tests, type checking, the build, PHP syntax parsing and Chromium regressions.

World map

Maps → World Map (/libremap/world) places devices at the coordinates of their LibreNMS location. Each marker is one location, sized by its number of devices and coloured by the worst device status there; locations with a down device pulse. Lines are the discovered links between locations, coloured like the topology map by their busiest link, and dashed red when a link is down. Click a location for its devices and connected locations, a device for its details and LibreNMS link, or a line for each link's interfaces and its load in each direction: a bar, the percentage and the rate against the interface speed, when LibreNMS last measured it, and a folded one-day traffic graph that loads only when opened. A link between two devices at the same location, or to a device without coordinates, cannot be a line: the details panel counts these, and each location lists its internal links.

Coordinates come from LibreNMS locations: set them on the Locations page or let LibreNMS geocode the location text. The map stays on mainland Norway: any place in Norway, the outermost coast included, can be centred, and the view can go a margin beyond the coast (a fifth of the map's height) or a location, but not out over the open sea or Sweden that Norway's bounding box also covers; and zooming out stops where all of Norway is in view; and Fit uses only locations inside it, or shows all of Norway when there are none. A device whose location lies outside (usually a wrong coordinate or geocode) is not placed; it is counted as Outside map area and listed in the details panel so the location can be corrected. Set world_bounds to another box, or to null for the whole world:

As in LibreNMS, a location whose latitude or longitude is zero counts as not placed. Devices without coordinates are listed in the details panel. The server sends only locations of devices the signed-in user may view.

Map tiles follow LibreNMS's own world map (leaflet.tile_url, OpenStreetMap by default), so the browser loads tiles from that server as LibreNMS does. Override them in config/libremap.php, or set world_tiles to '' for no tiles; devices then show on a plain background:

Weather warnings come from MET Norway's MetAlerts API and cover Norway and its waters. The LibreNMS server fetches them, never the browser, so the server needs outbound HTTPS to api.met.no. Responses are cached for five minutes, as MET asks, and if MET is unreachable the last copy (up to six hours old) is shown with a notice. Requests identify LibreMap in their User-Agent; MET's terms ask for a way to contact the operator, which weather_contact adds. Warning texts follow weather_lang, and weather_warnings => false removes the toggle and the endpoint:

Power outages (DRIFT)

Power outages come from DRIFT's power-outage API. Set two values in the LibreNMS host's .env (/opt/librenms/.env), then run php artisan config:clear (or optimize:clear):

Setting Meaning
DRIFT_POWER_API_URL DRIFT's power-outage API base URL, ending in /api/power-outages. Without it the toggle and the /libremap/power/* endpoints are removed.
DRIFT_API_TOKEN A DRIFT API token, sent as Authorization: Bearer …. Keep it in .env or your secrets store. Never put it in config/libremap.php or commit it.

The LibreNMS server calls DRIFT, never the browser, so it needs network access to the DRIFT host. The token stays on the server: it is not sent to browsers or put in the page, and it is not logged or used in cache keys. Browsers call LibreMap's own /libremap/power/outages, /libremap/power/outage-at and /libremap/power/health.

DRIFT reads the operators' maps every five minutes. LibreMap caches each answer for 60 seconds and the world map refreshes outages every five minutes. Requests time out after 30 seconds. A network error or a 503 is retried once; a 400 or 401 is not. Errors are explicit:

Custom maps

Maps → Custom Maps (/libremap/custom) lets each user draw their own maps next to the discovered topology. Choose New map, then Edit:

Drawn lines are your annotation. They never join the discovered topology, its tiers or its focus filters.

Maps are private until their owner selects Share read-only. A shared map appears under Shared with me for every signed-in LibreNMS user and can be opened directly with the page address (?map=<id>). Only the owner can edit, rename, unshare or delete it, including when another user is an administrator. Each reader sees only the devices and interfaces they may view: other devices, the lines ending on them, and interface bindings they cannot access are removed by the server before the map is sent. Area and text labels are shown to every reader, so do not put information in them that some readers should not see.

A user can own up to 50 maps, each with up to 500 devices, 2,000 lines and 200 areas or text labels. Writes reject devices the owner cannot view, and interfaces that are unavailable or do not belong to one end of their line. Saves are revision-checked: a map changed in another session returns a conflict instead of being overwritten. Open maps refresh live data every 60 seconds without disturbing edits in progress. Maps are deleted with their owner's LibreNMS account.

Uninstall

Disable libremap in plugin administration, then remove the package and its repository entry as the LibreNMS application user from /opt/librenms:

For an install made with scripts/install.sh, run ./lnms plugin:remove libremap/librenms-plugin instead of composer remove; it also drops the package from composer.plugins.json, and no repository entry needs unsetting. Then clear caches with php artisan optimize:clear.

Published files are left in place and can be removed separately after reviewing their paths: assets at public/vendor/libremap/ and config at config/libremap.php.

The libremap_views, libremap_view_owners and libremap_custom_maps tables are retained by package removal. Removing them or rolling back their migrations deletes saved workspaces and custom maps, and should be a deliberate database maintenance action.


All versions of librenms-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/database Version ^12.0
illuminate/http Version ^12.0
illuminate/routing Version ^12.0
illuminate/support Version ^12.0
illuminate/validation Version ^12.0
illuminate/view Version ^12.0
symfony/http-foundation Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package libremap/librenms-plugin contains the following files

Loading the files please wait ...