16839 Commits

Author SHA1 Message Date
c8fab3a13f Add alert_rule filtering to API ROUTE "list_alerts" (#11109)
* Add alert_rule filtering to API ROUTE "list_alerts"

* move alert_rule filter before "order by"

* $_GET to $request->get

* spacing

* multiple empty-lines
2020-02-11 19:04:55 +01:00
6fe840dc8d Added steps to split DB off to its own server (#11130)
I struggled to get this working, so thought I would add my steps to the FAQ to help future users. Thanks to @murrant for the step about the .env file, that was the last piece of the puzzle.

Co-authored-by: Hans Erasmus <erasmushans27@gmail.com>
2020-02-11 15:49:16 +01:00
19a82e1500 Fix inventory page hostname/sysname and default generate_device_link behaviour (#11114)
* Fix inventory page hostname and default behaviour on generate_device_link
* force test re-run
* space
* simplify

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2020-02-10 12:07:27 +01:00
c2dfe7b21c Renovated Alert Rules (#11115)
* Change select order from id to name

* added example icmp/snmp down rules given by @kkrumm1

* Renovated Alert Rules

* Defaulted sort by name
* Moved top buttons and results selector outside of table and aligned them with pull-left and pull-right
* Collapsed '#' (ID) into 'Type' and added titles for the icons
* Added Devices and Transports columns for each rule
* Moved Extra column next to transports
* Added icons for Enabled when a user does not have global admin
* Changed row_# variable to rule_id_#
* Some 'else' cleanup
* Added various title tags for more information when hovering
* Moved pagination outside of table and align it with pull-left and added a bootgrid style summary pulled-right
* Added table & th tags for bootgrid (but didn't turn it on)

* code climate, round 1

* code climate, round 2

* add hrefs for device & device group edit

* added trailing slash for device-groups/../edit/

* prevent #name conflict with transport modal

* add hrefs for transport & transport group edit

* use popover consistently

* code climate, round 3

* removed unused variables

* code climate, round 4

* popover variables

* reload after successful delete

* more informative feedback

* use toastr, not #message, & don't reload

* added license header & fail faster if not admin

* use (more informative) ajax error message

* delete confirmation with alert name in the modal

* print each device per line

* add href for all devices

* refresh status & enabled data-content when/if a rule is turned on/off

* use DRY style per @SourceDoctor (& my) preference); codeclimate meh

* point devices popover to the right
2020-02-10 02:06:12 +01:00
06b9ace0fb device: Correct ups-nut sensors (#11113)
* Change ups-nut sensors
* Revert the dd-wrt files
2020-02-09 20:47:03 +01:00
63b812356d GitHub - Add the ScreenShot hint in the PR Template (#11119)
* GitHub - Add the ScreenShot hint in the PR Template

* revert the version

checking if the tests are now running correctly without this version constraints
2020-02-09 19:29:15 +01:00
083afd1422 device: Add serial number to Epson printer (#11111)
* Add serial to Epson printer
* add Testdata
2020-02-09 18:28:44 +01:00
81454ee585 Fix documentation build (#11116)
* Add "markdown<3.2" to deploy-docs.sh

* pymdown-extensions<6.3
2020-02-09 15:54:06 +01:00
ffddfd0901 mark assigned default poller group (#11112) 2020-02-09 15:44:08 +01:00
385f5e0bc1 device: Support for Teldat routers (#11118)
* teldat base

* HW and version

* tests

* typo

* typo
2020-02-09 15:28:15 +01:00
fda335d7ec If device_perf is inserted and the ping was successful then update the devices last_ping timestamp (#11117) 2020-02-09 08:19:30 -06:00
f8ce4df0f8 Add Janitza Power Sensors (#11110)
* Add Janitza Power Sensors

* Fix testdata from previos bug
2020-02-07 09:11:46 +01:00
6285caba52 Hide devices added for devices that existed before #11104 (#11107)
* Migrate devices.inserted to allow null values and set existng row values to null

* Hide Device Added for devices that existed before https://github.com/librenms/librenms/pull/11104

* Don't display any date that stats with a zero

* make schema match migration
2020-02-06 05:44:04 -06:00
c380921d4b Speed up canAccessDevice/devicesForUser (#10992)
Relying on filtering on user_id/device_id with laravel/arrays is slow.
By splitting the cache on user_id, we can utilize faster array functions
2020-02-05 18:00:08 -06:00
bf3522614c Add a space for times like '1 minute' (#11105)
* Add a space for short times like '1 minute'

* codeclimate, round 1
2020-02-05 17:58:52 -06:00
b2d660efd8 Adding support for Cisco SB SX550X-24F switch (#11098)
* Adding support for Cisco SB SX550X-24F switch

This pull request adds support for Cisco Small Business SX550X-24F switch by adding sysObjectID .1.3.6.1.4.1.9.6.1.1001 in the ciscosb discovery module.

* Added ciscosb_sx550x-24f.snmprec file

* Added ciscosb_sx550x-24f.json

* Updated ciscosb_sx550x-24f.json

* update ciscosb_sx550x-24f.snmprec

* Collected new ciscosb_sx550x-24f.snmprec file

* updated test data
2020-02-06 00:35:21 +01:00
9dc404c194 Add Serialnumber to HP and Konica printers (#11106) 2020-02-05 23:47:06 +01:00
79bdbe91b5 Show when a device was added and last discovered (#11104)
* Add inserted column to devices table

* Added schema for devices.inserted

* Show when a device was added and last discovered

* Added collection rule for "Device added within the last 60 minutes"
2020-02-05 14:06:43 -06:00
ac84eea243 MPLS Route discovery - Wrong variable assignation order (#11103)
Interfaces are not discovered for MPLS routes because of wrong order in the commands (read before variable being initilized)
2020-02-05 18:26:42 +01:00
4e18e8b5c1 Added rittal-cmc (LCP Plus) (#11091)
* Added rittal-cmc (LCP Plus)

skip_values opperand 'not_in_array' returns an error in pre-commit but in principal it's running. Can someone help?

1) LibreNMS\Tests\YamlTest::testDiscoveryDefinitionSchema
rittal-cmc.yaml does not validate. Violations:
[modules.sensors.fanspeed.data[0].skip_values[0].value] Array value found, but an integer or a string is required
[modules.sensors.temperature.data[0].skip_values[0].value] Array value found, but an integer or a string is required
[modules.sensors.temperature.data[1].skip_values[0].value] Array value found, but an integer or a string is required
[modules.sensors.temperature.data[2].skip_values[0].value] Array value found, but an integer or a string is required
[modules.sensors.temperature.data[3].skip_values[0].value] Array value found, but an integer or a string is required

* fix  Scrutinizer Inspection

* fix  codeclimate

* fix typo

* Update discovery_schema.json

To allow arrays in comparisons

* Control structures

* fix the pre-fix issues

* Typo in copy/paste

* Update rittal-cmc.json

* Unit1,2,3,4 and new snmprec, json have not changed

* Update rittal-cmc.json

Correct JSON data

* typo copy paste

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2020-02-05 13:23:54 +01:00
6e9329b4a9 Change log for 1.60 Release (#11099) 1.60 2020-02-04 10:29:59 +00:00
02bc15c206 Asterisk app: add IAX2 peer graphs (#11078)
* Asterisk app: add IAX2 peer graphs

* It's an entirely new graph and will not break existing graphs.
* The asterisk extend script must be updated to provide the appropriate poller data.
* The PR for librenms-agent/snmp/asterisk is here: https://github.com/librenms/librenms-agent/pull/274

* code climate, round 1

* clarified unit text

* code climate, round 2

* changes needed to properly generate test data

* linux_asterisk-v1 test data
2020-02-03 18:47:27 +01:00
051ca6503f Remove also associations on scheduled maintenance deletion (#11093) 2020-02-03 11:26:44 -06:00
6d9deedcc1 Maintenance Mode for a complete Location (#11089)
* Maintenance mode for a complete location

* updatedatabase query

* updatedatabase query

* add missing select
2020-02-03 11:26:08 -06:00
07f3c91e6c Revert ironware BGP-peers changes from PR #10941 (#11096)
* Revert ironware BGP-peers changes from PR #10941.

* Regenerate test data without BGP4V2-MIB support.

* Initialise $local_ip

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2020-02-03 14:32:45 +01:00
c07678d55f Mark Devices in Maintenance Mode (#11092)
* Mark Devices in Maintenance Mode

* code climate fix
2020-02-02 08:33:01 -06:00
ee72fa4d3c Added WUT Humidity and Temperature Sensors (#11053)
* Added WUT 57606,57613,57720

* Added os wut-*

* fixed MIB Names and try to generalize wut

* more general sysObjectID mapping, and mib directory

* Delete WUT-57606-MIB

* Delete WUT-57613-MIB

* Delete WUT-57720-MIB

* Rename wut-57613.snmprec to wut_57613.snmprec

* Rename wut-57720.snmprec to wut_57720.snmprec

* Rename wut-57606.snmprec to wut_57606.snmprec

* Delete wut-57606.yaml

* Delete wut-57720.yaml

* Delete wut-57613.yaml

* Delete wut-57606.yaml

* Delete wut-57720.yaml

* Delete wut-57613.yaml

* Update wut.yaml

* Try to correct the Temperature part

This should work for temperature, according to MIB. Pressure and Humidity are not described in this mibfile, so we cannot poll them.

* change wut.yaml

* Add and fix wut_57720

* after ./scripts/save-test-data.php ?

* Add test data

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2020-02-01 23:29:05 +01:00
a64bd45dbc Update IronWare sensors & bgp-peers discovery, allow skip_values to target a specific index appended to the OID (#10941)
* Migrate ironware sensor discovery from php to yaml.

* More sensors, add grouping.

* dynamic_discovery_get_value() becomes getValueFromData()

* Target a specific index with skip_values.

* Improve Brocade BGP session discovery/polling

This commit allows for the correct discovery of BGP sessions
with 32-bit ASNs, IPv6 neighbors using the BGP4V2-MIB which is
based on draft-ietf-idr-bgp4-mibv2-11 and also polls for IPv4
unicast received routes through the FOUNDRY-SN-BGP4-GROUP-MIB.

Copied most of the code from PR#8877 by @Mikeburke14, cleaned
up the code a little bit to match the normal LibreNMS style,
and fixed bgpPeers_cbgp discovery as well as polling for the
ipv4.unicast neighbors.

Note that older Brocade IronWare firmware versions are known
to have multiple defects relating to the BGP4V2-MIB which
might result in certain missing non-established neighbors.

Related vendor defect numbers:

- DEFECT000633962
-- Symptom: The OID bgp4V2PeerAdminStatus does not return the
            correct value
-- Reported: NI 05.7.00
-- Resolved: NI 05.8.00g

- DEFECT000583319
-- Symptom: SNMP polling on bgp4V2PeerTable (OID brcdIp.3.5.1.1.2)
            does not display all the BGP entries
-- Reported: NI 05.6.00
-- Resolved: NI 05.8.00e

- DEFECT000550309
-- Symptom: SNMP polling on bgp4V2PeerTable (OID brcdIp.3.5.1.1.2)
            does not display the full information
-- Reported: NI 05.7.00
-- Resolved: NI 05.8.00c

* Add ironware CER & ICX platform test data.

* Re-add ironware.json compatible with current master branch.
2020-02-01 23:28:03 +01:00
398d5fe2b7 Fixed missing PoE graphs for Cisco devices (#11087)
* Fixed missing PoE graphs for Cisco devices where portIfIndex can't be retrieved from CISCO-STACK-MIB

* Codeclimate & Travis error corrections

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2020-02-01 11:01:36 +01:00
36388e25ea Show Alert Detail for Applications (#11088)
* alert detail for applications

* add link on alert application
2020-01-31 17:59:56 -06:00
1535d6589d mock.snmp.inc.php: Fix snmptranslate exception (#11085)
* Running ./scripts/pre-commit.php -p -u [-m applications] fails all tests that have 1.3.6.1.4.1.8072 with messages similar to ...

Exception: Could not translate oid: NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."distro"
Tried: snmptranslate -IR -On NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."distro" -M /opt/librenms/mibs

* OIDs with double quotes must be single quoted.  All OID translations work with single quotes, regardless.
2020-01-31 15:07:45 +01:00
d893acccda remove redundant information from alert fallback detail (#11081) 2020-01-31 05:42:46 -06:00
f0cdf7314b Don't dnslookup if overwrite IP is configured (#11084)
* don't dnslookup if fix IP assigned

* change if statement
2020-01-31 05:38:39 -06:00
7950893cd1 Alternate Poller IP instead of Hostname (#10981)
* optional alternative poller ip

* add missing schema update

* .

* enhance API Call 'add_device' with overwrite_ip key

* .

* .

* updating docs
2020-01-30 06:20:30 -06:00
dc60edd8bf Include maintainers in release notes (#11002)
* Include maintainers in release notes
Use GraphQL to pull in the exact data we need

* remove changelog

* Update LibreNMS/Util/GitHub.php

Co-Authored-By: Jellyfrog <Jellyfrog@users.noreply.github.com>

* Update LibreNMS/Util/GitHub.php

Co-Authored-By: Jellyfrog <Jellyfrog@users.noreply.github.com>

* style fixes

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2020-01-30 06:15:03 -06:00
67b28ec4cd Fix Air Fiber port stats (#11079)
* Fix Air Fiber port stats
Define OS port polling includes in a standard way.
Move Air Fiber code to os port polling include.

* Update snmp data

* fix accidental change

* Some formatting fixes

* should be null
2020-01-30 05:40:58 -06:00
0a34322877 Do not strip tags when markdown is in use. (#11075)
Markdown supports limited HTML tags, which can help enrich messages.
Additionally, eliminate extra whitespace when markdown is used as that
will have weird output effects.
2020-01-29 05:59:23 -06:00
3f53eed245 alert.inc.php: Fix missing ACK & Notes modals (#11076)
* BUG: From a device page, click Alerts and attempt to ACK or add a Note.  Nothing happens because the modals are not on the page.
* This patch corrects pages/device/alert.inc.php to include both modal/alert_notes.inc.php and modal/alert_ack.inc.php
2020-01-27 20:02:28 -06:00
761d105847 Added OS definition and discovery for SIAE Alfo80HD (#11063)
* Added definition and sensors for SIAE Alfoplus80HD

* updated the units for the wireless rate sensor

* Added test data

* regenerated test data as requested by PipoCanaja
2020-01-27 19:39:52 +01:00
e33518ada1 Change Poller Group on Device Settings (#11071)
* change Poller Group on Device

* code climate fix
2020-01-27 06:19:14 -06:00
27be237791 Order Poller Group by Name (#11072)
* order poller group by name

* sql query nicement
2020-01-27 06:18:31 -06:00
2bd19c655b enhance poller group management (#11073) 2020-01-27 06:17:52 -06:00
198e29c831 Oxidized GUI tweaks (#11066)
* Don't overwrite real port ids with zeros in the FDB

* Remove space to make codeclimate happy

* Provide links to device config view for oxidized config search results

* Use a bootgrid for Oxidized nodes so we can sort, search etc.

* Add a space for codeclimate
2020-01-27 05:31:43 -06:00
25920be1db Added fix for escaping underscore while using Markdown (#11070)
* Added fix for escaping underscore while using Markdown

* Corrected indentation
2020-01-26 08:05:49 -06:00
692247ddf3 only show uptime seperator '-' if uptime present (#11069) 2020-01-26 08:04:52 -06:00
817cf42896 Fixed device SNMP edit form (and better feedback) (#11068)
* Fixed device SNMP edit form (and better feedback)

* snmp.inc.php: Fix SNMP Edit form (better feedback)
* The feedback for Max Repeaters and Max OIDs is much better.  The constant false errors on save have been corrected.  The are no longer applicable and muted when SNMP is turned off. Their feedback now clearly shows the user what has been done.
* Rename & relabel $no_checks as $force_save (Force Save) because that's simpler and more clearly defines what the code is doing when you turn it on.
* Reorder the Force Save checkbox to be right above the Save button so it's even more clear what it does.  Force Save and Save are the only elements on the form that do *not* have a database setting.  They're ephemeral and now grouped as such.
* Embedded comments about the use of === false as tests for setAttrib() and forgetAttrib()

* snmp.inc.php: code climate updates, round 1

* remove blank lines
* refactor duplicate code blocks
* remove join on string
* move print_messages to the bottom of the form

* snmp.inc.php: code climate, round 2

* avoid deeply nested control flow statements (8)

* snmp.inc.php: when to $force_save and $device_isssnmable

* move $force_save outside of if ($snmp_enabled) so it works properly
when snmp is disabled.
* only check isSNMPable() if snmp is enabled

* snmp.inc.php: move $device_snmp_details

* $device_snmp_details are only needed for isSNMPable(), so only call
them within the same contingency

* snmp.inc.php: cleanup & hardening

* add SNMP Settings header (to better mimic Device Settings, etc)
* use Toastr for feedback, rather than print_message & print_error
* after editing, always unset($_POST) and the other variables used for editing
* unless the save is forced, if !$device_issnpable then don't save *anything* in the database and revert *all* previous form settings (some already were being reverted & some weren't)
* more variables were ordered alphabetically, unused variables were and removed
* for snmpver, don't use .toggle(); use .hide() & .show() so the form reverts properly when it fails

* snmp.inc.php: clarify placeholder for max repeaters

* snmp.inc.php: code climate, round 3

* correct blank line found at the end of control structure (2)
* correct space before opening parenthesis of a function call prohibited (3)
2020-01-26 08:04:00 -06:00
71ccb6a15c Updated test data for arubaos, fs-switch, ifotec, lcos, siklu and trendnet, to pass Travis tests (#11067)
* 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

* Updated test data for arubaos, fs-switch, ifotec, lcos, siklu and trendnet, to pass Travis tests

* Updated test data for arubaos, fs-switch, ifotec, lcos, siklu and trendnet, to pass Travis tests
2020-01-25 07:39:45 -06:00
5f3ad6465e Renice Device Module Naming like in global Settings (#11061) 2020-01-24 08:58:34 -06:00
59f4491afc SNMP Traps for Juniper Power Supplies (#10965)
* Juniper Power Supply Trap Handlers

* Added unit test

* fixed tests
2020-01-24 05:59:59 -06:00
9ce7c83caa Add bad_ifoperstatus for filtering interfaces having a status for example 'notPresent' (#10977)
* 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
2020-01-24 05:58:01 -06:00