Commit Graph

160 Commits

Author SHA1 Message Date
Tony Murray
a95efd6d2a
Global search: search device display (#13583)
* Global search: search device display
Add display field to search (also port_desc_descr, portName, and bgpPeerDescr)
Rewrite backend
update typeahead bundle
update devices and ports indexes
reduce some port field sizes so we can index them

* Style fixes

* remove nonsense
2021-12-06 16:12:24 +01:00
Tony Murray
790c4b3402
Configurable device display name (#13528)
* Configurable device display name
You can just set the display name in device settings.

It also accepts simple template format with  the variables: hostname, sysName, sysName_fallback, ip

Default controlled by device_display_default, (set from old force_hostname_to_sysname and force_ip_to_sysname settings

* remove second argument to format_hostname()

* Style fixes

* Update schema

* update phpstan baseline

* Improved settings strings (and add for translation)
2021-11-18 15:46:22 -06:00
pepperoni-pi
4b572b9b31
Added migration file to change cpwVcID to unsigned integer (#13510) 2021-11-12 14:15:50 -06:00
Mike Beattie
8d5d0b12c3
Increase length of devices_attribs.attrib_type column (#13395)
* Increase length of devices_attribs.attrib_type column

closes #13381

Signed-off-by: Mike Beattie <mike@ethernal.org>

* Update db_schema.yaml

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-20 19:50:15 -05:00
Kevin Zink
98ed6bb9dc
New plugin system based on Laravel Package Development (#12998)
* use Blade view and Eloquent models for plugins

* move views

* fix style

* fix style

* revert mistake

* Update Plugin.php

delete test property "name"

* rename plugin function to settings

* last but not least - rename in Test.php

* Rename Test to Example

* fix typo

* fix style

* fix style

* fix style

* fix style - I hate tabs...

* Extract view calls

* fix method calls and style

* Move Models the the abstract class

* fix style

* Convert to traits

* Change the Example description

* Fix style

* Fix style

* Fix style

* Convert plugin function to Model static methods and delete .inc.php

* fix style

* fix style

* Use scope

* final methods blows up legacy code

* Config > \LibreNMS\Config

* convert the static string to a static method

* Correct placement in the page

* fix tabs

* fix style

* Rename from tait to hook

to make it easier to understand and be complient

* rename file

* Typo

* Started to change the docu

* change to a more usefully Device_Overview example

* and activate of course

* PluginManager

* fix .gitignore

* only php files in the root folder

* corrected .gitignore with all files :)

* Rename the Hooks and ExampleClass for better readability

* Fix style

* Fix style

* Exception handling (especially if DB is not present)

* Fix style and update schema

* fix indentation

* actually correct indent

* fix migration collation check include utf8mb4_bin

* stop phpstan whining

* A view lines documentation

* add typeHints

* Allow return null on handle

* lint

* fix return types

* fix logic of column collation check

* Fix MenuEntryHook

* switch to longtext instead of json type for now :D

* try phpstan on PHP 7.3

* set phpstan target version to 7.3

* all the typehints

* optional

* more

* Use namespace to prevent view collisions
disambiguate plugin and hook
no magic guessing of names in PluginManager, bad assumptions
remove unused plugins from the DB

* cleanup plugin menu

* cleanup on shutdown and ignore but log query error on cleanup

* instanceof must be called against an instance

* Allow multiple hooks per plugin

* Port plugin ui code to Laravel

* page instead of settings for v1 plugins

* actually working settings pages
a little url cleanup plugin/admin -> plugin/settings

* fix style

* Add page hook

* PHPstan

* Try to fix Illuminate\Http\RedirectResponse

* typehint

* Rewrite the doc

* Fix style

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-10-19 06:53:28 -05:00
Tony Murray
0b8b97bb68
Push Notifications (Mobile and PC) (#13277)
* Update manifest and add service worker
cleanup icons a bit

* Push notifications WIP

* navigate working

* cleanup

* acknowledge wired up

* Set VAPID keys on composer install

* Component to control notification permissions.

* Allow all user option to validate

* Enable on browser load if transport exists.

* Check for transport before showing user permissions
translations

* Documentation

* style fixes

* access via the attribute model

* fix alerting test

* update schema

* cleanup subscription on disable

* non-configurable db and table for webpush subscriptions (respect system connection)

* revert AlertTransport change
hopefully phpstan can figure it out

* phpstan fixes

* Support custom details display

* Match transport names to brand's preferred display

* less duplicate id errors

* Tests are done in Laravel code now so
remove legacy function usage... could be better, but ok

* Style fixes

* Style fixes 2

* Fix alert test

* Doc updates requires HTTPS and GMP

* unregister subscription when permission is set to denied

* cleanup after user deletion

* delete the right thing

* fix whitespace

* update install docs to include php-gmp

* suggest ext-gmp

* update javascript

* Update functions.php

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2021-10-06 07:29:47 -05:00
SourceDoctor
95932edc3b
hrSystem Columns have to be optional (#13316)
* hrSystem Columns have to be optional

* .

* update

* .

* .

* .

* .
2021-10-03 23:38:09 -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
SourceDoctor
f47410e426
log count of logged in users in Database (#13137)
* log count of logged in users in Database

* .

* rewrite Code

* create hrSystem Table

* .

* .

* db adjustments

* adjust db Table

* .

* adjust db Table

* table redesign

* .

* .
2021-10-02 01:58:26 +02:00
Tony Murray
e2822d7eaa
Increase config value length limit (#13178)
Up to 16MB of text now
2021-09-01 14:15:25 +02:00
Tony Murray
8e409ba051
Rewrite ISIS Adjacency discovery/polling (#13155)
* Rewrite ISIS Adjacency discovery/polling
hopefully much faster now, do most work in discovery and just check up/down in poller.

* unused variable

* Implement option for OS override

* fix an incorrect typehint

* test data

* work around stupid migration name

* update schema

* better handling for the on-demand discovery

* more detailed phpdoc

* fix when adjacency is not found

* don't clear out data when adjacency goes away

* Adjust nullable fields

* fixes

* fix class name

* correct migration

* fix bug causing adjacency data to always be blank

* port popups for port links

* isisISAdjState does not need to be nullable

* remove extra space

* default off

* If port is missing return $text

* update schema

* Cleanup old components

* correc copy paste error
2021-08-23 21:19:55 -05:00
Tony Murray
d74bb37971
Show port speed on port graphs, optionally set scale (#11858)
* Show ifSpeed on Graph
Drop ifHighSpeed, we really don't want to store that value.

* safer truth check

* Allow global setting and per-graph variable

* match surrounding case

* Style fixes

* Remove old function usage

* update schema

* remove some old usages

* cleanup more ifHighSpeed references

* update test data to remove ifHighSpeed

* fix down migration

* Add button on graph page
Change default
tweak wording
2021-08-23 06:47:44 -05:00
M. Toups
1082373145
add two indices to syslog table, addresses librenms/librenms#12855 (#13105) 2021-08-05 10:15:15 +02:00
Bennet Gallein
574eb1f0f0
Billing: add peak in and out (#13006)
* feat(api): added max in/out per bill_history period

* chore(Docs): updated docs to include in/out max values

* chore(formatting): style-ci

* chore(db): update db-schema

* fix(db): reverted wrong changes in schema

* fix: wrong table name in migration

* feat(billing-history-frontend): added max in/out values to frontend bill-history

* chore: renamed to peak instead of min/max
2021-07-26 10:37:52 -05:00
djamp42
fb36f0bc60
Create Laravel Sessions Table (#12962)
* create laravel sessions table

* fixing last commit
2021-06-18 23:37:50 -05:00
geg347
672fe61b5e
New module add juniper rpm support + reimplementation of cisco-sla module (#12799)
* Definition of a new SLA module to migrate from old cisco-sla and support other devices : Juniper RPM and Huawei

* Change wrong description name of module SLA

* Re implementing Juniper RPM support in a new module Slas (Cisco SLA to be added)

* Added Graphs for Juniper RPM types

* Tried to make discover and poller generic : to handle Cisco SLA and Juniper RPM and others

* Reimplementing Cisco SLA in the new Sla module and adding condition to manage both SLA and RPM

* Definition of a new SLA module to migrate from old cisco-sla and support other devices : Juniper RPM and Huawei

* Change wrong description name of module SLA

* Re implementing Juniper RPM support in a new module Slas (Cisco SLA to be added)

* Added Graphs for Juniper RPM types

* Tried to make discover and poller generic : to handle Cisco SLA and Juniper RPM and others

* Reimplementing Cisco SLA in the new Sla module and adding condition to manage both SLA and RPM

* Fix some error due to Elequent object replacing SQL request

* Fixing indentation

* Fixed continuous integrations errors

* Fixed continuous integrations errors part 2

* Fixed continuous integrations errors part 3 : missing last new lines

* Fixed PHP Static Analysis checks

* Fixed continuous integrations errors part 4

* Fixed PHP Static Analysis checks part 2

* Trying to convert existing cisco-sla to new slas one

* Trying to add slas to fix test failure (I am pretty sure this is not enough but I don't know how to do it)

* Switching old cisco-sla module declaration to new slas module in concerned OS files

* Fixing wrong sla module name instead of slas in concerned OS files

* Fixing wrong module name sla changed to slas (as is it in power-supplies reimplementation)

* Fixing some warnings shown in the Inspection CI but skipping some that are already present

* Adding tests files from virtual Juniper VMX and adding slas modules in /tests/module_tables

* Adding missing SNMP data files

* Module Slas modifications to use inheritance

* Fix CI errors

* Fix CI errors part 2

* Fix CI errors part 3

* Fixing no value on RTT graphs

* Fixing only last SLA to be polled : problem with loops

* Fix CI errors part 4

* Optimizing a little the Juniper RPM poller part

I wanted to query only the required values but it is complicated to query a specific OID
as Cisco-SLA does because the owner and tag are hardcoded in ASCII decimal with strange values.
So I use the function snmp_walk which gets the whole OID values in text.
And I index the Juniper MIB (because we want multiple values). But I changed the DISMAN MIB
requests to get only what we want.

* Fix CI errors

* Fix CI errors part 2

* Fix CI errors part 3

* Fixing PHP Static Analysis error 2/4

* Fix CI errors

* Implementing Interfaces to fix some errors that occurs with inheritance

* Adding missing Interfaces files

* Moving generic Sla discovery code into Junos Class

* Fix CI errors

* Fix CI errors part 2

* Fixing missing definition of SlaDiscovery in Cisco shared Class

* Fixing missing import for Illuminate\Database\Eloquent\Collection

* Fix CI errors part 3

* Fix PHP Static Analysis error

* change type strings to use translations instead of config

* IOSXR test data

* remove test data garbage

* simplify discovery

* Fix style

* Updating test files to adapt mock sla_nr ID starting from 0 and not 1 : CI tests should pass

* clean up polling
add rtt field in the db
cisco icmpjitter seems to have confused a lot of values

* rtt on discovery

* use crc32 for consistent sla_nr values

* revert snmprec

* Fix style

* correct schema

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-06-11 13:48:33 -05:00
ottorei
69397ea70f
ISIS-adjacency polling support (#12461)
* init

* Add adjacency polling support

* Format messages

* Fix prints

* Apply fixes from StyleCI

* Fix schema

* Schema fix

* Alert rule example

* Remove display format

* Change option order

* Add test data

* Add test data

* Test data

* Review fixes

* Remove duplicate MIB-file

* Add cleanup

* Fix

* Print fix

* Remove extra cleanup

* Revert "Remove duplicate MIB-file"

This reverts commit 4b3cf8127c.

* Remove unneeded MIB-files

* Add check for empty array

* Apply fixes from StyleCI

* Review fixes

* StyleCI

* StyleCI

* Apply fixes from StyleCI

* typo

* Update function calls on pages

* Linting fixes

* Apply fixes from StyleCI

* Discovery module

* Add discovery module

* Apply fixes from StyleCI

* Update example alert rule

Co-authored-by: ottorei <ottorei@users.noreply.github.com>
Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
2021-06-10 19:42:34 -05:00
SourceDoctor
4b9e480118
Define Port Groups (#12402)
* Define Port Groups

* .

* .

* .

* API Calls

* .

* .

* .

* minor changes

* .

* update forms

* remove link

* .

* change column settings

* change migration

* change update position

* db migration fix

* .

* .

* .

* add missing doc reference

* update test data

* update test data

* update test data

* .

* .

* .

* .

* .

* .

* .

* .

* port group association in seperate table

* .

* .

* show all found groups on port

* select multiple Portgroups per Port

* change on migration file

* change query to eloquent

* Code changes

* move port group menu to ports main menu

* port group update to eloquent

* .

* .

* update to new setting way

* add missing merge parameter

* Use select2 and port some things to Laravel
some fixes, hopefully no new added bugs

* schema

* don't use on update restrict unfortunately

* remove unused import and revert changes

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-04-06 17:25:08 -05:00
Jellyfrog
f06e81b357
Switch to utf8mb4 (#12580)
* Switch to utf8mb4

This allows emojis to function correctly

* Update URLs
2021-03-28 16:23:08 +02:00
Jellyfrog
e00eba327d
Re-implement Printer as a class based module (#12605)
* Re-implement Printer as a class based module

* Rename toner table

* wip

* wip

* Rename to printersupplies

* Fixes

* Rename

* wip

* wip
2021-03-27 10:09:14 -05:00
Jellyfrog
77d21c1d05
Change cache table to mediumtext (#12649)
Fixes #12620
2021-03-26 11:09:42 +01:00
Tony Murray
ac7b4539ce
Fix Service Templates Dynamic (#12626)
* Fix Service Templates Dynamic
Remove dynamic groups type, it did not work.
Rename and simplify field names.  (fixing an issue with the builder where the rules field should be named rules)

* update schema def

* wrong method name in migration

* fix rules builder

* corerct call to apply

* sqlite can't drop columns

* correct column rename order on down.

* fix sqlite again

* fix whitespace
2021-03-18 08:14:45 -05:00
Tony Murray
f5a0959181
Revert "Switch to utf8mb4 (#12501)" (#12578)
This reverts commit 8e2e67d0ee.
2021-03-01 14:59:06 -06:00
Jellyfrog
8e2e67d0ee
Switch to utf8mb4 (#12501)
* Switch to utf8mb4

This allows emojis to function correctly

* Update URLs
2021-03-01 08:02:26 -06:00
SourceDoctor
75a0a5e374
Use DNS Location Record for Location (#12409)
* Use DNS Location Record for Location

* .

* .

* .

* grammar fix

* dns class

* code changes

* composer update

* add missing composer.lock update

* reposition Location record parsing

* composer update

* default yes ; change lookup order

* merge master

* .

* move Location Record Parser to Model Level

* .

* fix location record code

* Location precedence with tests
Setting from UI disables all lookups

* update composer.lock and mix-manifest.json

* Style fixes

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-02-22 11:17:40 +01:00
Tony Murray
0d61deb8f0
Remove perf_times table (#12517)
the data is never used... This type of data is better to store in rrd anyway
2021-02-09 12:47:05 -06:00
Anthony F. McInerney
5388a20c09
Add Service Templates (#12107)
* service templates - move to blade - jellyfrog fixes - revert get to find and fix discovery lookup

* service templates - move to blade - wip

* service templates - move to blade - wip

* service templates - move to blade - deprecate delete_service_template

* service templates - move to blade - deprecate delete_service_template

* service templates - move to blade - deprecate remove_service_template

* service templates - move to blade - deprecate remove_service_template

* service templates - move to blade - fix permisson lookup

* service templates - move to blade - fix remove route

* service templates - move to blade - fix remove route

* service templates - move to blade - fix permisson lookup

* service templates - move to blade - fix permisson lookup

* service templates - move to blade - fix permisson lookup

* service templates - move to blade - fix permisson lookup

* service templates - move to blade - fixs

* service templates - move to blade - fixes

* service templates - move to blade - fixes

* service templates - move to blade - fixes

* service templates - move to blade - nullable input?

* service templates - move to blade - nullable input?

* service templates - move to blade - nullable input?

* service templates - move to blade - add selected for device group id and type

* service templates - move to blade - add selected for device group id and type

* service templates - move to blade - add selected for device group id and type

* service templates - move to blade - fix discovery response

* service templates - move to blade - fix device group index display

* service templates - move to blade - add delete to discover_service_template

* service templates - move to blade - add discover all button - function foobar

* service templates - move to blade - add discover all button - function foobar

* service templates - move to blade - add discover all button - function foobar

* service templates - move to blade - fixes

* service templates - move to blade - fixes

* service templates - move to blade - fixes

* service templates - move to blade - button fixes

* service templates - move to blade - button fixes

* service templates - move to blade - button fixes

* service templates - move to blade - attempt route fix

* service templates - move to blade - attempt route fix

* service templates - move to blade - attempt route fix

* service templates - move to blade - attempt route fix

* service templates - move to blade - fix discovery function

* service templates - move to blade - fix discovery function

* service templates - move to blade - fix return values - thanks SourceDoctor

* service templates - move to blade - attempt route fix

* service templates - move to blade - button variable fix

* service templates - move to blade - button variable fix

* service templates - move to blade - button variable fix

* service templates - move to blade - function fix

* service templates - move to blade - permissions fix

* service templates - move to blade - permissions fix

* service templates - move to blade - permissions fix

* service templates - move to blade - permissions fix

* service templates - move to blade - permissions fix

* service templates - move to blade - permissions fix

* service templates - move to blade - permissions fix

* service templates - move to blade - permissions fix

* service templates - move to blade - permissions fix

* service templates - add initial api - and model permissions fix

* service templates - add initial api - discovery too

* service templates - add initial api - discovery too

* service templates - merge fix

* service templates - api fixes

* service templates - api fixes

* service templates - remove bad fixe

* service templates - discover null? :)

* service templates - Policy requires Facade?

* service templates - Policy requires Facade?

* service templates - REVERT Policy requires Facade?

* service templates - REVERT Policy requires Facade?

* Revert "service templates - REVERT Policy requires Facade?"

This reverts commit 7752b3e4e5.

* service templates - clean up discover api call

* service templates - clean up discover api call

* service templates - clean up discover api call

* service templates - clean up discover api call

* service templates - clean up discover api call

* service templates - attempt route fix

* Revert "service templates - attempt route fix"

This reverts commit b48970351e.

* service templates - jellyfrog fixes - DeviceGroup relates to Service Template

* service templates - jellyfrog fixes - DeviceGroup relates to Service Template

* service templates - jellyfrog fixes - DeviceGroup relates to Service Template

* service templates - jellyfrog fixes - DeviceGroup relates to Service Template

* service templates - jellyfrog fixes - DeviceGroup relates to Service Template

* service templates - jellyfrog fixes - DeviceGroup relates to Service Template

* service templates - jellyfrog fixes - dbchanged - DeviceGroup relates to Service Template

* service templates - jellyfrog fixes - dbchanged - DeviceGroup relates to Service Template

* service templates - jellyfrog fixes - dbchanged - DeviceGroup relates to Service Template

* service templates - jellyfrog fixes - dbchanged - DeviceGroup relates to Service Template

* Revert "service templates - jellyfrog fixes - dbchanged - DeviceGroup relates to Service Template"

This reverts commit ef93315db5.

* Revert "service templates - jellyfrog fixes - dbchanged - DeviceGroup relates to Service Template"

This reverts commit 73af819a60.

* Revert "service templates - jellyfrog fixes - dbchanged - DeviceGroup relates to Service Template"

This reverts commit dd019c3105.

* Revert "service templates - jellyfrog fixes - dbchanged - DeviceGroup relates to Service Template"

This reverts commit 94aaaf7976.

* service templates - jellyfrog fixes - DeviceGroup relates to Service Template

* service templates - fix permissions

* service templates - db service_templates_perms

* service templates - fix permissions

* service templates - fix permissions

* service templates - fix permissions

* service templates - fix permissions

* service templates - fix permissions

* service templates - fix edit.blade missing parameters - still 403 :(

* service templates - jellyfrog -fix route and construct

* service templates - jellyfrog -fix route and construct

* service templates - jellyfrog -fix route and construct

* Revert "service templates - jellyfrog -fix route and construct"

This reverts commit ec1eea7a99.

* service templates - jellyfrog -fix routes

* service templates - jellyfrog -fix services lookup

* service templates - edit blade fixes

* service templates - edit blade fixes - service or services or template or serviceTemplate or service_template good luck

* service templates - edit blade fixes

* service templates - index blade fixes

* service templates - discover return fix

* service templates - remove return fix

* service templates - fix discovery api returns

* service templates - fix discovery api returns

* service templates - fix discovery api returns

* service templates - fix discovery - test

* service templates - fix discovery

* service templates - fix checkbox integer

* service templates - fix checkbox integer

* service templates - fix checkbox integer

* service templates - fix checkbox integer

* service templates - fix checkbox integer

* service templates - fix discover all

* service templates - fix discover all

* service templates - fix discover all

* service templates - fix discover all

* service templates - fix discover all

* service templates - fix discover all

* service templates - fix discover all

* service templates - fix discover

* service templates - fix discover

* service templates - fix discover

* service templates - fix discover

* service templates - fix discover

* service templates - move discover/apply to blade - last of the old functions - wip

* service templates - move discover/apply to blade - last of the old functions - wip

* service templates - move discover/apply to blade - last of the old functions - wip

* service templates - change all relevant to template for sanity

* service templates - inspection fixes

* service templates - inspection fixes

* service templates - inspection fixes

* service templates - murrant fixes - use createOrUpdate - add obervers - fix function call

* service templates - murrant fixes - add ServiceController store - not used

* service templates - murrant fixes - add Observers file)

* service templates - murrant fixes - correct ServiceController

* service templates - murrant fixes - fix observers load

* service templates - observer fix

* service templates - schedule discovery function call fix, cheeky, is this allowed?

* service templates - attempt route fix.

* service templates - attempt route fix 2

* service templates - blade route applyall missing url - ie the route lol

* service templates - blade route applyall missing url - ie the route lol

* service templates - fix routes - bingo!

* service templates - fix routes - bingo!

* service templates - fix blade missing quote

* service templates - jellyfrog fix - remove pluck

* service templates - missing template id on service update

* service templates - jellyfrog fix - add get

* service templates - fix service db defaults / null

* service templates - fix service update

* service templates - fix service update

* service templates - fix service update

* service templates - fix service devicegroup change - obsoletes service_template_change in servicesdb

* service templates - fix service devicegroup change - obsoletes service_template_change in servicesdb

* Add service templates - phpcs fixes - and attemp whereNotIn scope

* Add service templates - styleci

* Add service templates - styleci

* Add service templates - fix notindevicegroup scope

* Add service templates - removed service service_template_changed - not required for delete or update

* Add service templates - removed service service_template_changed - not required for delete or update

* Add service templates - murrant fixes - add protected casts - fix checkbox

* Add service templates - fix checkbox - attempt2

* Add service templates - fix checkbox - attempt3

* Add service templates - fix checkbox - attempt3

* Add service templates - fix checkbox - attempt4

* Add service templates - fix delete row selection

* Revert "Add service templates - fix delete row selection"

This reverts commit 4d9e4990f2.

* Add service templates - fix delete row selection

* Add service templates - fix automatic discovery

* Add service templates - fix automatic discovery

* Add service templates - checkbox - add hidden input

* Add service templates - checkbox - add old value back?

* Add service templates - checkbox - fix disabled

* Add service templates - checkbox - fix disabled

* Add service templates - service fixes - styleci

* Add service templates - make devicegroup required

* Add service templates - let Disable text wrap

* Add service templates - dont allow device group to be deleted when service templates exist

* Add service templates - dont allow device group to be deleted when service templates exist

* Add service templates - enable multiple device groups - wip

* Add service templates - enable multiple device groups - wip

* Add service templates - enable multiple device groups - wip

* Add service templates - enable multiple device groups - dbschema - wip

* Add service templates - enable multiple device groups - db migration - wip

* Add service templates - enable multiple device groups - db migration - wip

* Add service templates - enable multiple device groups - wip

* Add service templates - enable multiple device groups - wip

* Add service templates - enable service template Groups - relationships to device AND device groups

* Add service templates - styleci fixes

* Add service templates - styleci fixes

* Add service templates - fixes

* Add service templates - fixes

* Add service templates - fixes

* Add service templates - fixes

* Add service templates - fixes

* Add service templates - fixes

* Add service templates - fixes

* Add service templates - fixes

* Add service templates - db - primarykey issues

* Add service templates - fix migrations

* Add service templates - fix migrations

* Add service templates - fix migrations

* Add service templates - fix migrations

* Add service templates - fix migrations

* Add service templates - fix migrations

* Add service templates - fix migrations

* Add service templates - fix migrations

* Add service templates - fix migrations

* Add service templates - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - blade view - fixes

* Add service templates - misc update for travis build trigger

* Add service templates - restrict view to only show device/groups that have templates applied

* Add service templates - fix devicegroup update

* remove permissions table stuff

* Fix schema rollback

* fix style

* Update ServiceTemplateController.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
2021-02-02 00:40:11 -06:00
Tony Murray
f2f169ae78
Modernize mempools (#12282)
* mempools to modern module
quick hacky hrstorage port

* port ucd-snmp-mib to Mempools

* Populate DB for ucd
Prep for yaml

* initial yaml attempt

* more complex conversions
fixes to YamlDiscovery, make leading $ optional and allow mib::oid format

* walk full tables and skip values
normalize percentages above 100

* handle precent only ones (specify total as 100)

* Move default polling out of YamlMempoolsDiscovery

* fixes

* Update test data hrstorage should be correct.

* perc_warn for hrstorage

* Host Resources, record buffer, cached, and shared

* Host Resources is always better, don't do both HR and UCD

* fix unix, include warning levels

* variable size

* consolidate skip_values

* define mempools schema

* number instead of integer

* more schema refactor

* one more skip_values reference

* throw error for invalid oid translation
aos6

* a*  and Cisco

* updated test data

* update almost all hrstorage data files

* b*

* c* with test data
use standard cache for hrStorage

* use cache for storage module too

* hand bsnmp properly

* bdcom

* exclude total oid from yaml so it is not polled
May add a way to ignore this behavior and poll it, but I don't know if that is needed.

* automatically handle percent only values

* ciscowlc

* only poll used or free if we have used, free, and total.

* fix skipping

* the dlinkoning
fix find value when value "name" is numeric

* support numeric oids

* dnos/ftos attempt

* I guess we can't filter on total > 0

* edgecos

* e*

* f WIP

* f*

* gwd (aka g*)

* h* + procurve

* i*

* j*

* m*

* support 0% used memory (however unlikely)

* n*

* CISCO-PROCESS-MIB memory, share cache with processors module

* ignore mempools with invalid total

* p*

* quanta

* r*
fix raisecom mibs terribly broken

* s-z

* style fixes

* Move VRP back to PHP and make it actually work

* fix zynos

* update schema

* Update Cisco processor data for description bug fixes

* fix comware processors

* comware mempools with memory size
default precision to 1

* sophos-xg updated data

* hrstorage use ram size for buffers, cache, and shared

* Show memory available instead of free in device overview

* UCD, use same rrd format, store available instead of free in the db.

* Calculate availability for HOST-RESOURCES-MIB

* Convert UCD to standard polling

* rename old rrd files

* initial graph work

* graph WIP

* Graph looking decent

* Graph looking decent for hr

* remove old ucd_graph code

* handle availability mempool
more graph cleanup

* color adjustments

* remove accidental free calculation

* Update test data and fix corner cases

* fis pfsense

* update schema

* add default value for mempool_class

* fix whitespace

* update schema

* update schema correctly

* one more time

* fortigate_1500d-sensors missing oids

* Update docs.

* fix indent

* add implements MempoolsDiscovery explicitly to OS

* remove ucd_memory graph references
remove unused device_memory graph

* remove unused functions

* set devices with mempools to rediscover to prevent/minimize gaps

* use a subquery

* add overview graph

* port health mempools table

* Update device mempool

* only show overview if multiple

* Don't override user set warn percentages in discovery

* fix missed usage

* fix style

* Safety check to not rename rrd files incorrectly if migration has not been run.

* Fix overview percent bar and represent available and used on the bar

* missed an item to convert to mempool_class

* percent on the wrong side
2020-11-23 15:35:35 -06:00
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
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
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
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
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
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
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
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
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
SourceDoctor
1093315700 Merge branch 'master' into app_dhcp_enhancement 2020-06-08 20:51:41 +02:00