2021-07-10 03:34:01 +08:00
|
|
|
# Interface Description Parsing
|
2019-09-09 05:48:35 -05:00
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
Librenms can interpret, display and group certain additional information on ports.
|
2019-09-09 05:48:35 -05:00
|
|
|
This is done based on the format that the port description is written
|
|
|
|
although it's possible to customise the parser to be specific for your setup.
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2021-07-10 03:34:01 +08:00
|
|
|
## Keywords
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
See [examples](#examples) for formats.
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2019-09-09 05:48:35 -05:00
|
|
|
- **Keywords**
|
|
|
|
- `Cust` - Customer
|
|
|
|
- `Transit` - Transit link
|
|
|
|
- `Peering` - Peering link
|
|
|
|
- `Core` - Infrastructure link (non-customer)
|
|
|
|
- Info-keywords
|
|
|
|
- `()` contains a note
|
|
|
|
- `{}` contains *your* circuit id
|
|
|
|
- `[]` contains the service type or speed
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2021-07-10 03:34:01 +08:00
|
|
|
## Examples
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
Cisco IOS / NXOS / IOSXR:
|
2019-09-09 05:48:35 -05:00
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
```text
|
|
|
|
interface Gi0/1
|
|
|
|
descr Transit: Example Provider (AS65000)
|
|
|
|
interface Gi0/2
|
|
|
|
descr Peering: Peering Exchange
|
|
|
|
interface Gi0/3
|
|
|
|
descr Core: core.router01 FastEthernet0/0 (Telco X CCID023141)
|
|
|
|
interface Gi0/4
|
|
|
|
descr Cust: Example Customer [10Mbit] (T1 Telco Y CCID129031) {EXAMP0001}
|
|
|
|
```
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
Unix / Linux:
|
2019-09-09 05:48:35 -05:00
|
|
|
|
|
|
|
This requires an additional script to be [setup](#setup)
|
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
```text
|
|
|
|
# eth3: Cust: Example Customer [10Mbit] (T1 Telco Y CCID129031) {EXAMP0001}
|
|
|
|
# eth0: Transit: Example Provider (AS65000)
|
|
|
|
# eth1: Core: core.router01 FastEthernet0/0 (Telco X CCID023141)
|
|
|
|
# eth2: Peering: Peering Exchange
|
|
|
|
```
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2021-07-10 03:34:01 +08:00
|
|
|
## Customisation
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
The following config options can be set to enable more custom types:
|
2019-09-09 05:48:35 -05:00
|
|
|
|
2023-05-11 01:05:12 +01:00
|
|
|
!!! setting "webui/port-descr"
|
|
|
|
```bash
|
|
|
|
lnms config:set customers_descr.+ 'cust'
|
|
|
|
lnms config:set transit_descr.+ 'transit'
|
|
|
|
lnms config:set peering_descr.+ 'peering'";'
|
|
|
|
lnms config:set core_descr.+ 'core'
|
|
|
|
lnms config:set custom_descr.+ 'something_made_up'
|
|
|
|
```
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2021-07-10 03:34:01 +08:00
|
|
|
## Custom interface parser
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2017-10-02 21:36:22 +01:00
|
|
|
It's also possible to write your own parser, the existing one is: includes/port-descr-parser.inc.php
|
|
|
|
|
|
|
|
Once you've created your own then you can enable it with:
|
|
|
|
|
|
|
|
```php
|
|
|
|
$config['port_descr_parser'] = "includes/custom/my-port-descr-parser.inc.php";
|
2014-01-19 13:52:34 +01:00
|
|
|
```
|
|
|
|
|
2021-07-10 03:34:01 +08:00
|
|
|
### Setup
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2019-09-09 05:48:35 -05:00
|
|
|
For Unix / Linux based systems, you need to run an additional script
|
2022-07-10 10:46:01 +01:00
|
|
|
to support the parsing of interface information.
|
2014-01-19 13:52:34 +01:00
|
|
|
|
2019-09-09 05:48:35 -05:00
|
|
|
- Add `ifAlias` from `/opt/librenms/scripts/` or download it from
|
|
|
|
[here](https://github.com/librenms/librenms/blob/master/scripts/ifAlias)
|
|
|
|
to the Server and make it executable `chmod +x /path/to/ifAlias`
|
|
|
|
- Add to `snmpd.conf` something like:
|
2017-10-02 21:36:22 +01:00
|
|
|
``pass .1.3.6.1.2.1.31.1.1.1.18 /path/to/ifAlias``
|
2022-10-07 22:10:37 +02:00
|
|
|
- Add aliasses with
|
|
|
|
- `iproute2` package like:
|
|
|
|
``ip link set eth0.427 alias 'Cust: CustomerA'``
|
|
|
|
- in `/etc/network/interfaces` or `/etc/network/interfaces.d/*` with a comment like:
|
|
|
|
``# eth0.427: Cust CustomerA``
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2022-10-07 22:10:37 +02:00
|
|
|
- Restart `snmpd` - `systemctl restart snmpd`
|
2017-10-02 21:36:22 +01:00
|
|
|
|
2022-10-07 22:10:37 +02:00
|
|
|
There are no changes to be made or additions to install for the polling librenms.
|
2021-06-17 03:16:21 +08:00
|
|
|
|
2022-10-07 22:10:37 +02:00
|
|
|
Now you can set up your [keywords](#keywords) in your aliases.
|