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`
* Expand the description of Application support
I was not aware that the applications can also be auto-discovered. I discovered it by chance, and when I mentioned it in discord channel, it seemed blatantly obvious to everyone else. Thought editing the docs might help future users.
* Update Applications.md
Changed a lot of instructions to make it more structured.
* Add files via upload
Addedimages to help with application extensions how-to.
* Update Applications.md
Added the file locations into master file.
* 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.
* device: Rittal IT Chiller / Carel pCOweb
* doc: more documentation about the pcoweb card
* Update Carel-pCOweb-Devices.md
* change the limit for sensors and small changes
* fixed db_schema
* doc updates and sql fix
* doc update
* remove the eer graph to create a sensor
* docs: Continue to reorganize things
Make landing pages for /Installation, /API, etc.
Split API out into multiple docs
Properly use multi-level navigation
Add lower nav buttons (tops are bug so disable for now)
Add logo for fanciness
Refine index page a bit
* Improve API TOC layout
* Couple of fixes.
* Fix API/API-Docs, assumed it was at the right url.
* docs: testing alert rule link
added link to the device troubleshooting page.
* Update Rules.md
fix link
* Update Testing.md
fix link
* Update Rules.md
removed link - not useful for this part.
* image for alert rules collection
* image for alert rules collection
added image alert rules collection
* docs: Weathermaps minor fix to the steps
minor fix to the steps cut down to 5 steps. and added in example pic.
* network weather map
example network weather map picture
* Update Weathermap.md
added pic to .md
* Delete network-weather-map.PNG
* network weather map example pic
example pic.
* changes to steps
* Update Weathermap.md
added or to user
* Update Weathermap.md
* Update Weathermap.md
* Update Weathermap.md
fixes for grammar and spelling.
* Update Weathermap.md