Commit Graph

11 Commits

Author SHA1 Message Date
Tony Murray
04bb75f5f3
Alert transport cleanup, no_proxy support and other proxy cleanups (#14763)
* Add no_proxy and other proxy related settings
Set user agent on all http client requests
Unify http client usage

* Style fixes

* Remove useless use statements

* Correct variable, good job phpstan

* Add tests
fix https_proxy bug
add tcp:// to the config settings format

* style and lint fixes

* Remove guzzle from the direct dependencies

* Use built in Laravel testing functionality

* update baseline
2023-05-23 09:25:17 -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
Jellyfrog
258505ed44
Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Jellyfrog
20b4215204
Swich links to https (#12511)
* Switch librenms links to https

* Convert librenms links in comments

* Switch gnu.org url to https

* switch php urls to https
2021-02-09 00:29:04 +01:00
Jellyfrog
0d56bbd946
Apply fixes from StyleCI (#12123) 2020-09-21 15:51:53 +02:00
Jellyfrog
77c531527c
Apply fixes from StyleCI (#12117)
* Apply fixes from StyleCI

* Disable style check
2020-09-21 14:54:51 +02:00
Tony Murray
f0d68a1ad8
Update PHP dependencies (#11377)
* Update composer dependencies
Fix PSR-4 violations

* Actually support PHP 7.1 :D

* all trap tests should extend SnmpTrapTestCase
2020-04-03 17:13:18 -05:00
Tony Murray
e18f4522d5
Update to Laravel 5.7 (PHP 7.3 support) (#9800)
* Move assets to 5.7 location

* Add 5.7 SVGs

* add cache data dir

* update QUEUE_DRIVER -> QUEUE_CONNECTION

* Update trusted proxy config

* update composer.json

* 5.5 command loading

* @php and @endphp can't be inline

* Laravel 5.6 logging, Nice!

* Update blade directives

* improved redirects

* remove unneeded service providers

* Improved debugbar loading

* no need to emulate renderable exceptions anymore

* merge updated 5.7 files (WIP)

* Enable CSRF

* database_path() call causes issue in init.php

* fix old testcase name

* generic phpunit 7 fixes

* add missed file_get_contents
Keep migrations table content

* fix duplicate key

* Drop old php versions from travis-ci

* remove hhvm

* fix code climate message

* remove use of deprecated function assertInternalType

* Disable CSRF, we'll enable it separately.
All forms need to be updated to work.

* Update document references
2019-02-12 17:45:04 -06:00
vivia11
e1118b628a Added Alert Transports Mapping (#8660)
Hello all,
I guess this is the second version of a more fully fleshed out alert contact mapping feature. The old one was GH-8507

Transports to convert:

  - [x] API
  - [x] Cisco Spark
  - [x] Elasticsearch
  - [x] GitLab
  - [x] Philips Hue
  - [x] Jira
  - [x] Mail
  - [ ] ~~PagerDuty~~ - Requires a callback so leaving for now
  - [x] Nagios
  - [x] IRC
  - [x] Discord
  - [x] Rocket.chat
  - [x] Hipchat
  - [x] Pushover
  - [x] Boxcar
  - [x] Telegram
  - [x] Pushbullet
  - [x] VictorOps
  - [x] OpsGenie
  - [x] Clickatell
  - [x] PlaySMS
  - [x] Canopsis
  - [x] osTicket
  - [x] Microsoft Teams
  - [x] SMSEagle
  - [x] Syslog
  - [x] Slack

The intention is for this feature to have three different levels to it:
1. Alert rule to an alert contact mapping (where the code is at now)
2. Alert rule to an alert group (made up of alert contacts) mapping
3. Alert contact mapping to different transport configurations.

There will be three transport configuration types.
1. Default (the configuration that is held in the configs table)
2. None (no transport configuration - will explain later)
3. Other (a configuration that will be defined in a different able)

Take Mail transport for example. It can either be of a "default" or "other" configuration. The hope is that in the future, users can send mail from different mail servers if they wish.
However, for ciscospark which requires a room ID and an api-token, I've decided that it has no transport configuration. Most likely, every alert contact will contain a different room-id and an api-token - which is why it has the transport config of "none".
For other transports : I am not familiar with them, so hopefully the community can add support for these. I can definitely help!

To add support for each transport will require several things:
- addition to the UI
- addition to forms/alert-contacts.inc.php
- modifications to its object class

Screenshots
![image](https://user-images.githubusercontent.com/28970851/39594533-2092ce9e-4eca-11e8-9c5d-cd002ece1425.png)
![image](https://user-images.githubusercontent.com/28970851/39594544-276e9856-4eca-11e8-80cc-82789ee0b2b2.png)
![image](https://user-images.githubusercontent.com/28970851/39594553-2fdf528c-4eca-11e8-8a40-4f149e767054.png)

I'm not sure if this is the best way to do things, so please let me know if there's a better way to structure the code! Any comments on code/db schema,/UI etc is welcome and encouraged! 

The UI is heavily based on alert rules (front end is not my strong suit). And parts of the code are based on the code that was written for alert rules.

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-07-21 20:34:59 +01:00
Tony Murray
fff66d3c00
Feature: Generic discovery and poller tests (#7873)
* Processor Tests!

* Capture data from live devices easily.

* fix up some stuff, remove powerconnect things as they seem to be just broken.

* formatting, fix missing assignment
add netonix processor data

* fix multi-line, always add sysDescr and sysObjectID
ios cpm test file

* revert composer change and fix whitespace issues

* add help text

* missed help text

* tighter debug output

* handle empty strings properly and mibs with numbers

* use keys for sorting as intended

* fix type with empty data

* oops :)

* whitespace fix

* try installing fping

* Fix TestCase collision + cleanup

* mark TestCase as abstract
don't run two instances of snmpsim

* better database dumps, improved capture

* style fixes

* fix quotes add a few more tables

* add --prefer-new, properly merge data

* Support separate discovery and poller data. But don't waste space if they aren't needed.

* refactor to use class
collects all code in one place for reusability

* reorganize

* Print out when not saving.

* Support for running multiple (or all) modules at once.

* tidy

* Change unit test to a generic name and test all modules we have data for.

* Add documentation and a few more tidies

* whitespace fixes

* Fix tests, add a couple more modules, more docs

* More docs updates

* Fix scrutinizer issues

* add bgp-peers
2017-12-20 08:36:49 -06:00
laf
8a142aa53f feature: Added the option to select alert rules from a collection 2016-10-29 10:56:59 +00:00