Extend reports to perform post-run actions #1341

Closed
opened 2025-12-29 16:31:35 +01:00 by adam · 3 comments
Owner

Originally created by @cslingerland on GitHub (Oct 20, 2017).

Issue type

[x ] Feature request
[ ] Bug report
[ ] Documentation

Environment

  • Python version:
  • NetBox version:

Description

Would it be possible to setup some form of emailing of reports, or an indication that a report was run? This would be good so that management doesn't have to go into Netbox and parse out what they're looking for, and then run the report. I don't think the database would need to be touched unless you wanted to track emails sent.

Originally created by @cslingerland on GitHub (Oct 20, 2017). ### Issue type [x ] Feature request <!-- Requesting the implementation of a new feature --> [ ] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> ### Environment * Python version: <!-- Example: 3.5.4 --> * NetBox version: <!-- Example: 2.1.3 --> <!-- BUG REPORTS must include: * A list of the steps needed to reproduce the bug * A description of the expected behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description Would it be possible to setup some form of emailing of reports, or an indication that a report was run? This would be good so that management doesn't have to go into Netbox and parse out what they're looking for, and then run the report. I don't think the database would need to be touched unless you wanted to track emails sent.
adam added the type: feature label 2025-12-29 16:31:35 +01:00
adam closed this issue 2025-12-29 16:31:35 +01:00
Author
Owner

@jeremystretch commented on GitHub (Oct 23, 2017):

There will likely be many things people want to do after running a report: sending an email, writing a log, calling a webhook, etc. These are all possible now by overriding the run() method, but it would be more convenient to add a post_run() method which report authors can more easily extend.

Related, here's an example showing how to send email in Django. The configured list of administrators is available at django.conf.settings.ADMINS.

@jeremystretch commented on GitHub (Oct 23, 2017): There will likely be many things people want to do after running a report: sending an email, writing a log, calling a webhook, etc. These are all possible now by overriding the `run()` method, but it would be more convenient to add a `post_run()` method which report authors can more easily extend. Related, here's an example showing how to [send email in Django](https://docs.djangoproject.com/en/1.11/topics/email/#quick-example). The configured list of administrators is available at `django.conf.settings.ADMINS`.
Author
Owner

@lampwins commented on GitHub (Oct 23, 2017):

Given there there is consensus that #81 will rely on Django signals, would it also be prudent is put in the effort here to fire signals on report completion?

@lampwins commented on GitHub (Oct 23, 2017): Given there there is consensus that #81 will rely on Django signals, would it also be prudent is put in the effort here to fire signals on report completion?
Author
Owner

@jeremystretch commented on GitHub (Oct 27, 2017):

@lampwins I'll defer the signals work until we have a chance to take a look at the whole project and go through adding signals everywhere they need to be, for both #81 and #1127.

@jeremystretch commented on GitHub (Oct 27, 2017): @lampwins I'll defer the signals work until we have a chance to take a look at the whole project and go through adding signals everywhere they need to be, for both #81 and #1127.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1341