Skip to content
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

Correct bug email ticket_id #145

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Watcher/Watcher/frontend/static/frontend/main.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Watcher/Watcher/frontend/static/frontend/main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ object-assign
http://jedwatson.github.io/classnames
*/

/*!
* Chart.js v2.9.4
* https://www.chartjs.org
* (c) 2020 Chart.js Contributors
* Released under the MIT License
*/

/** @license React v0.19.1
* scheduler.production.min.js
*
Expand Down
9 changes: 4 additions & 5 deletions Watcher/Watcher/site_monitoring/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def create_alert(alert, site, new_ip, new_ip_second, score):
time.sleep(random.uniform(1, 3))

# Send an email for the alert
send_email(alert_data['type'] + " on " + site.domain_name, site.rtir, new_alert.pk)
send_email(alert_data['type'] + " on " + site.domain_name, site.ticket_id, new_alert.pk)

# Manage MX records for mail changes
if 'Mail' in alert_data['type']:
Expand Down Expand Up @@ -417,13 +417,13 @@ def create_alert(alert, site, new_ip, new_ip_second, score):
mail_A_record_ip=site.mail_A_record_ip,
mail_A_record_ip_second=site.mail_A_record_ip_second)

def send_email(message, rtir, alert_id):
def send_email(message, ticket_id, alert_id):
"""
Send Email alert.

:param alert_id: Alert ID.
:param message: Subject email end message.
:param rtir: Identification number of RTIR.
:param ticket_id: Identification number for the case managment software.
:return:
"""
emails_to = list()
Expand All @@ -433,12 +433,11 @@ def send_email(message, rtir, alert_id):

# If there is at least one subscriber
if len(emails_to) > 0:
# RTIR Ticket
try:
msg = MIMEMultipart()
msg['From'] = settings.EMAIL_FROM
msg['To'] = ','.join(emails_to)
msg['Subject'] = "[" + settings.EMAIL_SUBJECT_TAG_SITE_MONITORING + " #" + str(rtir) + "] " + message
msg['Subject'] = "[" + settings.EMAIL_SUBJECT_TAG_SITE_MONITORING + " #" + str(ticket_id) + "] " + message
body = message
body += u"""\
Alert ID: """ + str(alert_id)
Expand Down
Loading
Loading