Commit db3d37c3 authored by Matthew Smith's avatar Matthew Smith
Browse files

trivial

parent e9c766d7
......@@ -79,7 +79,7 @@ service_output = os.getenv('SERVICEOUTPUT', '')
long_date_time = os.getenv('LONGDATETIME', '')
notification_author = os.getenv('NOTIFICATIONAUTHORNAME', '')
notification_comment = os.getenv('NOTIFICATIONCOMMENT', '')
user_email = os.getenv('USEREMAIL', '')
email_to = os.getenv('USEREMAIL', '')
performance_data = os.getenv('PERFDATA') # needs to be null to avoid it
netbox_host_name = os.getenv('NETBOXHOSTNAME', host_alias)
if netbox_host_name == '':
......@@ -122,7 +122,7 @@ if DEBUG:
f.write('\nexport LONGDATETIME="{}"'.format(long_date_time))
f.write('\nexport NOTIFICATIONAUTHORNAME="{}"'.format(notification_author))
f.write('\nexport NOTIFICATIONCOMMENT="{}"'.format(notification_comment))
f.write('\nexport USEREMAIL="{}"'.format(user_email))
f.write('\nexport USEREMAIL="{}"'.format(email_to))
f.write('\nexport PERFDATA="{}"'.format(performance_data))
f.write('\nexport NETBOXHOSTNAME="{}"'.format(netbox_host_name))
f.write('\nexport NETBOXPANELID="{}"'.format(grafana_host_panel_id))
......@@ -443,7 +443,7 @@ if DEBUG:
msgRoot = MIMEMultipart('related')
msgRoot['Subject'] = email_subject
msgRoot['From'] = EMAILFROM
msgRoot['To'] = user_email
msgRoot['To'] = email_to
msgRoot.preamble = 'This is a multi-part message in MIME format.'
msgAlternative = MIMEMultipart('alternative')
......@@ -486,7 +486,7 @@ if EMAILUSERNAME and EMAILPASSWORD:
smtp.login(EMAILUSERNAME, EMAILPASSWORD)
try:
smtp.sendmail(EMAILFROM, user_email, msgRoot.as_string())
smtp.sendmail(EMAILFROM, email_to, msgRoot.as_string())
smtp.quit()
except Exception as e:
print("Cannot send mail using SMTP: " + e.message)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment