* Added Zhone health and reduced ports to only physical ports.
* Liniting
* Move MIBs out of folder, doesn't work
* Add testing data.
* Added test data, sorry for delay
* Added test data again
* Move MIBs to folder
* Unsupported dirrective
* Added support for Cambium cnMatrix switches
* Fixed styling issues
* Fixed styling issues
* Fixed duplicate, incorrectly labeled LLDP-EXT-DOT3-MIB and LLDP-EXT-DOT1-MIB
* Corrected MIB with the same name but with different OIDs configured: LLDP-EXT-MED/-CAMBIUM/-MIB
* Removed my added duplicate MIBs
* Removed unused MIBs
* Add support for Trellix NSP devices
- Add discovery for mlos NSP devices
- Monitor port statistics from non standard MIBs
- Add Trellix MIBs
- Add test data
* Fix StyleCI findings
* Rename MIB files to match MIB names, remove unused MIBs
* regenerate mlos-nsp_ns9500.json to account for changes from PR#14963
* Change ESXi port naming to be stable
Currently every time discovery runs against ESXi, the port names change generating a lot of log spam.
This is because ESXi uses this as the ifDescr:
```Device vmnic1000202 at 01:00.0 nmlx4_en```
The poller parses this, and extracts the interface name, whereas discovery does not, causing the interface names to flip every 6 hours.
https://github.com/librenms/librenms/blob/22.10.0/includes/polling/ports.inc.php#L578-L580
This change gives the discovery process the same behaviour, so the naming is now stable.
* Try to fix test data with a squash
* vcsa test data
* Synthesise VCSA ifName, use it in place of ifDescr
* Refresh test data
* Update ports.inc.php
---------
Co-authored-by: Tony Murray <murraytony@gmail.com>
* Added support for Ubiquiti UFiber OLT
* Fixed php files with port detection
* Added missing MIB file
* Fixed test data
* Fixed php script to detect ports compatible with php 8.1
* Fix styleci
* Enforcement of new control styleci
* Apply fixes from StyleCI
* Port detection override
* Changed all "Entry" to "Table".
Co-authored-by: StyleCI Bot <bot@styleci.io>
* Add DBm and State Sensors
Added extra MIB files
Added Dbm levels on ports
Added Stacking State Sensors
* Added include for zynos.inc.php
File patch - includes/discovery/ports/zynos.inc.php
* Create ZYXEL-STACKING-MIB
Official Zyxel MIB
* Create ZYXEL-TRANSCEIVER-MIB
Official Zyxel MIB
* Added test file zynos_xgs4600.json
* Create zynos snmprec test file
* CENSORED zynos_xgs4600.json
* Created new polling file for Zynos ports
Converts zynos SWP port style to be 1/1 style
* Created new discovery for Zynos ports
Changes zynos SWP ports to be 1/1 style during discovery
* Fixing ci complaints in discovery/ports/zynos.inc.php
* Fixing ci complaints in polling/ports/os/zynos.inc.php
* fixing more ci complaints in discovery
* Updated Zynos.snmprec
* Updated zynos.json
* Updated zynos.json
* Removed ifDescr pre-cache
* Removed pre-cache from zynos.yaml
* Reverted zynos.snmprec
* Restored zynos.json
* Updated zynos polling to use zeropad
* Updated zynos discovery to use zeropad
* Updated zynos.yaml
Updated zynos.yaml to include ifname: true to change port names and added '/^ZyXEL/' to sysDescr_regex
* Update zynos.inc.php
* Update zynos.inc.php
* Update zynos_xgs4600.json
* Update zynos_xgs4600.snmprec
* Re-Generated Zynos.json
* Fixed ifOperStatus in Zynos.json
* Delete zynos.inc.php
* Update ports.inc.php
* Added new test data
* Updated zyxel test data and discovery
* Update ports.inc.php
* Update zynos.snmprec
* Updated zynos.json
* Update Zynos.json
* Fix StyleCI issues
* Update zynos.json
* Update zynos.json
* Update zynos.json
* Updated zynos mgs3712.json
* Update zynos_mgs3712.json
* Added back old SFP discovery
-SFP Temperature
-SFP Voltage
* New device:add code
pre-requisite for updating other code paths
includes option to set display name
separate validation code from device creation
* remove duplicate community and v3 creds
* style fixes
* some lint fixes
* fix phpstan
* Exception cleanup
improved messages and translations
* port association mode to enum
well, pseudo enum
* defaults and cleanups
* fixed/improved validation messages
* fix tests
* fix stupid ide refactor mistake
* lint fixes
* Introduce OS flag to support devices that deliver OIDs out of order
* Add MIB for Bintec Be.IP Plus
* Add YAML definitions for Bintec Be.IP Plus
* Add Bintec be.IP plus test files
* Rename bintec mib files
mib-standards.mib was deleted, because it included definitions that also
existed in separate files
* Add test data
* Remove standard mib files from bintec dir
* Add regex to parse Bintec Be.IP Plus OS version
* Update test data for Bintec Be.IP Plus
* Calculate Bintec Be.IP Plus CPU load from inverse of idle time
* Improve Bintec Be.IP Plus discovery and tests
* Use MIB instead of numerical OIDs where possible
* Update tests to comply with updated discovery
* Remove unused MIBs
* Remove json props that let tests fail
* Update Settings.md
* Remove `snmp_out_of_order_oids` definition from bintec-beip-plus
* Add `-Cc` snmp param for prots module
* Add `-Cc` snmp param for arp-table module
* remove snmp_out_of_order_oids
* Remove snmp_out_of_order_oids
* Update snmp.inc.php
Co-authored-by: Tony Murray <murraytony@gmail.com>
* Infer character encoding for ifAlias and sysLocation
Tries to convert character encoding for non-UTF-8 encoded strings.
This will only work for snmp strings that are type-hinted, not ones forced to ASCII with -Oa or similar
Only works for your default charset or Windows-1251 or LATIN1.
You can set your character encoding in .env with CHARSET
Please save us all and just use UTF-8
* style fixes
* less Yoda
* ensure return type
* fall back to passed string
* don't convert strings with any unprintable characters (such as line return)
* Update LibreNMS/Util/StringHelpers.php
Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
* Fix CP850
* fix space
Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
* UBNT AF LTU: Fix incorrect eth0 status during discovery
* UBNT AF LTU: Update test data
* UBNT AF LTU: Remove eth0 if afLTUethConnected is not set
* UBNT AF LTU: Use require instead of require_once
* Add bad_ifoperstatus for filtering interfaces having a status for example notPresent
* Add bad_ifoperstatus for filtering interfaces having a status for example notPresent
* Add bad_ifoperstatus for filtering interfaces having a status for example notPresent
* fix_if_discover
* Update ports.inc.php
* Fixed overwriting IfDescr and IfAlias overwriting
* removed whitespace
* added ifname, ifalias and ifdescr copy if it is emtpy or null
* removed ifAlias from update to prevent overwrite
* removed ifName and ifDescr from update to prevent overwrite
* added is_port_valid before doing copy actions between ifDescr,ifAlias&ifName also added back ifDescr&ifName update
* Update ports.inc.php
* Update functions.php
* Update ports.inc.php
* Update exa_e7-2.json
* Update fortigate.json
* Adding ifType to base_oids
* Improve discovery (update ifType) and polling (save ifType)
* Updated test data
* Updated json test data
* vlan isn't filtered by default :P
* With default ignored ports
* Update newer test data
Use Log facility when Laravel is booted.
Update init.php so we can easily boot Laravel for CLI scripts. (and just Eloquent, but that may go away)
Move all debug setup into set_debug() function and use that across all scripts.
Log Laravel database queries.
Send debug output to librenms log file when enabling debug in the webui.
Allow for colorized Log CLI output. (currently will leave % tags in log file output)
** Needs testing and perhaps tweaking still.
DO NOT DELETE THIS TEXT
#### Please note
> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.
- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)
#### Testers
If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
* refactor: use the Config class includes/discovery
* fix issue with $config variable not accessible in include-dir.inc.php
* improved whitespace
* Tidy up discovery_by_ip
* feature: Added ability to switch port polling mode
* update, speed things up slightly by walking certain tables
* more fixes
* updates
* updates
* update to exclude ports that are down
* wrong variable used
* update to set previous port status when null
* small update to port disco
Use data_update instead of rrd_update/rrd_create and influx_update
Centralize rrd file check so we can check against a remote rrdcached server too
Use rrd_name() to generate rrd file names
While adding configurable port mapping in 2c9df26bbf
I broke the query for known ports from the database so discovery.php considered
ALL ports to be new every time it ran. Whoops.
This went undetected for so long as there is a unique constraint on the ports
table (device_id+ifIndex) which prevented ports from being added again and
again.
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
By default libreNMS used the ifIndex to associate ports just found via SNMP
with ports discoverd/polled before and stored in the database. On Linux boxes
this is a problem as ifIndexes are rather likely to be unstable between reboots
or (re)configuration of tunnel interfaces (think: GRE/OpenVPN/Tinc/...), bridges,
Vlan interfaces, Bonding interfaces, etc.
This patch adds a »port association mode« configuration option per device which
allows to map discovered and known ports by their ifIndex, ifName, ifDescr, or
maybe other means in the future.
The default port association mode still is ifIndex for compatibility reasons.
As port RRD files were stored by their ifIndex before, they are now identified
by their unique and stable port_id to ensure a stable and unique mapping and
allow future port association modes to be added without requireing any further
internal changes. Existing RRD files are renamend accordingly in discovery and
poller tools to ensure stability of port associations in both modules as we
don't know which might run first after an update.
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>