New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Copy all email alerts to default contact #8178

Merged
merged 4 commits into from Feb 5, 2018

Conversation

Projects
None yet
4 participants
@FTBZ
Contributor

FTBZ commented Jan 31, 2018

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.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926


  • Add a way to copy all email alerts to default contact without ignoring other methods.

screen shot 2018-01-31 at 15 09 41

Thanks @laf for the help.

@@ -317,6 +317,11 @@ function GetContacts($results)
}
}
# Copy all email alerts to default contact if configured.
if ($config['alert']['default_copy'] === true) {
$tmp_contacts[$config['alert']['default_mail']] = '';

This comment has been minimized.

@laf

laf Jan 31, 2018

Member

Before assigning it to $tmp_contacts, you need to check it doesn't exist already :)

@@ -0,0 +1 @@
INSERT INTO `config` VALUES (798,'alert.default_copy','true','true','Copy all email alerts to default contact','alerting',0,'general',0,'0','0');

This comment has been minimized.

@laf

laf Jan 31, 2018

Member

This is breaking travis, you shouldn't insert the entry with a config_id set as they are auto incrementing.

See sql-schema/221.sql on how to do it.

@murrant murrant added the Schema label Feb 2, 2018

@@ -317,6 +317,11 @@ function GetContacts($results)
}
}
# Copy all email alerts to default contact if configured.
if (!isset($tmp_contacts[$config['alert']['default_mail']]) && ($config['alert']['default_copy'])) {
$tmp_contacts[$config['alert']['default_mail']] = '';

This comment has been minimized.

@laf

laf Feb 2, 2018

Member

This has a tab in from what I can see, needs replacing for 4 spaces :)

This comment has been minimized.

@FTBZ

FTBZ Feb 3, 2018

Contributor

Oops, but I can't commit anymore: "error: failed to push some refs"

This comment has been minimized.

@laf

laf Feb 3, 2018

Member

You might need to git pull first.

@scrutinizer-notifier

This comment has been minimized.

scrutinizer-notifier commented Feb 5, 2018

The inspection completed: 698 Issues, 29 Patches

@laf

laf approved these changes Feb 5, 2018

@laf laf merged commit eb72a53 into librenms:master Feb 5, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

inetAnt added a commit to criteo-forks/librenms that referenced this pull request Mar 19, 2018

feature: Copy all email alerts to default contact (librenms#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
@lock

This comment has been minimized.

lock bot commented May 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 16, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.