Skip to content

Populate the alert rule field with the builder json - #14374

Merged
murrant merged 1 commit into
librenms:masterfrom
murrant:alert-rule-field
Oct 2, 2022
Merged

Populate the alert rule field with the builder json#14374
murrant merged 1 commit into
librenms:masterfrom
murrant:alert-rule-field

Conversation

@murrant

@murrant murrant commented Sep 20, 2022

Copy link
Copy Markdown
Member

That way it isn't empty. (which is unexpected)

#14344

Please note

Please read this information carefully. You can run ./lnms dev:check to check your code before submitting.

  • Have you followed our code guidelines?
  • If my Pull Request does some changes/fixes/enhancements in the WebUI, I have inserted a screenshot of it.
  • If my Pull Request makes discovery/polling/yaml changes, I have added/updated test data.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926
After you are done testing, you can remove the changes with ./scripts/github-remove. If there are schema changes, you can ask on discord how to revert.

That way it isn't empty. (which is unexpected)
$obj['alert_id'] = $alert['alert_id'];
$obj['severity'] = $alert['severity'];
$obj['rule'] = $alert['rule'];
$obj['rule'] = $alert['rule'] ?: json_encode($alert['builder']);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we keep $obj['builder'] = $alert['builder']; line 187 then ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PipoCanaja yes, that is the array of the builder rule... not json. Other option is to remove the "rule" field completely, but since we haven't removed legacy rules (especially from the collection). It doesn't make much sense yet.

@murrant
murrant merged commit 964a672 into librenms:master Oct 2, 2022
@murrant
murrant deleted the alert-rule-field branch October 2, 2022 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants