Commit Graph

395 Commits

Author SHA1 Message Date
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
Tony Murray
94f5ed67c5 Remove alert.macros from db schema again. (#8460)
Only affects new installs.
Leave dynamic config settings.
2018-03-23 18:56:27 +00:00
Neil Lathwood
8378834918
fix: Restored config items in sql queries (#8443) 2018-03-21 19:44:12 +00: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
aec567f890 Delete invalid alert maps (#8390) 2018-03-15 14:44:47 +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
Paul Heinrichs
a0c2783d27 alerting: Added Philips Hue as transport (#8320)
* Add Phillips Hue Bridge as Alerting transport

* Add Comment

* Update Transport docs

* Update Phillips to Philips Add sql schema
2018-03-09 19:30:27 +01: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
Drew Hynes
764abde504 alerting: Added Gitlab transport for alerting (#8246)
* gitlab alert transport added

* fixed SQL file and cleaned up a bit

* updated license information

* added relevant information Transports documentation

* Fixed spacing issues

* removed unnecessary text from variable

* fixed sql schema file syntax

* changed sql schema order

* fixed creation of issues for resolution events

* addressed file name conflict

* fixed spacing, again

* removed unused variable

* Update Transports.md
2018-02-27 21:21:37 +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
FTBZ
eb72a5394e feature: Copy all email alerts to default contact (#8178)
* feature: Copy all email alerts to default contact

* change in SQL and add check as requested

* Rename 233.sql to 234.sql

* tab removing
2018-02-05 08:25:24 +00: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
Tony Murray
a98ab6363b fix: Fixed arp-tables duplicate data (#8147)
Truncating the table here, because we could have a massive amount of duplicate rows which could cause php oom.
2018-01-24 20:51:00 +00:00
tukezor
0a6f113f5a device: Improved FortiManager support (#8102)
Modified with suggested changes

Test data for FortiOS
2018-01-24 09:37:27 +00:00
Misha Komarovskiy
df731c165c refactor: Rename cisco-vrf to vrf and enable discovery for junos os (#8033)
* device: Enable cisco-vrf discovery for junos os

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>

* refactor: Rename cisco-vrf module into vrf

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>
2018-01-17 12:09:19 +00:00
Adam Bishop
77e192208a device: Added support for ArbOS (#8055) 2018-01-12 09:02:24 +00:00
Neil Lathwood
42e5819130 refactor: Updated discovery/poller to use numeric sysObjectID (#7922)
* refactor: Updated discovery to use a core module for sysDescr/sysObjectID use

* final update hopefully

* revert changes

* more changes + docs

* migrated poller to use numerical sysObjectID

* more updates for sysObjectID

* update any alert rules which might have enterprises. in

* moved schema file

* small updates

* updated getHostOS()

* scrut fixes

* updated sysObjectId -> sysObjectID

* updated sysObjectId -> sysObjectID

* updated remainder of sysObjectId -> sysObjectID

* another sysObjectId -> sysObjectID

* fixed secureplatform test data

* Fix tests: $device is not pulled from the database before polling
Also, update the db in the core discovery module.
2018-01-06 23:00:47 -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
5d7d99a748 webui: Added Single server details widget (#7923)
* webui: Single Server Details widget

* Labels should fit for windows disks on smaller screens

* Fix for travis ci errors

* Moved js includes to the widget itself

* updated queries for non-admin users + moved schema file
2017-12-21 22:17:02 +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
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
crcro
995b7069eb webui: Added support for stacked graphs (#7725)
* initial release

* newline fix

* missed some graphs in edit

* style fixes

* revert custom function, use Config

* unified config option
added webui graph config entry
added sql entry for webui config

* removed config_id from sql file

* remove graph stack from defaults

* moved transparency and stacked option to functions.php

* style fixes

* style fixes

* changes in code
added docs about stacked graphs

* return keyed array

* new colors and transparency

* sql rename
2017-12-02 20:28:03 +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
c3010ce2ba
Skipped 218 on accident (#7837) 2017-12-01 08:40:46 -06: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
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
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
Tony Murray
d809bddb4e fix: Improve poller validation (#7586)
* fix: improve poller validation
remove failures when there are duplicate poller entries
add warning that there are duplicate poller entries
link to the poller log in the webui
small fix to getBaseURL() to avoid exception when run from cli.

* Re-run poller cleanup to try to reduce the users with duplicates.
2017-10-31 20:32:56 +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
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
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
celalemre
973764e7d3 alerts: Added OpsGenie transport. (#7392)
* Add OpsGenie transport.

* Log response body from OpsGenie only when an error occurs.

* Move OpsGenie SQL config to a new sql file.
2017-09-28 21:20:21 +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
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
7b97e0e761 Attempt to fix repeated sql issue we come across (#7123)
* Attempt to fix repeated sql issue we come across

* renamed sql file
2017-08-14 22:00:41 +01: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
Aldemir Akpinar
34d0fc3199 refactor: Ability to edit default alert template (#7121)
* newfeature: ability to edit default alert template

* Fix style errors

* Added missing db query

* Removed unnecessary code, and added faq section

* Minor documentation about default alert template. And put back wrongly removed lines

* Fixing the silly old mistakes... again
2017-08-12 20:21:13 +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
Aldemir Akpinar
c592f901b0 feature: Added jira alert transport (#7040)
* feature: added jira transport

* Trying to fix travis-ci sql problem

* Surpress mysql warnings

* Fix for typo

* Update Alerting.md
2017-07-19 16:25:03 +01:00
Neil Lathwood
9dd9bc1d49 fix: Updated 113 schema to use 255 chars for index (#7054)
* fix: Updated 113 schema to use 255 chars for index

* update travis to fix php build issues
2017-07-18 16:33:36 -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