Commit Graph

278 Commits

Author SHA1 Message Date
Jellyfrog
cfd9dce620
Convert Virtual Machine pages to Laravel (#12287)
* Convert Virtual Machine pages to Laravel

* wip

* wip

* wip

* wip

* wip

* wip

* delete

* wip

* wip

* move powerStateLabel
2020-11-11 01:15:20 +01:00
Tony Murray
8f3b08721a
fix customers_descr config definition (#12310) 2020-11-09 10:30:25 +01:00
Hayden
e34b6877fd
Add OSPF cost (TOS) (#11929)
* add OspfTos model to include ospfIfMetricEntry data (ospf interface cost)

* remove WIP comment

* add new model and db migration

* update OspfTos relationship to OspfPort and correct cleanup call

* add "Cost" to device\routing\ospf web UI interface

* updated db-schema test unit

* updated db_schema to resolve conflicts

* removed tos metrics from rrd ospf stats due to rrdcached errors

* reorder db_schema.yaml to match upstream

* readd ospf_tos to db_schema

* styleCI changes

* Capture OSPF test data

* add ospf unit tests for iosxr

* ospfAuthType

* update db_schema

* remove extra migrations

* add ospf tests for iosxe

* add ospf test to ios

* merge ospf_tos into ospf_ports

* update db_schema

* update ospf module unit tests for ios, iosxe, iosxr

* fix ospf_ports ospfIfMetricStatus column type

* update db_schema

* more efficient dropColumn in down() migration

Co-authored-by: Tony Murray <murraytony@gmail.com>
2020-11-07 09:27:25 -06:00
Hans Erasmus
6c4596d1b9
Added new authalgo support for SNMPv3 (#11966)
* Added new authalgo support for SNMPv3

* Update 2020_07_27_00522_alter_authalgo_column.php

Fixed case

* Update addhost.inc.php

Fixed case

* Update snmp.inc.php

Fixed case

* Update db_schema.yaml

Fixed case

* Fixed SHA-* order to ascending

* Update 2020_07_27_00522_alter_authalgo_column.php

Fixed space

* Update db_schema.yaml

Fixed line to be of type string

* Update config_definitions.json

Fixed sorting

* Fixed test file case sensitivity

* Fixed rollback function

* SourceDoctor code for checks

* Fixed indentation issues on Travis test

* Update to re-trigger testing stuck on CLA step

* Added crypto-algo updates

* Incorporated suggestions from Jellyfrog

* Added documentation entry

* Fixed travis spacing error

* Fixed validations

* Delete snmpv3_version_compare.patch

Sorry, this one was not supposed to be there.

* Added poller evaluation

* Added poller comparison

* Fixed merge-conflicts

* Fixed typo in test unit

* code refinements
only can check on webui that it supports the algorithms, hopefully, the eventlog is enough to notify users of distributed pollers.

* style fixes and remove openssl setting

* fix device access

* fix missing migration column

Co-authored-by: Tony Murray <murraytony@gmail.com>
2020-10-29 13:02:26 -05:00
ottorei
599c423532
Optional availability calculation mode to allow planned maintenance (#12218)
* Add an optional availability calculation mode

* Style fixes

* Review fixes

* Variable fix

* Style fixes

* Style fixes

* Style fixes

* Add additional status check, remove uptime

* Style fix

* Style fix

* Fix extra database update

* Style fix

* Style fix
2020-10-28 02:05:19 +01:00
Hayden
774d95c118
allow nullable ospf auth (#12249)
* ospfAuthType

* update db_schema

* remove extra migrations
2020-10-21 21:07:12 -05:00
Richard Kojedzinszky
2ca6f2f8d4
schema: add missing primary keys (#12106)
* schema: add missing primary keys

* Exclude ipv4_mac.id

* Made primary key migrations SQLite compatible

Co-authored-by: Tony Murray <murraytony@gmail.com>
2020-10-14 20:37:40 -05:00
Tony Murray
1e4702fa4f
Support multiple daily process locking backends with distributed polling (#11896)
* Implement locks in the file cache

* Replace custom locks

* implement restore lock
Used when re-hydrating

* remove legacy use statements

* Add class descriptions

* Fix style

* Default to database cache driver

* missed cache_locks table
prevent chicken-egg issue

* style fixes

* Remove custom file lock implementation

* missed items from file cache

* Update schema definition
hmm, other schema noise must be from manual modification as this is generated from a freshly migrated db.

* require predis, it is pure python, so no harm in adding

* and set predis as the default client
2020-10-07 07:36:35 -05:00
Tony Murray
88b40c3d6c
All os detection now uses Yaml (#12186)
* All os detection now uses Yaml
Move OS detection code into the Core module.
Defer all OS with snmp queries.
Add snmpwalk option.
Port ubnt and mobileiron to yaml.

* Silly ide refactor
2020-10-05 14:26:37 +02:00
Tony Murray
210be6266e
Yaml support to translate sysObjectID to get hardware (#12187)
* Yaml support to translate sysObjectID to get hardware

* restore ironware behavior

* ...
2020-10-05 13:50:28 +02:00
Adam Bishop
41ed0537b4
Fix midnight poller data loss (#11582)
* Handle more signals

* Flush buffers before exiting process
This ensures log messages aren't lost

* Restart process before jobs have finished
If there is a very log running job it can cause service restart to
take over 5 minutes.

We tweak the order of things to make sure that running processes
continue, but nothing more is scheduled.

The worst case impact is that a pollling/discovery job gets
scheduled twice, but this should not be a big issue - this should
only occur at most once per day.

* Remove python 3.8 feature

* Ensure that processes from the previous invocation are reaped

* Correct typo's

* Attach subprocess descriptors to /dev/null

Occasionally, PHP would throw a fit and crash when its stdout went
away. To avoid this, we attach stdout to devnull.

This means we lost output of daily.sh - but this is already recorded
in $LOGDIR/daily.log

* Don't immediately schedule long running jobs

To avoid the situation where the maintenance reload happens or a sighup,
then a second long running job is immediately started, we wait
(`last_[poll/discovery]_timetaken` * 1.25) seconds before scheduling
any jobs.

* Add `psutil` to requirements

* Add support for "systemctl reload" to the unit files

* Add a fallback for systems that don't have psutil

* Reduce CPU load when psutil is not installed

* Don't avoid double polling by extending the timeout

This shouldn't happen due to locks

* Remove fallback option

* Remove extra variable

* Fix issue introduced during rebase

* Fix issue introduced when fixing issue introduced during rebase

* Make psutil optional
2020-09-29 23:50:40 -05:00
Negatifff
444b9544a0
new index in alert_log table (#12143)
* new index in alert_log table

* codefix1

* codefix2

* added second index

* codefix

* Apply suggestions from code review

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2020-09-24 17:05:21 +02:00
PipoCanaja
0e0e80c827
More eventlogs for snmptraps (#12112)
* Allow detailed trap display and inform user about snmptrapd misconfiguration

* Documentation update

* Documentation update

* Documentation update

* CodeClimate

* CodeClimate

* ChangeRequest PR

* Fix tests

* config_definitions

translation

doc

* styleci

* lnms translation generate after npm-install
2020-09-23 17:00:02 +02:00
Jellyfrog
bef67751a3
Add PHP CS Fixer (#12128)
* Add PHP CS Fixer

Based on https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200

* Apply PHP CS
2020-09-21 19:52:01 -05:00
Tony Murray
941037e44e
Convert OS discovery to new style (#12099)
* terra

* airos

* port cisco os polling
old wwan polling was broken and deprecated anyway

* enterasys

* Brother, a few changes

* AW Plus

* Fabos

* set expected test data

* 3com

* Adva FSP150

* advantech

* airos-af

* aix

* akcp

* allied

* allworx and missed mibs

* anyos

* fixup some zyxel shared stuffs
zywall graph polling

* aos

* apc

* apex

* apsoluteos

* fix copyrights

* arris

* arris

* aruba-instant

* ArubaOS

* Ascom

* asuswrt-merlin, ats

* audiocodes

* avocent

* avtech

* barracuda

* binox

* boss

* canonprinter

* cdata

* ceraos

* ciena-waveserver

* fix 3com

* fix airos

* fix brother yaml?

* fix aos more

* fix and improve apc

* fix arista test data

* yaml discovery (basic)

* cimc

* mib not used

* remove old discovery file

* ciscosat

* ciscosb fixes + improvements

* comware

* ctm

* cumulus

* cxr-ts

* cyberoam-utm

* cyberpower

* dahua-nvr

* dasan-nos

* datadomain

* dcn-software and fallback oids

* dd-wrt

* dell-laser

* d*

* e* and location

* forti, post processing, oid coalescing

* Freebsd array of sysDescr regex

* finish f*

* g*

* h*

* i* WIP

* i*

* Junos

* j*

* k*

* unix refactor previous to yaml more
inject $device

* fixes

* fixes

* l*

* m*

* n* ability to set other fields in regex
tnmsne polling to eloquent

* o*

* p*

* q* + bonus calix

* r*

* s* WIP

* s*

* t*

* u*

* v*
rework vrp to yaml (hybrid)

* w*

* x*

* z*

* a* easy no-data

* fixes

* style fixes

* missed ApexPlus

* fix signature

* Add missing location data

* rename getDevice functions

* add new cisco ftd data

* update docs

* revert sill snmp format

* fix snmp options

* update for new smartax test data

* rebase dsm

* fix voss
2020-09-18 15:12:07 +02:00
Adam Bishop
bbdb1a2a5d
Rewrite smokeping script to be an lnms command (#11585)
* Rewrite smokeping script to be an lnms command

* Add a default number of probes for smokeping

* Formatting fixes

* Refactor to simplify a couple of methods

* Fix a name collision when using more than 60 threads

* Simplify

* First pass at documentation

A few climate fixes too.

I'm a little dubious about the + LibreNMS fix - it could be included
in /etc/smokeping/config if it is really needed, but it sounds like
(looking at git blame) it's needed for if the script generates a broken
configuration file.

I'm thinking we should just not generate broken config.

* Improve testability and add some tests

* Load laravel to make translations available

* Second pass at documentation

* Fix brace

* Extend the device factory to include the type

Also adds a device group fake I created before I realised I didn't need it

* Mimic gen_smokeping.php a little more closely

* Update tests to properly verify old and new behaviour against each other

* Replace gen_smokeping with a wrapper

* Don't double whitespace

Render does this automatically.
Explicitly order by hostname too.

* Make faker less likely to generate duplicates

I tried adding a unique constraint here, but it didn't have the
intended effect.

Extending the hostname like this seems to work fine - I tried
generating 10 million hosts and got no duplicates, compared to
duplicates appearing with as few as 100 hosts without this
 change.

A true fix would be to add an 'fqdn' fake upstream.

* Make the tests more robust

* Assorted bug fixes

* Style corrections

* Handle 'generic' devices

* Fix an issue that came up during rebase

Co-authored-by: Tony Murray <murraytony@gmail.com>
2020-09-18 00:04:54 -05:00
Tony Murray
fde6ef5f3f
fix skip_value_lt plurality confusion (#12056)
* fix skip_value_lt plurality confusion

* Update atenpdu.yaml
2020-09-12 23:26:20 +02:00
Tony Murray
000b8e0f7c
Improve mib_dir setting consistency (#12069)
yaml os discovery now respects the os mib_dir definition
mib_dir now only allows strings, not arrays
changed schema validation to account for that
consolidated dell mibs, no reason for them to be spread out
2020-09-08 12:55:29 +02:00
Jason Cheng
661a518dea
Add attach sysName to Prometheus. (#12061)
* Add attach sysName to Prometheus option.

The value of put to prometheus can be added to sysName by setting the relevant parameter.

* Add attach sysName to Prometheus.

* Add attach sysName to Prometheus.

* Update resources/lang/en/settings.php

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>

* Update settings.php

* Update settings.php

* Update settings.php

* Update settings.php

* Update settings.php

* Update zh-TW.json

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2020-09-07 21:38:13 +02:00
Anthony F. McInerney
d601d38edf
Fix missing 'nets' for autodiscovery (#12039) 2020-08-31 10:04:32 +02:00
SourceDoctor
427878dcaa
Availability Calculation for all Devices (#12004)
* Availability Calculation for all Devices

* remove not more need uptime column
2020-08-28 13:01:54 +02:00
Nate Byers
2b0643086b
Corrected alert_rules.json file to container proper JSON. (#12033) 2020-08-26 07:54:14 +02:00
Tony Murray
87754b6b48
Clean up default alert rules (#12014)
* Disable rules from the default list
Too many rules in the default, disabling the customoid rules.
It is easy to add from the collection.  Any other suggestions?

* remove bgp and default false
2020-08-24 08:12:00 +02:00
SourceDoctor
663ca6e9d1
Move Availability Setting to Poller (#12021) 2020-08-19 22:03:37 +02:00
pobradovic08
95c04de501
Changed row counts for default RRD definition (#11995) 2020-08-07 07:51:23 -05:00
TheGreatDoc
c7cd410a0a
Fix fping6 config definition (#12003) 2020-08-07 07:36:42 -05:00
Jellyfrog
cf13e92f05
Add missing index for device_perf (#11974)
Makes the latency page load faster in case of a large device_perf table
2020-07-31 16:07:00 +02:00
Tony Murray
020c5fd7e1
Remove legacy code and fix missing device graphs (#11950)
* removing $graphs global

* remove unused things

* fix some additional graphs

* Fix graphs persisting too soon

* correct name for poller module performance graph

* only one type of graph is used here
2020-07-23 09:57:22 -05:00
Jellyfrog
86220eed9e
Add more types to settings page (#11918)
* Add a executable type to settings page

This allow us to validate the value is a valid executable

* Add a directory type to settings page

This allow us to validate the value is a valid directory

* fixes
2020-07-21 20:51:23 -05:00
TheGreatDoc
8235860ab8
QNAP NAS - Added state rules to collection (#11931) 2020-07-14 17:37:25 +02:00
Tony Murray
560fd71ef6
CORS settings in webui (#11912)
* Change CORS implementation
allows for upstream integration of Laravel 7

* migrate config

* skip implementing patterns for now

* Expose settings to the webui

* Make db settings apply
2020-07-08 07:36:51 -05:00
Munzy
8a851eda9f
Auth AD URL (#11884)
* Missing auth_ad_url

WIP

* add auth_ad_filter

* Pluralize

* Remove Translation, and add translations generation.
2020-07-01 13:23:35 -05:00
Tony Murray
d75cc5235d
Settings geocode lookup (#11875)
* Add setting to enable geocoding to ui

* rename settings

* rename settings

* capitalization

* Open streetmaps does not support geocoding
2020-06-29 21:03:03 +02:00
SourceDoctor
e2e082af10 . 2020-06-23 19:42:39 +02:00
SourceDoctor
8f115bdd01 . 2020-06-23 19:16:58 +02:00
SourceDoctor
3f2c9386bf partial double 2020-06-23 16:51:31 +02:00
SourceDoctor
bfcec4dc16 change column type to float 2020-06-23 16:45:08 +02:00
SourceDoctor
ab80f7697b
. 2020-06-23 02:21:16 +02:00
SourceDoctor
cf7f45fe53 . 2020-06-23 01:30:09 +02:00
SourceDoctor
afa26d66b5 Fix datatype for Availability_perc Column 2020-06-23 01:06:49 +02:00
SourceDoctor
4e6a7291a2
Device Availability Calculation (#11784)
* Device Availability Calculation

* Travis fix

* .

* schema corrections

* flexible duration

* travis

* .

* .

* .

* .

* remove not needed code

* line Text to RRD

* update humantime

* .

* only set up again if device was marked as down

* set RRD area transparency

* save uptime also, to keep last availability as good as possible

* file description correction

* look for outages even if uptime > duration
2020-06-22 22:57:30 +02:00
SourceDoctor
6cceeb43f0
Fixing wrong Alert Rule Operator (#11842) 2020-06-20 11:55:22 +02:00
SourceDoctor
2a8e39d55e
UPS Alert Rule Fix (#11836) 2020-06-18 18:15:27 +02:00
yon2004
089e97dc51
Update alert rules (#11838)
fixed a error with AND and && for UPS-NUT rules
2020-06-18 15:35:55 +02:00
yon2004
953def1518
Added discovery for ups-nut status (#11606)
* Added UPS NUT state sensors

* Added UPS NUT state sensors

* Added UPS NUT state sensors

* Added UPS NUT state sensors

* Added UPS NUT state sensors

* Update linux_ups-nut.snmprec

* Fixed UPS states so making alerts easier.

* Fixed

* Actually Fixed it

* Added alert rules for UPS-NUT
2020-06-18 09:43:11 +02:00
Tony Murray
867aa132c1
Merge pull request #11661 from SourceDoctor/app_dhcp_enhancement
Application DHCP Upgrade
2020-06-16 17:03:45 -05:00
Tony Murray
67e637e4ca
Maintenance Windows: recurring now works overnight (#11389)
* Alert Rules use Carbon
Use carbon for time queries, need to be careful of timezone quirks.  Timestamps won't have that issue

* Convert existing schedules to UTC

* we only need start end... we already have start/end

* Make AlertSchedule::isActive work

* Table display working (and using Eloquent)

* Schedule creation updated

* WIP

* use Eloquent mutators/accessors

* recurring_day mutator/accessor

* WIP UI

* Fix SQL to handle outside times

* fix up some ui issues

* Convert alert-schedule to new style
Improved sorting customization

* fix whitespace

* support sqlite

* Fix schedule creation missing id

* Fix Device::isUnderMaintenance() add location relation
2020-06-14 16:35:50 -05:00
PipoCanaja
15fe63d6b1
Feature: skip_value can check OID existance (#11822)
* exists for skip_values

* AR routers are using another logic for SFPs Power

* schemas

* tests
2020-06-14 09:21:22 -05:00
Tony Murray
13ade9ab6c
Merge branch 'master' into alerts-carbon 2020-06-12 07:48:51 -05:00
SourceDoctor
13ffc702ba . 2020-06-09 21:45:25 +02:00