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`
PR 183 from librenms-agent contains the script to make this work
https://github.com/librenms/librenms-agent/pull/183
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`
* Initial start on new templating support
* further updates
* more updates
* More working version
* Last fixes
* Small updates
* modified test to look for dbname.
* Schema update
* Added fix for not being able to disable Philips Hue transport
* Updated sql file
* Updated db_schema
* Set myclabs/deep-copy to be 1.7.x version in composer
* Fixes from murrant
* Forced nikic/php-parser to version 3.1.x in composer
* Updated composer to use custom fork of string-blade-compiler + fixed transport use
* Updated to always use correct template
* Merged legacy and blade templating engines
* Removed template type + fixed test-alert.php
* Added more template placeholders
* Added ability to reference data in templates as $alert->X
* Updated docs for templates
* Updated db_schema.yaml
* Added $alert->builder
* Clarify the use of $alert->builder
* Fixed the use of $alert->transport
* renamed schema file
* Added template validation
* Small update to fix travis issue
* Add Docs text to title bar
* Updated amqp to new of version
* Consistency in alert rule and template title bars
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.
- [ ] 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`
Mostly useful for debugging
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`
Minor errors
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`
I've rewritten the smokeping config docs after setting it up on a couple machines with LibreNMS.
Probably best to not do a diff, but just read the whole new proposed version. I've rewritten a lot of it, and tried to make the flow a lot better.
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`
Currently has a file handle leak (and will eventually run out of handles) related to the self update process.
Either need to fix that or rip out self-update and leave that up to cron or something.
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`
Now with optparse (python 2.3+)
Does not include your doc updates @laf
If I get some time later, I'll add them, feel free to as well.
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.
- [ ] 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`
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.
- [ ] 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`
* Ability to enable debug output with wrappers
Output is redirected to a per-device file in the log directory.
* Add warning
* Added some docs to help with debugging using this new option
Changed some values to be explicitly boolean
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`
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`
AS per https://community.librenms.org/t/raspbian-sudo-warnings/1880, raspbian does not use 'snmp' as the user for snmpd.
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`
Nothing major, just spotted it as I went through the docs.
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`
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`
This patch provides the ability to override most aspects of the configuration output provided to Oxidized. This is now backwards compatible with any current groups defined previously but allows for extra features such as group overrides in Oxidized as well as IP changes (for hosts that are treated differently inside Oxidized), as well as ProxyHost additions. Of course, this goes further and allows for any flag that can be defined within Oxidized to be mapped in the config.
Examples
1) Define a group for these hosts
```php
$config['oxidized']['maps']['group']['sysname'][] = array('regex' => '/^(foo|bar)/', 'group' => 'myGroup');
$config['oxidized']['maps']['group']['sysname'][] = array('regex' => '/^(baz)/', 'group' => 'anotherGroup');
```
2) Provide a proxy host for these hosts to bounce through
```php
$config['oxidized']['maps']['ssh_proxy']['sysname'][] = array('regex' => '/foo/', 'ssh_proxy' => 'mySshProxyHost');
$config['oxidized']['maps']['ssh_proxy']['sysname'][] = array('regex' => '/bar/', 'ssh_proxy' => 'anotherSshProxyHost');
```
3) Allow overrides of IP addresses so the external DNS is not used for connections
```php
$config['oxidized']['maps']['ip']['sysname'][] = array('regex' => '/baz/', 'ip' => '10.10.0.23');
$config['oxidized']['maps']['ip']['sysname'][] = array('regex' => '/lala/', 'ip' => '192.168.0.243');
```
As already mentioned, this doesn't stop with the above examples.
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`
* Added new plugin menu_option in the "port" page, which contain hook calling public function port_container($device, $port) in plugins
* Cleaning after pre-commit error
* New method in Plugins.php to allow counting all plugins implementing a specific hook. This allow conditionnal display of the plugin menu_option in the port view.
* Typo after rebase
* Update plugins.inc.php
* Updating the documentation with device_overview_container and port_container hooks.
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`
May cause warnings about poller not polling if the name doesn't match exactly as the old one.
Just delete from /pollers
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`
* Updated CentOS (Apache) installation instructions
Added a few steps I think might be useful to first time Libre users.
* Update Installation-CentOS-7-Apache.md
* Added proposed changes from the comments sections
* Update Installation-CentOS-7-Nginx.md
* Update Installation-Ubuntu-1604-Apache.md
* Update Installation-Ubuntu-1604-Nginx.md
* Updated MySQL entry.
Cleaned up MySQL entry. Had somewhat duplicated Agent entries that might cause confusion. One was before the snmp extend entry, and the other after. This might cause people to believe both are needed. I cleaned it up and merged the agent entries.
Added comment at top to clarify that only one detection method is needed.
* Fixed highlighting
* Update to add acl on list of necessary package
Add acl package for the installation of Librenms
* Change sort
add acl to first
* Change file to add acl package
* 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
* 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.
* Documentation updates for DMI support and making two links in the FAQ work
* Update SNMP-Configuration-Examples.md
* Update SNMP-Configuration-Examples.md
* Update snmpd.conf.example
* Update SNMP-Configuration-Examples.md
* Updated XIRRUS-MIB; added Temperature
* Corrected field and indentation
* Added test data
* More test data
* Create xirrus_aos.json
* Reordered metrics back into alphabetical
* update to reflect changes to the SMART SNMP extend
* minor grammatical change
* update to reflect the default of SN and expand info on that all a bit
* Update Applications.md
The snmp-extend method should really be advocated as the preferred method, as it is the easiest and quickest.
* Update Applications.md
* Update Applications.md
Is this what you meant?