Commit Graph

131 Commits

Author SHA1 Message Date
Tony Murray
411a5db269 fix: Fixed Poller taking too long -> device took too long alert rule (#8622)
* Fix poller taking too long rule

* Update alert_rules.json
2018-05-13 20:02:57 +01:00
Tony Murray
1ad7f3138b
Add Laravel to LibreNMS (#8318)
* Add Laravel to LibreNMS.

* Try to set permissions during initial install and first composer update to Laravel.

* Fix composer.lock
Fix missing db config keys

* Start building v1 layout
Port ajax_setresolution, inject csrf into jquery ajax calls
Layout works, building menu
Partially done.

* Fix device group list
remove stupid count relationships

* Print messages for common boot errors.
Don't log to laravel.log file.
Log to error_log until booted, then librenms.log

* Fix up some issues with Config loading
Start of custom directives

* Custom blade directives: config, notconfig, admin

* Preflight checks
Only load config files once.

* Update the composer.lock for php 5.6

* Menu through routing

* Start of alert menu

* Better alert scopes

* reduce cruft in models

* Alerting menu more or less working :D

* Fix style

* Improved preflight

* Fix chicken-eggs!

* Remove examples

* Better alert_rule status queries
Debugbar

* fix app.env check

* User Menu

* Settings bar (dropped refresh)
Search JS

* Toastr messages

* Rename preflight

* Use hasAccess(User) on most models.
Add port counts

* Missed a Preflight -> Checks rename

* Fix some formatting

* Boot Eloquent outside of Laravel
Use Eloquent for Config and Plugins so we don't have to connect with dbFacile inside Laravel.
Move locate_binary() into Config class

* Config WIP

* Try to fix a lot of config loading issues.

* Improve menu for non-admins removing unneeded menus
url() for all in menu

* Only use eloquent if it exists

* Include APP_URL in initial .env settings

* Implement Legacy User Provider

* Helper class for using Eloquent outside of Laravel.
Allows access to DB style queries too and checking the connection status.

* Fix up tests

* Fix device groups query

* Checking Travis

* copy config.test.php earlier

* dbFacile check config before connecting
Don't use exception to check if eloquent is connected, it gets grabbed by the exception handler.
Ignore missing config.php error.

* Fix config load with database is not migrated yet.

* Remove Config::load() from early boot.

* Use laravel config settings to init db (this prefers .env settings)
Fix bgp vars not set in menu
add _ide_helper.php to .gitignore

* Restrict dependencies to versions that support php 5.6

* Update ConfigTest

* Fix a couple of installation issues

* Add unique NODE_ID to .env

* Correct handling of title image

* Fix database config not loading. Thanks @laf

* Don't prepend /

* add class_exists checks for development service providers

* Fix config value casting

* Don't use functions that may not exist

* Update dbFacile.php

* d_echo may not be defined when Config used called.

* Add SELinux configuration steps
More detailed permissions check.
Check all and give complete corrective commands in one step.

* Ignore node_modules directory

* Re-add accidetal removal
2018-05-09 08:05:17 -05:00
Tony Murray
6c04f92877 fix: Fixed port_usage_perc macro (#8625)
We cannot check if the port is enabled inside the macro because it casts the usage percentage to a boolean (1 / 0)

Remove redundant macros.port in rule collection (was check 3 times before this)

Broken by #8511
2018-04-27 14:27:05 +01:00
Tony Murray
81d8060632 Update schema def too... 2018-04-26 11:29:51 -05:00
Neil Lathwood
1eee6e8195 alert: Added ability to make notes for acking alerts + record who did so (#8433)
* alert: Added ability to make notes for acking alerts + record who did so

* Updated schema

* moved sql file

* Updated from comments in PR

* warning changed to blue

* reset notes + keep notes on ack
2018-04-26 00:00:56 -05:00
Neil Lathwood
39aea3da71
fix: Updated ports macros to use %macros.port (#8511)
* fix: Updated ports macros to use %macros.port

* small updates
2018-04-05 22:39:01 +01:00
Søren Rosiak
26bcf89b76 fix: Change rootPort DB data type (#8404)
* fix: Change rootPort DB data type

* Updated schema
2018-03-20 14:01:08 +00:00
Tony Murray
8c94ccf4d6 refactor: Use custom phpcs ruleset for LibreNMS (#8418)
* Use custom phpcs ruleset for LibreNMS
PSR2 with exclusions

* Don't check line length

* Restore build_excludes()
Drop influxdb lib exclusion

* Fix whitespace
2018-03-20 11:32:52 +00:00
Neil Lathwood
03076c4025
feature: Added new alert rule builder UI and rule mapping UI (#8293)
* feature: Added new alert rule builder UI

* Updated to export sql queries

* More updates

* more changes

* removed debug

* fix scrut

* Updated to include import options + various other fixes

* fix rule

* Populate name from collection rules.

* Fix default rule import
Allow new and old style rules in the collection.
Don't add new yet as I'm not sure GenSQL() is working.

* Fix GenSQL call

* Extract filter building to class so it is nicely contained in one place

* moved schema

* some fixes and tweaks

* travis fixes

* Some more features / updates

* Fix up my mistakes when adding default rules

* Use a modal for new alert (Incomplete)
Larger dialog!!
Remove page loading stuff.

Working:
Loading rules, resetting dialog, importing from collection.

Not working yet:
select width
device limited rule access? don't know what this is...

Lots of unused stuff to delete...

* reload "table" after save

* fixed editing rule

* Auto select2 width

* Reload window on save

* Restore per-device alert. Remove debug.

* Small cleanups. Rule Name first.

* Restore button to button type. Rename schema.

* Fixes: wrong command to reload window, remove extra attributes, rule is never passed

* Fixed old rule editing

* some small updates for old imports

* travis update to use trusty

* maybe travis fix

* Ability to set alert rule mappings on the rule edit screen

* pip installs one line, no quiet for deploy

* update schema def

* Fix style and some copyright headers

* fix docs missing file

* Allow new versions of snmpsim and libraries

* Parser WIP

* Fix default rules insert

* reorganize

* Legacy import first draft done

* Implement saving
Skip translation to sql for now

* Working on glues

* small rule collection fix

* Working on glues

* Working on glues

* Docs updates + small UI changes

* Parser WIP

* reorganize

* Legacy import first draft done

* Implement saving
Skip translation to sql for now

* Working on glues

* Working on glues

* Working on glues

* Add table mapping, should move to it's own class

* WIP

* Glue working!!

* Extract Schema class

* Some final touches.
revert alerts_rules.json for now.

* Finish up initial implementation
Needs more tests

* Fix a few places

* small doc updates

* Fix finding tables in grouped rules.

* remove unused code

* code format fixes

* Some quick tests for Schema
Simplified output for findRelationshipPath. Always includes start and target in the result.
This simplifies a lot of code in QueryBuilderParser.php
This also always loads the target table data now (which we want)

* Make bill_id the PRIMARY index for the bills table

* Load macros from a json file in misc instead of the database.

* Fix whitespace and wrong key for collection.

* Handle IN properly when generating SQL

* Fix glue (devices.device_id = ports.port_id) is incorrect :D
Show ALL tables we can resolve relationships for in the query builder filter.

* Remove all macros from the database
Remove insert statements, leave updates to update user's existing rules.
2018-03-14 20:25:19 +00:00
Jason Ellison
84b0b32bd8 Change the column type from varchar(255) to TEXT for nagios-plugins perfdata (#8322) 2018-03-03 22:47:49 +00:00
sorano
1d45d4b73d fix: MySQL query in alert_rules.json (#8300)
Fix the:
MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= (DATE_SUB(NOW(),INTERVAL 5 MINUTE))  &&  syslog.msg REGEXP ".*authentication f' at line 1 (SELECT * FROM syslog WHERE (syslog.device_id = '149') && (syslog.timestamp > = (DATE_SUB(NOW(),INTERVAL 5 MINUTE))  &&  syslog.msg REGEXP ".*authentication failure.*"  ))
2018-02-27 09:22:59 +00:00
Tony Murray
e9c42e3b06 Re-add index to ports_fdb table (#8267) 2018-02-21 09:23:00 +00:00
Tony Murray
1c5b9d3524
Fix bgp peers discovery cleanup (#8263)
Take context into account, update index for that
2018-02-19 09:08:27 -06:00
Tony Murray
1188b53192 security: Use more secure password hashes (#8213)
* More secure password hashes
Use PHP 5.5 password_hash(), currently uses bcrypt
increase password field length as per php documentation

* Use password_hash()/password_verify() for cookies too

* forgot to update db_schema.yaml
2018-02-08 23:08:21 +00:00
dragans
547451974d Update librenms.logrotate (#8220)
* Update librenms.logrotate

- Change path /opt/librenms/logs/*log so that logrotate catches http logs (access_log and error_log).
- Added SU parameter to rotate files with librenms user, as it was throwing insecure permissions error without it.
- Added CREATE parameter to create new log files as librenms user.

* Update librenms.logrotate
2018-02-07 13:44:17 -06:00
Tony Murray
947e53d8cc fix: Fix arp-tables updates (#8180)
* Fix arp-tables updates
Little more complete fix this time.
Don't allow context_name to be nullable...

* update schema file
2018-02-01 09:50:32 +00:00
FTBZ
2755763758 device: Added suspended state to PAN OS (#8125)
* device: add suspended state to PAN OS

* remove bad rules, solution in other PR
2018-01-25 21:08:22 +00:00
Chip Gwyn
f2088a505a fix: Palo Alto HA Alert Rule references non-existent column in sensors table (#8138)
column in the sensors table.  However there is no "type" column.  This should be "sensor_type".  This is indicated
by the error in the logs:

`MySQL Error: Unknown column 'sensors.type' in 'where clause' (SELECT * FROM devices,sensors WHERE (( sensors.device_id = devices.device_id ) && devices.device_id = '102') && (devices.os = "panos" & sensors.type = "panSysHAState"  &&  sensors.sensor_current = "1"  &&  sensors.sensor_prev = "2"  ))
`

Updated the rule to reference the correct column.
2018-01-24 09:18:28 +00:00
Kevin Krumm
88ecbbff24
alert rules: added Dell iDRAC alert rules (#8010)
* alert rules: added Dell idrac alert rules

to the alerts collection.

* Update alert_rules.json

* added iDRAC

fixed iDRAC naming.

* added iDRAC Global System Status Alert
2018-01-05 16:06:49 -06:00
Tony Murray
c91ec3842a Fix bugs in bgp-peers poller (#7976)
* Test Data

* fix bugs in bgp-peers poller
peer data in wrong format
array_diff doesn't work right, change to array_diff_assoc
astext is too short for some
2017-12-29 11:52:49 +00:00
Aldemir Akpinar
56561aa4dc feature: Added support for Host dependencies (#7332)
* First draft of the modals and the config interfaces

* GUI part done

* Backend code and db schema addition

* Documentation added, fixed alerting bug

* Fix typos

* Do not try to push an older db_schame.yaml

* Small db fix

* More db fixes

* Travis CI fixes

* missed a line in the travis error

* Fixed dependency clearing bug, Manage Host dependencies button now shows current selections

* Removed unnecessary index

* Correct faulty query

* Fixed sql query as requested, and renamed sql file

* Added requested changes

* Removed debug code

* Renamed sql file

* More fixes as requested

* Trying to fix db_schema.yaml

* adding laf's diff

* Corrected a small bug

* Try to resolve scrutinizer issue

* Main page bootgrid ajax modifications

* Also corrected travis ci errors

* Added select2 for pull downs, removed a redundant debug output. Changed parent_id to text

* Add missing class in the device settings page

* Fix bug where a link wasn't added after save

* Better parent down detection

* Add missing comma

* Behold the multi-parent code

* Added lookup table

* Ready for testing

* Trying to fix documentation conflicts

* Fix copy paste errors, and possible sql injection

* indentation problems

* Modified db_schema.yaml as well

* Typos, typos

* This should correct alerts

* Try to fix travis ci error

* Fix the typo in index.php

* Changed to Tony's query

* function explanation text changed

* Updated db_schema.yaml

* Trying to make automated tests happy

* Changes as requested

* Added acknowledgment for select2

* Added laf's patch

* dbBulkInsert when adding parents
2017-12-20 14:17:52 +00:00
Tony Murray
e1b74a0b1e fix: Agent tries to insert processes data that is too long (#7891) 2017-12-13 22:35:05 +00:00
bergroth
84fdfdf542 Junos dwdm interface sensor support (#7714)
* Junos dwdm interface sensor support  …
  four new sensors
    Chromatic Dispersion ps/nm
    Delay s (seconds)
    Q_factor (dB)
    preFEC_BER (ratio)

  reuse of
    SNR, dbm, temperature, current

* new dwdm sensors more generic, ber and quality_factor

* new sensors updated

* renamed html graphs new sensors

*  fixed ber polling

* Change to base SI Hz and s.

* update sensor divisors to bigint

* rename sql-schema/216.sql to 218.sql

* YAML junos dwmd sensor definitions, except BER

* bigint divisor fixed

* deafult 1 divisior

* small fixes including schema change for another PR

* schema fix
2017-12-12 20:27:10 -06:00
Tony Murray
b620692426 refactor: Update all applications to store metrics (#7853)
* Update all applications to store metrics

* fix db schema

* Add glue test
2017-12-06 22:13:10 +00:00
Kevin Krumm
f7aed1e203
rules: deafult alert rules, updated the name for (#7861)
Sensor Over/Under to better help users understand where this alert is coming from. :)
2017-12-06 08:04:31 -06:00
Tony Murray
5405498ed6 alerts: Adde generic alerts for state sensors (#7812)
* feature: Generic alerts for state sensors
A bit of a hack, but gets the job done. Perhaps someone can refactor the ResolveGlues() function sometime to make it better.

* Fix mistakes

* Add docs and collection rules, critical enabled by default

* moved schema file to 221.sql
2017-12-02 23:03:36 +00:00
Tony Murray
a21a3fb2b6 feature: Added support Entity State polling (#7625)
* Entity state sensors??

* feature: Entity State polling
Display entity state on the Inventory page.
Allows for alerting based on states.

* fix empty last changed, timezones, alarm parsing, and db updates

* do not display unavailable alarms (80)
add tooltip with state value

* remove debug

* Entity state sensors??

* feature: Entity State polling
Display entity state on the Inventory page.
Allows for alerting based on states.

* fix empty last changed, timezones, alarm parsing, and db updates

* do not display unavailable alarms (80)
add tooltip with state value

* remove debug

* Use a discovery module and only fetch the rest of the data if entStateLastChanged is updated.

* A little more efficient sql use in the case nothing has changed.

* disabled by default, add to docs.

* moved schema file to 220.sql
2017-12-02 20:23:56 +00:00
Tony Murray
4a03e7838e feature: Save application metrics to db for alerting (#7828)
* feature: save application metrics to db for alerting
However, alerting will not work because ResolveGlues() is broken.
Can add workaround after state_translations alerting is merged

Does not update all applications yet, not sure if that should be done here or in another PR.

Introduces two handy functions dbDeleteOrphans() and array_by_column().  Will replace those in other locations after this is merged or separate them out if this is not merged.

* remove accidental inclusions

* Add db schema
2017-12-01 07:53:26 +00:00
Kevin Krumm
b6abf158a0 alerting: Added more rules to collection (#7797)
Comware Sensors PSU, Fan
Cisco Sensors Fan, PSU
UBNT EdgeSwitch Chassis State
2017-11-26 14:32:32 +00:00
Neil Lathwood
b45302bf70 newdevice: Updated Checkpoint Gaia detection and added storage (#7656)
* newdevice: Updated Checkpoint Gaia detection and added storage

* update db_schema

* added murrants discovery options

* Rename 216.sql to 217.sql
2017-11-22 23:28:33 -06:00
Neil Lathwood
ccbe3ea2e3 fix: Use correct entity columns for sensors (#7775)
* fix: Use correct entity columns for sensors

* updated schema

* Update custom rules too
2017-11-21 22:41:22 -06:00
Kevin Krumm
597af28093 alerts: Added in dell server sensors alert rules to the collection (#7647)
* alert rules: alert rules for dell servers

added in dell alert rules to the collection.

* Update alert_rules.json

fixed the ,

* Update alert_rules.json

fixed the "rule":

* Update alert_rules.json

minor fixes and added in MAC address alert. This could be useful when searching for missing devices or rogue devices on your network.

* Update alert_rules.json

removed mac address rule.
2017-11-07 20:21:37 +00:00
FTBZ
aef1a5f28a newdevice: Added state sensors for Palo Alto Networks firewall (#7482)
* Features: Add state sensors for Palo Alto Networks firewall

* Removed the MIBs files

* fix: Removing echo

* Migrate to YAML

* Migrate to YAML

* Change passive to unknow
2017-11-02 21:41:51 +00:00
Neil Lathwood
cb333071c8
fix: Added primary key to perf_times to improve DELETE performance on replicas using ROW based replication (#7493)
* fix: Added primary key to perf_times to improve DELETE performance on replicas using ROW based replication

* moved sql file

* moved sql file

* Rebased

* fixed schema

* moved sql file
2017-10-31 21:08:16 +00:00
Zmegolaz
f8d7ccfe0d feature: Support for up/down detection of ping only devices.
* Added support for ping only devices.

* Renamed sql-schema/206 to 207.

* Discovery tried to detect the OS when it shouldn't.

* Updated db_schema.yaml

* Added ping icon.

* Don't show unused graphs and tabs when SNMP is disabled.

* Allow the user to specify OS of ping only devices.

* Removing custom OS now changes it to 'ping'.

* Removed unnecessary use of mres().

* UI select box for SNMP enable/disable.

* Hide device_ping_perf if ping is disable on device.

* Fixed SNMP settings update status messages.

* Added functionality to add ping only devices via the web ui.

* Added ping only option to addhost.php

* Added ping only support to snmp-scan.py

* Moved sql 208 to 211

* Fixed scrutinizer issues.

* Fixed broken ossearch.

* Added ping only support to the API.

* Updated API doc.

* Added (optional) to OS and hardware description. Hid Port Settings, Applications, Modules, Storage, Processors, Memory and Components from the edit menu

* Style fix.

* Updated ping icon.

* clean() instead of mres(). More escaping. Better help in snmp-scan.py and addhost.php

* Fixed scrutinizer issue.

* Always try SNMP in snmp-scan.py, new option for it in addhost.php. Slice instead of chunk in ajax_ossuggest.php. Other minor style changes.

* Updated sql modifications to insert the new column in the same place as in db_schema.yaml.
2017-10-27 22:59:25 -05:00
Tony Murray
51ba934e11 feature: Added web validation (#7474)
* refactor: convert validations to modules to prep for gui integration

* accidentally dropped, schema update

* fix accidental output to webui

* mention discovery-wrapper.py and re-arrange.

* refine some fix statements

* rename the Config validation group to Configuration.

* fix some scrutinizer issues
remove as many local functions from validator.php as possible
move extensions from pre-check
remove duplicate timezone check
looks like there is some db schema differences between mariadb 10.1 and 10.2, investigating

* mariadb version diff take2

* Check schema version first for database.
Remove stop to go back to command line for install docs.
Add helpful link when there is no devices added to /addhost

* fix incorrect validation for empty string defaults

* Fix style

* Add additional file permissions checks

* catch exception and fail for invalid timezone
Change visuals a bit.

* add php version warning

* fix space
2017-10-26 07:56:09 +01:00
Neil Lathwood
9774acd055 fix: Fixed clickatell alert transport (#7446)
* fix: Fixed clickatell alert transport

* Set a default value for two config columns to ensure mysql strict

* fixed schema

* fixed schema
2017-10-15 23:49:51 -05:00
FTBZ
2e849e1b02 feature: Added more rules for the alert collection (#7430) 2017-10-04 21:02:17 +01:00
kkrumm1
01a48496c8 features: Added HP iLo and OS-updates rules to the rule collection (#7423)
* features: added even more rules to the collection

Added in,
HPE iLo Server drive degraded/failure
HPE iLo Server Power Supply degraded/failure
HPE iLo Server fan degraded/failure
HPE iLo Server CPU degraded/failure
HPE iLo Server Memory degraded/failure
Applications OS-Updates, New Updates Available

* Update alert_rules.json

* fixed some line issues and spaces

* fixed syntax error

* Update alert_rules.json

fixed a ,

* Update alert_rules.json

fixed mistake with {

* Update alert_rules.json

fixed typo at the end
2017-10-04 08:21:16 +01:00
Tony Murray
c0b267b49c refactor: Discovery protocols re-write (#7380)
* refactor: discovery protocols re-write
extract more code to make it easier to read
use snmpwalk_group
walk lldpRemTable instead of lldpRemoteSystemsData
Optimize discover_device to reduce dns lookups of bad dns names
Make discovery_by_ip behavior consistent between cdp and lldp
move can_skip_discovery to discovery functions

Tested lldp, cdp, and ospf.

* always discover links even if the remote device isn't in system
Fix discover_link always updating

* fix style

* fix update, not fetching id

* increase platform length.  Most devices use sysDescr here, which is max length 255

* remove orphaned links

* update db_schema.yaml
2017-10-04 08:16:23 +01:00
FTBZ
e16900456c feature: Added alert rules for RFC1628 UPS to the rule collection (#7415) 2017-10-03 21:34:12 +01:00
Parth Laxmikant Kolekar
101e7426f8 Extend username to varchar(255) (#7395)
* Extend username to varchar(255)

* Updated DB Schema by running build-schema script

* Updated session.session_username to be varchar(255) too
2017-09-29 20:15:48 +01:00
kkrumm1
777eb1f823 feature: Added more rules to the collection of alert rules (#7363)
* Features: Updated collection of alert rules

Added in the following to the Alerts Collection,

Syslog, received Alert Priority Message
Syslog, received Emergency Priority Message
APC UPS Battery Needs Replacement
APC UPS Switched to Battery Power
APC UPS in Hardware Failure Bypass Mode
APC UPS in Emergency Static Bypass Mode

* Update alert_rules.json

* Update alert_rules.json

fixed changes per request.

* Update alert_rules.json

fixed "white spaces and spaces"

* Update alert_rules.json

Fixed spaces and tabs... rookie mistake.
2017-09-20 22:58:24 +01:00
Neil Lathwood
aef79535f4 newdevice: Added support for A10 ACOS devices (#7327)
* newdevice: Added support for A10 ACOS devices
2017-09-17 21:33:09 +02:00
Neil Lathwood
c16ca70c71 fix: Updated graph_types table so graph_subtype has no default value (#7285)
* fix: Updated graph_types table so graph_subtype has no default value

* added schema update
2017-09-04 23:04:33 -05:00
Neil Lathwood
edae33507a feature: Added script to generate config for new OS (#7161)
* feature: Added script to generate config for new OS

* scrut fixes
2017-09-04 21:38:09 +01:00
Tony Murray
0def643e09 feature: Notify about failed updates, block detectable bad updates (#7188)
* Feature: Notify about failed updates, block detectable bad updates
Ability to post notifications when the update fails.
Detect and roll back updates that will cause broken installs. (Needs testing)
Add severity to notifications, critical (2) notifications will display a toast.

This will be used for removing in-tree dependencies and raising the minimum php version.

* Improve naming a bit add phpdoc to new_notification
In case multiple notifications are created, remove them all.

* Remove notifications when update is disabled.

* update travis to use db testing

* added missing index
2017-08-26 21:35:39 +01:00
Neil Lathwood
932b05c38c fix: Updated dump_db_schema() to use default 0 if available (#7225)
* fix: Updated dump_db_schema() to use default 0 if available

* added removed column for testing
2017-08-26 20:23:30 +01:00
Aldemir Akpinar
f6fe6f748b feature: sysV init script for the IRC bot (#7170) 2017-08-20 08:38:24 +01:00
Neil Lathwood
ad6e82b3c7 fix: Fixed dump_db_schema / validate to work with newer versions of MariaDB (#7162)
* fix: Fixed dump_db_schema / validate to work with newer versions of MariaDB

* removed debug
2017-08-17 08:25:45 +01:00
allano337
5dfff2207b feature: Create librenms-irc.service (#7087)
* Create librenms-irc.service

basic systemd start up script goes in /etc/systemd/system/librenms-irc.service it is set to start at boot, but it can be stopped or started just like any other systemd script ie. systemctl start librenms-irc.service

* Small changes
2017-08-16 13:59:02 -05:00
Søren Rosiak
5ed7003b43 fix: Fixed issue with column size of ifTrunk (#7125)
* fix: Fix potential issue with column size of ifTrunk

* renemed sql file

* updated db_schema.yaml
2017-08-12 21:03:17 +01:00
Neil Lathwood
707b6c6954 feature: Added support to cisco sensors to link them to ports + macro/docs for alerting (#6959)
* feature: Added support to cisco sensors to link them to ports + macro/docs for alerting

* renamed sql
2017-08-04 19:37:50 +01:00
Etz
115515f966 fix: Service warning/critical alert rules (#7105)
Name and rule statements were swapped.
2017-08-02 09:20:45 -05:00
Tony Murray
b56c6b6adf fix: fdb tables multiple IPs and IPs from other devices adding extra rows (#6930)
Fix missing IPs because the ARP entries are on different port_id
Update arp discovery to use snmpwalk_group() additional fix in that function
Fix removal of arp entries
Fix a debug output type in fdb discovery
2017-07-04 22:27:43 +01:00
Tony Murray
e8dd72e8db feature: Support fdb table on generic devices (#6902)
* feature: support fdb table on generic devices
refactored code to use snmpwalk_group
refactored ajax table code to use joins and reduce extra queries
add indexes for device_id and port_id, drop primary index
Make all columns sortable
Fix a few other small issues

* Add index for vlan_id since that field can be searched by the user

* fix whitespace

* Rename 197.sql to 198.sql

* set row count for table
2017-06-29 21:03:56 +01:00
Tony Murray
bf0df7266a feature: Added fdb discovery module (#6887)
revert the context_name changes to snmp.inc.php and use the same method as other parts of the code
2017-06-26 13:58:17 +01:00
Neil Lathwood
54365985a6 Revert "feature: fdb tables (#6616)" (#6886)
This reverts commit 81ddab86af.
2017-06-25 07:04:04 +01:00
Lorenzo Zafra
81ddab86af feature: fdb tables (#6616)
* feature: FDB TABLES for ios and timos

* Fixed coding style issues

* renamed fdb.sql to 191.sql

* fixed travisCI issue

* FDB table discovery working on IOS

* Fixed bug: failing to insert fdb entries into database

* Fix phpcbf issue

* moved sql schema

* rename sql schema

* Add (tentative) FDB support for HP Comware switches

* build schema

* schema changes

* run build schema.......

* FBD Table discovery working on HP ComWare

* FBD Table discovery working on HP ComWare

* Add FDB support for HP Comware

* Discovery regex fix, tested and works for cisco 3750, 2960, 6509

* Use vlan_id instead of raw vlan. Remove Nokia implementation as vlans are not being discovered for it at the moment.

* Use vlan_id instead of vlan.

* Add debug messages, comware support

* Sorry.. phpunit isnt working for me

* Use a file structure instead of if statement per OS

* Make inserts to vlan table if entry does not exist.

* Rename sql schema file

* Use existing context name

Improve output and database synchronization

Remove chromephp and if ios

rename sqlfile

add comware back

update schema

* Delete TIMETRA-CHASSIS-MIB

* Delete TIMETRA-FILTER-MIB

* change index to bigint to be safe
2017-06-24 22:07:31 -05:00
kkrumm1
09103b2067 feature: Added syslog auth failure to alert_rules.json (#6847)
feature: Added syslog auth failure to alert_rules.json (#6847)
2017-06-17 15:03:18 +01:00
Neil Lathwood
f72e2ce4b1 fix: Updated sysObjectId column in devices table to varchar(128) (#6832)
* fix: Updated sysObjectId column in devices table to varchar(128)

* correct db_schema
2017-06-13 18:37:21 -05:00
Florian Beer
7442f8d40d feature: Added service alert rules (#6772)
* Add service alert rules

https://community.librenms.org/t/configuring-alerting-via-nagios-plugins/1389/5?u=florianbeer

* Fix escaping

* Update alert_rules.json
2017-06-02 19:51:45 +01:00
Neil Lathwood
895801d855 newdevice: Added more health information for APC units (#6619)
* fix: Fixed apc state support emsOutput

* newdevice: Added more health information for APC devices

* update schema file

* schema file renamed
2017-05-17 22:41:53 +01:00
Neil Lathwood
612186dabf alerting: Added option to enable/disable option for sending alerts to normal users (#6590)
* alerting: Added option to enable/disable option for sending alerts to normal users

* Update notifications.rss

* added missing sql

* Fix schema

* Update notifications.rss
2017-05-15 23:35:26 +01:00
Tony Murray
2dd44fdfdf refactor: move default alert rules into the collection (#6621)
* refactor: move default alert rules into the collection
Also adds the wireless rules to the default set.

* Added additional defaults to extra

* Fix up the extra value
Also, missed `rule` column when creating default rules
2017-05-13 09:24:47 +01:00
Tony Murray
422b2c8ae1 fix: issue with wireless sensors when there are too many oids (#6578)
fixes: 6560
2017-05-04 19:56:25 +01:00
Tim Stallard
6b2ae00e27 fix: Increased speed of loading syslog pages. (#6433)
* Increased speed of loading syslog pages.
I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.

* moved schema 186->189
2017-05-03 22:41:55 +01:00
Tony Murray
4c0412b14d feature: Wireless Sensors Overhaul (#6471)
* feature: Wireless Sensors
Includes client counts for ios and unifi
Graphing could use some improvement.
Alerting and threshold ui not implemented

WIP: starting OO based wireless sensors.

Class based functionality working
remove old functional files
add schema file

discovery needs to be enabled, not polling

fix up schema

fix Unifi discovery not returning an array

Add some debug when discovering a sensor.
Fix style.

Add missing semicolin

Add a null object (Generic) for OS.
Fill out some phpdocs

Re-organized code
Each sensor type now has it's own discovery and polling interface
Custom polling tested with Unifi CCQ

Left to do:
Implement UI (Graphs and Custom thresholds)
Alerting
Testing

Fix event message text

Remove runDiscovery and runPolling from OS, they are unused and don't belong there.

Cleanups/docs

Missed this file.

Remove the requirement to fetch the current value to check validity.
Do that automatically if current is not specified
A few cleanups here and there

First pass at graphing.
device_ and wireless_ graphs added.

Add RouterOS support

Singleton OS instance isn't required right now.
Remove that to allow some memory to be freed.

Add wireless to the device list metrics.
Make all metrics clickable

Tweak graphs a bit

Implement limit configuration page.
Use sensors page as common code instead of duplicating.
Clean up some javascript interactions:  Allow enter on values to save. Cancel if update is not needed. Enable the clear custom button after setting a custom value.
Add some wireless alert rules to the library.

Add documentation.

Add unifi client counts by ssid in addition to radio.
Optimize Sensor polling a bit.

Add HP MSM clients support (for full controller)
Fix function accessibility

Formalize the discovery and poller interfaces.

Add Xirrus clients and noise floor
move module interfaces to a more appropriate place.
push caching code up to os, unsure about this do to the limitations

No point in selectively enabling wireless discovery.  We only discover if the device supports something.

Add RSSI, Power, and Rate.
Add these sensors for Ubnt Airos.
Clean up some copyrights.

Reduce the amount of files need to add new types.
Leave graph files for consistency and to allow customization.

Remove the old wifi clients graph completely.
ciscowlc should have improved counts (total and per-ssid)

Schema didn't get added.

Impelement the rest of the AirOS sensors
Reformat and re-organize the Airos.php class.

Add several UBNT AirFiber sensors

A few fixes add links to the section headers

Add HP MSM mibs.

* Schema file got dropped in rebase.

* Add wireless menu to view sensors across all devices.
Icons in the menu need help :/

* Add HeliOS, Mimosa, and Siklu support
Sensors added SNR + Noise

* Add power and utilization to Unifi

* Update polling to prefetch all sensor data in a few snmp requests as possible

* Add Extendair: tx+rx power, aggregate rate, frequency

* Add a check for duplicate sensors in discovery.  Just print an error for now.

* Add Bit Error Ratio (named error-ratio to allow for bit error rate to be added if needed)
Fix an incorrect link in the wireless sensors table

* Add error rate and change all bps and Hz to use si units

* Fixes to limits and frequency display

* Fix overview graph frequency display
A few decimal place tweaks

* Don't allow switching sensor and wireless-sensor graphs, it doesn't work.
Change individual distance graphs to use si units

* Go through the OS and make sure I got all the sensors I can (probably missed some still)
Because pollWirelessChannelAsFrequency() is generic and a little complex, so pull it up to OS.
Message to help developers adding supports that don't return an array from discover functions.

* Fix some issues

* Remove noise and signal for now at least
A couple more fixes
Add a notification

* Oopsie

* Bonus AirFiber sensors
2017-05-01 23:49:11 -05:00
Aldemir Akpinar
450c980cc1 Fix: Service filenames are snipped when longer than 16 characters (#6459)
* Do not show unintended debug messages

* Fix the silly mistake

* Change Cisco UCM category from tele to telephony

* Added telephony definitions

* Changed the category to collaboration as agreed

* Fix snipped service filenames

* rebased

* rebased + fixed schema
2017-04-19 11:52:13 +01:00
Xavier Beaudouin
4b0972628f Coriant Network Hardware Page. (#6187)
* Fix the definition. Should be mef instead of mef-evc

* Added Coriant TNMS Hardware page.

* Polling and discovery modules for TNMS Network Equipements.

* SQL in one line.

* Only show when OS is coriant

* Fix conflict file

* Conflict file

* Added missing COLLATE

* Refactor poller code for more data to be inserted into DB in the future.
Removed the discovery module and merged it into poller code.

* Removed tnms-nbi discovery also in the yaml

* Removing debug

* Code updates and fixes + schema rename

* bootstrapify the code.
Renamed the sql file

* Bloody tabs !

* Add db_schema.yaml update.
2017-04-12 10:39:02 +01:00
Tony Murray
55162129ff Update schema manually (#6362)
Allow build-schema.php to be run by hand more easily.
2017-04-05 09:06:11 -05:00
Neil Lathwood
03deb6434a feature: Added ability to validate database schema (#6303)
* feature: Added ability to validate database schema

* small scrut fixes

* Check for extra tables and columns
Print 30 items of schema updates, easier to copy paste sql

* Now supports detections and suggested fix for:
tables: missing, extra
columns: missing, extra, incorrect
indexes: missing, extra, incorrect

* final changes + hook into travis
2017-04-05 09:00:28 +01:00
towster
fea705b7f5 alerts: Added new alert rules to collection (#6166)
Added Interface Errors Rate greater than 100
Added Device discovered within the last 60 minutes
2017-03-15 15:41:12 +00:00
Todd Eddy
a8c04460f4 docs: Add logrotate config and update install docs (#5520) 2017-01-21 11:11:22 +00:00
laf
0bd08690f3 Updated alert_rules.json with more examples 2016-11-03 07:52:05 +00:00
laf
8a142aa53f feature: Added the option to select alert rules from a collection 2016-10-29 10:56:59 +00:00
Tony Murray
122aae85bf webui: Relocate Alerts menu
Plugins menu is moved to the Overview menu (this is basically just weathermap anyway)
2016-09-11 23:41:41 -05:00
laf
c14577db34 Added alert log purge setting - defaults to 365 2016-05-02 19:06:51 +00:00
Richard Lawley
2455feb1c9 Scrut fix + Notification 2016-03-07 18:41:51 +00:00
Tony Murray
2af1b517e5 Notifcation and tab->spaces fix. 2016-03-03 06:46:39 -06:00
laf
a45259377b Added local rss file + tidied up locations of notifications and callback 2016-01-19 21:50:00 +00:00