Commit Graph

2672 Commits

Author SHA1 Message Date
Peca Nesovanovic
ee00f59ce6 [terra] support for sdi410c / sdi480 (#13759)
* [terra] support for sdi410c / sdi480

* remove debug
2022-02-08 23:27:40 +01:00
Peca Nesovanovic
a3bd1b9a69 [mikrotik] added ipv6 route discovery (#13737)
* [mikrotik] added ipv6 route discovery

* ci
2022-01-31 18:00:30 +01:00
Tony Murray
29bd6789cb Stp module rewrite (#13570)
* STP module rewrite WIP

* Finish rewrite

* Ignore disabled and log root/topology changes

* Remove interfaces for now

* fix style

* Lint fixes

* Document ResolvesPortIds and hide map functions

* whitespace fixes

* Revert to stpInstances in case someone writes mstp support

* missed one

* phpstan fixes

* Handle table and oids separately

* forgot to register observer

* Test data and correct non-table handling in SnmpResponse->table()

* update test

* test data

* revert aos7 silly things

* minimal polling

* Update test data

* order ports_ntp and rename new field to port_index

* forgot the db_schema

* revert ciena-sds port things

* MSTP support, maybe

* Adding test data

* Filter bad lines instead of discarding the entire snmp response
and capture fixes and test data

* fresh data

* add os data

* update data, ignore unfound ports, obviously bad device implementation.

* fixes

* Ignore context files in os detection test

* Remove empty table data

* add ciena-sds vlan

* designatedCost column is too small

* Update stp webui

* Refactor code to interfaces, to allow vendor mibs

* update schema

* fix issues added by abstraction

* STP fixes

* Default to no context for vlan 1

* never store vlan 1

* Update test data

* remove eltex brokenness

* fix style

* fix stan

* Fix Rewrite MAC to Hex padding with floats

* fix sqlite migration
2022-01-30 16:28:18 -06:00
Wheel
2dbfdda717 Ubiquiti Airfiber60 (#13680)
* Add ubiquiti Airfiber 60

* New AF60 data and MIB

* Stylci fix and small additions

* Update test data

* Stylefix

* Remove the weird ubiquity oids containing encoded mac addresses

* Updated test data

* Remove more complex sensors for now to be added after the conflict airos airos-af60 is solved

* Fix hardware and OS

* To be verified is this is the most practical / clean way of doing it

* Advanced wireless and MCS state sensor

* Fix link capacity multiplier and active link

* Test data update fix lint

* Maybe better
2022-01-29 21:10:45 -06:00
Jellyfrog
658fd7972b Fix ups-nut check (#13722)
Fixes #13719
2022-01-28 12:07:34 +01:00
Peca Nesovanovic
fb90b1813f added new sensors to mes23xx (#13671)
* added new sensors to mes23xx

* ci

* copy/paste error

* ci

* cleanup + testdata

* yaml

* yamlnew

* added [no_bulk] for PoE discovery

* fully qualified OID name
2022-01-20 08:41:47 -06:00
ilGino
5bc0da4c97 Small text change for misspelled Virtual (#13686)
Line 24, changed Virutal to Virtual.
2022-01-19 01:06:08 +01:00
TechieDylan
15b0c2d665 changing the version variable for determining device devisor for determining the right mikrotik ups runtime (#13678) 2022-01-16 08:32:54 -06:00
Tony Murray
6aef4a8e62 VRP BGP fixes (#13675)
Fix SQL Invalid parameter number
Fix an undefined variable
2022-01-16 08:32:36 -06:00
Renaud R
ca86a17a12 fix os name on the entry condition (#13578) (#13580) 2022-01-09 18:46:22 -06:00
Anton Lundin
054deb1680 Workaround Linksys/CiscoSB always mapping to g1 (#13595) 2022-01-09 10:37:52 +01:00
Peca Nesovanovic
2d57e49caf Teleste Luminato ports & qam/asi output sensors & yaml (#13616)
* Luminato: bitrate sensor

* bitrate sensor Eloquent

* luminato ports

* luminato ports styleci

* luminato QAM/ASI sensor

* luminato QAM/ASI sensor styleci

* YAML & test

* drop debug $ver from sensor type

* mess with Teleste ifExtPhysInterface/ifExtLogiInterface

* styleci

* test data

* mistake in port discovery

* left out Graphs->Health->Overview->Bitrate label

* fixed Bitrate graph, copy/paste errors
2022-01-08 18:17:08 +01:00
Peca Nesovanovic
528d8e55b4 initial Eltex-mes IPv6 address discovery (#13594)
* initial Eltex-mes IPv6 address discovery

* styleci

* add Eltex-mes devices in group: radlan

* merge two OIDs

* styleci

* ipv6 normalize
2021-12-03 15:48:48 -06:00
Peca Nesovanovic
d4022e2d4e ipv6 discovery switch to new DB syntax (#13591)
* ipv6 discovery switch to Laravel

* styleci

* cleanup

* last dbfetch removed

* styleci & unneeded IF

* switched to updateOrCreate
2021-12-01 22:52:37 -06:00
Peca Nesovanovic
e23ad7947d q-bridge-mib, discover missing VLANs, v2 (#13569)
* q-bridge-mib, discover missing VLANs v2

* copy/paste typo fix

* Use SnmpQuery

* Switch from Vlan_x to VLAN x

* Cleanup
Revert accidental change
Incorrect table depth (even though the outcome is the same)
And test data that was explicitly Vlan_

* fix test data

* update routeros_vlans

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-12-01 07:24:35 -06:00
Peca Nesovanovic
21edc086ca split Eltex-mes OS to mes21xx / mes23xx. + few improvements (#13544)
* split Eltex OS to 21xx and 23xx

* styleci & typo

* yaml cleanup

* removed MIBs from first release

* tidy up yaml

* test data
2021-11-24 21:34:48 +01:00
Martin22
382ef6219b Fix discovery and pooling Racom Ray2 (#13553)
* Fix discovery and pooling

* Added test data

* Removed author

* Fix

* Discovery transcribed into json

* Fix

* Fix2

* Fix3
2021-11-24 18:18:12 +01:00
banachtarski-91
68fa373b77 ios-fdb-table-fix -- Fixed misnamed dictionary keys for dot1dTpFdbPort data (#13559) 2021-11-23 23:50:55 +01:00
Tony Murray
4a5836f64e Catch all module errors (#13542)
* Catch all module errors
As of PHP 7.1, we can now catch errors and exceptions by catching throwable.
Also, log the errors in a consistent way with the entire stack trace

* Log event and improve messages

* call from facade because event might not exist on logger
2021-11-23 09:52:52 +01:00
Tony Murray
c79b187d72 Poller rewrite (Try 2) (#13525)
* core WIP

* try to finish up

* trim space too
and a couple of cleanups

* update test data

* put escapes back

* another net-snmp difference

* correct copy paste error

* WIP

* Use new code YAY

* a tiny bit more

* Kind of working

* Handle manual modules correctly

* convert core to modern module

* Only save metrics if modules is not overridden

* correct module exists check

* database error handling

* debug handling

* restore bad changes

* Introduce Actions
 RunAlertRulesAction
 UpdateDeviceGroupsAction

* tweaks to output

* Fix some issues in outside code

* Style fixes

* fixes to module status checks

* typehints!

* Use logger only and DI

* OS module not named correctly

* Work on quiet output a bit more

* generically don't change output when disabling debug if the driver is already stack

* Fix missing $device variable for legacy os polling
Fix missing dbFacile functions when no legacy modules polled in RunAlertRulesAction

* restore legacy os module shim

* use the new poller code for tests

* PollingDevice event

* Fix some issues and enable/disable error reporting around legacy modules

* typehints

* fully update baseline

* Use Process for version commands so we don't leak debug output.

* don't detect rrdtool version in ci every time

* style fixes

* Warning fixes

* more fixes

* re-update baseline

* remove diff noise

* fix up alerts

* Catch exceptions in device ip lookup

* Revert accidental snmp.inc.php poller target change
(should have been ?: not ??)
2021-11-17 19:23:55 -06:00
Tony Murray
c05a7a57a0 Remove unused buggy arp_discovery code (#13529) 2021-11-17 22:10:54 +01:00
Tony Murray
f8764ddcb5 Revert "Poller command rewrite (#13414)" (#13524)
This reverts commit 1752d1efd4.
2021-11-16 21:40:29 -06:00
Tony Murray
1752d1efd4 Poller command rewrite (#13414)
* core WIP

* try to finish up

* trim space too
and a couple of cleanups

* update test data

* put escapes back

* another net-snmp difference

* correct copy paste error

* WIP

* Use new code YAY

* a tiny bit more

* Kind of working

* Handle manual modules correctly

* convert core to modern module

* Only save metrics if modules is not overridden

* correct module exists check

* database error handling

* debug handling

* restore bad changes

* Introduce Actions
 RunAlertRulesAction
 UpdateDeviceGroupsAction

* tweaks to output

* Fix some issues in outside code

* Style fixes

* fixes to module status checks

* typehints!

* Use logger only and DI

* OS module not named correctly

* Work on quiet output a bit more

* generically don't change output when disabling debug if the driver is already stack

* Fix missing $device variable for legacy os polling
Fix missing dbFacile functions when no legacy modules polled in RunAlertRulesAction

* restore legacy os module shim

* use the new poller code for tests

* PollingDevice event

* Fix some issues and enable/disable error reporting around legacy modules

* typehints

* fully update baseline

* Use Process for version commands so we don't leak debug output.

* don't detect rrdtool version in ci every time

* style fixes

* Warning fixes

* more fixes

* re-update baseline

* remove diff noise

* fix up alerts
2021-11-16 16:59:46 -06:00
Tony Murray
666638eeaa Fix bad snmp context option (#13497)
* Fix bad snmp context option
Just port queries to SnmpQuery and remove bad code to prevent new usages

* Allow unordered

* add stub on Mock
2021-11-12 12:40:37 -06:00
Jonathan Smith
5b7aff1995 Update apc.inc.php (#13506)
Fixed the OID for the non HighPrec Load, which should be 4.2.3.
2021-11-12 10:37:17 -06:00
Peca Nesovanovic
9f2de7d605 Added initial IPv6 Address discovery for TP-LINK Jetstream (#13484)
* Added initial IPv6 Address discovery for TP-LINK Jetstream

* styleci cleanup

* styleci cleanup

* styleci cleanup

* split OS specific code in separate file

* styleci cleanup
2021-11-09 20:40:48 +01:00
Denny Friebe
f23c5c0e7b Raspberry Pi: Add SNMP extend to monitor IO pins or sensor modules connected to the GPIO header (#12749)
* Raspberry Pi: Add SNMP extend to monitor IO pins or sensor modules connected to the GPIO header

* Raspberry Pi: Add new test data

* Raspberry Pi: Make styleci happy

* Raspberry Pi: Fix some more style issues

* Raspberry Pi: Use d_echo for array debug

* Raspberry Pi: Prevent processing if the extension is not present

* Raspberry Pi: Make styleci happy

* Raspberry Pi: Update test data

* Raspberry Pi: Remove debugging
2021-11-04 21:38:15 -05:00
Garcia MICHEL
e0443293a0 Add iDrac physical disk state (#13264)
* Add physical disk for iDrac

* Add alert rule for iDrac Physical Disk

* Add test data
2021-11-02 23:26:59 +01:00
Tony Murray
c572e2828b RouterOS now returns the correct runtime (#13461)
as of version 6.47
2021-11-02 12:23:56 +01:00
David Girón
9f8bb8caae Add more discovery components for Dell PowerConnect 28xx (#13420)
* Add Processor discovery for Dell PowerConnect 28xx

* Add Temperature discovery and cleanup code

* Add test data for PowerConnect 2824

* Add Serial Number

* Don't add VLANs as Ports

* Revert "Don't add VLANs as Ports"

* Remove invalid mempool from tests
2021-10-29 10:09:05 +02:00
Julian Lehrhuber
a3ec263f78 Bintec be.IP plus support (#12993)
* 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>
2021-10-28 13:05:43 -05:00
Peca Nesovanovic
08dd8a07db Mikrotik vlans discovery, v2 (#13427)
* Mikrotik vlans discovery, v2

* styleci cleanup

* added Routeros entry in mkdocs.yml

* fixed typo in mkdocs.yml

* Better Vlan Eloquent Model

* Missed one

* Use new SnmpQuery code

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-26 18:31:44 -05:00
Tony Murray
b0e0d65c86 Fixes for misc unset variables in polling (#13421)
Remove $attribs global
2021-10-25 21:35:18 +02:00
TheGracens
e4d26c0c09 Update apc.inc.php (#13405)
Fixes the wrong temperature multiplier in APC devices . In case high precision is not available and using older APC firmware
2021-10-21 17:08:50 -05:00
Erik
27c124f19f FabOS remove disabled dbm sensors (#12877)
* add check if adminstatus is up

* added testdata

* Changed ifAdminStatus state detection

* updated testdata

* updated testdata2

* Update fabos_6520.json

* Update fabos.json

* Update fabos_6520.json

* Update fabos.json

* fix fabos.json

* fix bug in discovery include

Co-authored-by: Erik <johndoe@example.com>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-20 18:51:49 -05:00
Tony Murray
f94f7f23b8 Fully convert core to a modern module (#13347)
* Core module WIP

* update OS::make()

* core WIP

* try to finish up

* switch all core do os Model

* Mock WIP

* Working tests

* cleanup

* phpstan fixes

* style fixes

* fix agent

* trim space too
and a couple of cleanups

* corrected ios test data

* missed space

* update test data

* put escapes back

* another net-snmp difference

* Fix class description

* revert snmp.inc.php change, that can be a different PR

* revert snmp.inc.php change, that can be a different PR
2021-10-19 15:43:43 -05:00
Kate Robinson
568d12cbd8 Modified SQL delete statement for vrf is null (#13199)
* Modified SQL delete for is NULL instead of = null

* Fixed spacing

* Fixed more spacing issues

* Replaced double quotes with single quotes for echo statement

* Fixed more spacing issues

* Modified null vrf db check to match vrp.inc.php

* Clean up comments

* Modified git username to fix CLA

* Revert bgp-peers.inc.php

Co-authored-by: Kate Robinson <katerobinson@KateRobinson-imac.local>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-19 06:54:34 -05:00
Cirno the Strongest
ece914a06d Use high precision OIDs for APC UPS sensors (#12594)
* Use high precision OIDs for APC UPS sensors

* Force test re-run

* Remove ifHighSpeed

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-18 19:41:37 -05:00
Simon Smith
81819c2aca fix windows fanspeed (#13376) 2021-10-18 23:38:57 +02:00
Tony Murray
4bab6d7ed2 Remove load_os and load_discovery functions (#13345)
* Remove load_os and load_discovery functions
Put bits where they belong and use $os

* remove extra line return

* OS loading code in the wrong place

* fixes

* line
2021-10-08 14:04:11 -05:00
Tony Murray
8d5bc3fc41 Use Measurements for all statistic collection (#13333)
* Use Measurements for all statistic collection

* fix space

* Use colors
cleanup

* fix style

* manually fix license notice

* add return times and new line

* add return times and new line

* fix mistake in copyright template

* fix style
2021-10-06 17:09:54 -05:00
Tony Murray
aa35d2f0c0 Connectivity Helper to check and record device reachability (#13315)
* Fping WIP

* Update availability, move ping rrd update in the same place as db update.

* move classes around

* make device:ping command work

* use new code, remove legacy code

* save metrics boolean prevents all saves
style fixes

* update device array

* style fixes

* Update unit test

* fix whitespace

* Fix Fping stub

* fix backwards if

* fix phpstan complaining

* Fix return type

* add fillable to DeviceOutage model.

* device_outage migration to add id...

* missed line in db_schema.yaml

* 1 billion more comments on the brain damage up/down code

* tests for status and status_reason fields

* fix style again :D

* Duplicate legacy isSNMPable() functionality
but with only one snmp call ever 😎

* Remove unused variable

* fix migrations for sqlite
2021-10-03 22:45:10 -05:00
Tony Murray
b2ac547abb Quick fix for route discovery on PHP8 (#13284) 2021-09-28 16:22:17 +02:00
Tony Murray
8a883140cb Infer character encoding for ifAlias and sysLocation (#13248)
* 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>
2021-09-21 08:47:44 -05:00
Kevin Zink
c984cdbebc MegaRaid controller in Linux (Broadcom/LSI) (#12999)
* Add power consumed

* Revert "Add power consumed"

This reverts commit 424554ac04bd340de2fd962cb6808045024ef783.

* Start with tempsensorts aus some states

* Inventory data

* Convert plugins to Blade

* Revert "Convert plugins to Blade"

This reverts commit 8d1d3ff5b1.

* fix style

* Add FANs and Powersupplies

* fix style

* add test data

* add a short description for the doc

* refresh Testfile
2021-09-19 18:31:23 -05:00
Tony Murray
117036bf29 Fix Dell server sensors (#13247)
missing mib directory
2021-09-16 21:05:31 +02:00
Jellyfrog
258505ed44 Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Jellyfrog
26b95c0ccc Apply fixes from StyleCI (#13208) 2021-09-08 23:35:56 +02:00
Tony Murray
d496c228d4 Discovery: mark snmp disabled devices as skipped (#13202) 2021-09-08 18:15:08 +02:00
PipoCanaja
05ce3d1858 Allow more compatibility in STP port discovery/polling (#13109)
* allow more variety in STP port discovery/polling

* style
2021-09-08 08:57:22 -05:00