Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions docs/config/librenms-portstatus-example.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Example PHP Weathermap config snippets for the LibreNMS port status datasource.
# This is intentionally generic and does not include site-specific nodes or icons.
# Colours/tags are examples only. Change them to match your map style.

WIDTH 800
HEIGHT 500
BGCOLOR 255 255 255
TITLE LibreNMS Port Status Example

# Status scale returned by the datasource:
# 0 = unknown / no match
# 1 = up / clean
# 2 = admin down
# 3 = oper down while admin up
# 4 = up with recent errors
KEYPOS PORTSTATUS 30 430 Port Status
SCALE PORTSTATUS 0 0 128 128 128 grey
SCALE PORTSTATUS 1 1 0 190 0 green
SCALE PORTSTATUS 2 2 255 192 0 amber
SCALE PORTSTATUS 3 3 255 0 0 red
SCALE PORTSTATUS 4 4 255 96 0 orange

# Basic single-port template.
# If you use status-specific icons, you can add something like:
# ICON 24 16 images/port-{node:this:inscaletag}.png
NODE port_status
ZORDER 900
TARGET librenmsportstatus:{node:this:parent_device}:{node:this:ifname}
MAXVALUE 4
USESCALE PORTSTATUS in absolute
INFOURL /graphs/type=port_bits/id={node:this:librenms_port_id}/
OVERLIBGRAPH {node:this:librenms_graph_url_1}
OVERLIBWIDTH 512
OVERLIBHEIGHT 100
OVERLIBCAPTION {node:this:parent_device} {node:this:ifname} - {node:this:librenms_status_name}
NOTES {node:this:parent_device} {node:this:ifname} - {node:this:librenms_status_name} {node:this:librenms_warning_details}

# Multi-interface examples.
# Use the matching template depending on how many graphs you want to show.
# Example: if ifname contains two interfaces, use port_status_multi2.
NODE port_status_multi2
TEMPLATE port_status
OVERLIBGRAPH {node:this:librenms_graph_url_1} {node:this:librenms_graph_url_2}

NODE port_status_multi3
TEMPLATE port_status
OVERLIBGRAPH {node:this:librenms_graph_url_1} {node:this:librenms_graph_url_2} {node:this:librenms_graph_url_3}

NODE port_status_multi4
TEMPLATE port_status
OVERLIBGRAPH {node:this:librenms_graph_url_1} {node:this:librenms_graph_url_2} {node:this:librenms_graph_url_3} {node:this:librenms_graph_url_4}

NODE port_status_multi5
TEMPLATE port_status
OVERLIBGRAPH {node:this:librenms_graph_url_1} {node:this:librenms_graph_url_2} {node:this:librenms_graph_url_3} {node:this:librenms_graph_url_4} {node:this:librenms_graph_url_5}

NODE port_status_multi6
TEMPLATE port_status
OVERLIBGRAPH {node:this:librenms_graph_url_1} {node:this:librenms_graph_url_2} {node:this:librenms_graph_url_3} {node:this:librenms_graph_url_4} {node:this:librenms_graph_url_5} {node:this:librenms_graph_url_6}

NODE port_status_multi7
TEMPLATE port_status
OVERLIBGRAPH {node:this:librenms_graph_url_1} {node:this:librenms_graph_url_2} {node:this:librenms_graph_url_3} {node:this:librenms_graph_url_4} {node:this:librenms_graph_url_5} {node:this:librenms_graph_url_6} {node:this:librenms_graph_url_7}

NODE port_status_multi8
TEMPLATE port_status
OVERLIBGRAPH {node:this:librenms_graph_url_1} {node:this:librenms_graph_url_2} {node:this:librenms_graph_url_3} {node:this:librenms_graph_url_4} {node:this:librenms_graph_url_5} {node:this:librenms_graph_url_6} {node:this:librenms_graph_url_7} {node:this:librenms_graph_url_8}

NODE port_status_multi9
TEMPLATE port_status
OVERLIBGRAPH {node:this:librenms_graph_url_1} {node:this:librenms_graph_url_2} {node:this:librenms_graph_url_3} {node:this:librenms_graph_url_4} {node:this:librenms_graph_url_5} {node:this:librenms_graph_url_6} {node:this:librenms_graph_url_7} {node:this:librenms_graph_url_8} {node:this:librenms_graph_url_9}

NODE port_status_multi10
TEMPLATE port_status
OVERLIBGRAPH {node:this:librenms_graph_url_1} {node:this:librenms_graph_url_2} {node:this:librenms_graph_url_3} {node:this:librenms_graph_url_4} {node:this:librenms_graph_url_5} {node:this:librenms_graph_url_6} {node:this:librenms_graph_url_7} {node:this:librenms_graph_url_8} {node:this:librenms_graph_url_9} {node:this:librenms_graph_url_10}

# Example: single physical port.
NODE example_single_port
TEMPLATE port_status
LABEL switch01 Ethernet1/1
POSITION 120 120
SET parent_device switch01
SET ifname Ethernet1/1

# Example: physical port plus one subinterface.
NODE example_physical_plus_subif
TEMPLATE port_status_multi2
LABEL switch01 Ethernet1/1 + subif
POSITION 120 190
SET parent_device switch01
SET ifname Ethernet1/1,Ethernet1/1.100

# Example: physical port plus several subinterfaces.
NODE example_multi_subifs
TEMPLATE port_status_multi10
LABEL switch01 Ethernet1/2 + subifs
POSITION 120 260
SET parent_device switch01
SET ifname Ethernet1/2,Ethernet1/2.10,Ethernet1/2.20,Ethernet1/2.30,Ethernet1/2.40,Ethernet1/2.50,Ethernet1/2.60,Ethernet1/2.70,Ethernet1/2.80,Ethernet1/2.90
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading