Compare commits

...

4 Commits

Author SHA1 Message Date
SLW\ARNAUA fd33637741 OPMAAS-4466 - Change recipient for reports 2023-06-21 13:44:38 +02:00
Doris Ruppert (ext.) 255d6c4b9c Pull request #3: OPMAAS-3320
Merge in OPAPM/coco_apm_reporting_token from OPMAAS-3320 to master

* commit '634a87990345e694eb2e5cba632cf87d28b50f54':
  OPMAAS-3320 fixed mail text
  OPMAAS-3320 improved logging
2023-04-18 14:06:55 +00:00
Doris Ruppert 634a879903 OPMAAS-3320 fixed mail text 2023-04-18 16:01:37 +02:00
Doris Ruppert 9eb715a9a0 OPMAAS-3320 improved logging 2023-04-18 15:32:10 +02:00
7 changed files with 9 additions and 7 deletions

2
Jenkinsfile vendored
View File

@ -119,7 +119,7 @@
"""
emailext subject: env.JOB_NAME,
body: 'Please find the output of your reports attached',
to: 'coco-apm@bmw.de, bmw.dynatrace@nttdata.com',
to: 'coco-apm@bmw.de, bmw.dynatrace@nttdata.com, ops-xibix@list.bmw.com, omo-xibix@list.bmw.com, omo@bmwgroup.com',
replyTo: 'coco-apm@bmw.de',
attachmentsPattern: '*.xlsx'

View File

@ -63,9 +63,9 @@ def main():
url = dict(doc[1])
name = dict(doc[0]).get('name')
print("Crawling through: " + item)
print("Check if token exists in environment " + name + " ...")
print("Check if token exists in environment " + name)
if(config(token.get('env-token-name')) != ""):
print("Gather data, hold on a minute")
print("Gather data, hold on a minute ...")
DTTOKEN = config(token.get('env-token-name'))
DTURL = url.get('env-url')
print(args)

View File

@ -38,6 +38,7 @@ def notify(envName,token, subject, notification,notificationAge):
notification.token_id = token["id"]
notification.token_name = token_args[3]
notification.environment = envName
print("Emailing " + to + " about " + subject)
Response = sendMail(to,subject,createNotificationHTML(notification))
except Exception as e:
print(e)
@ -52,6 +53,7 @@ def gatherAndNotify(envName, envUrl, Token, reportOnly, notifyOwner, deactivatio
tokenDisabledSoon = CheckForDisabling(envUrl, Token, reportOnly, notificationAgeInactivity, notifyOwner)
if notifyOwner == True:
print("Notifiying owners in " + envName)
for token in tokenDisabled:
subject = "Deactivation of your Dynatrace Token"
notify(envName,token,subject,TokenDisabledNotification(),0)

View File

@ -49,7 +49,7 @@
</p>
<p class=MsoNormal>
<span lang=EN-GB style='font-family:"Arial Nova Cond Light",sans-serif'>
Please revoke your token as mentioned here {{ notify.helpUrl }} otherwise your token will be deactivated.<o:p></o:p>
Please request a new token as mentioned here {{ notify.helpUrl }}. <o:p></o:p>
</span>
</p>
<p class=MsoNormal>

View File

@ -49,7 +49,7 @@
</p>
<p class=MsoNormal>
<span lang=EN-GB style='font-family:"Arial Nova Cond Light",sans-serif'>
Please request your token as mentioned here {{ notify.helpUrl }}. <o:p></o:p>
Please request a new token as mentioned here {{ notify.helpUrl }}. <o:p></o:p>
</span>
</p>
<p class=MsoNormal>

View File

@ -49,7 +49,7 @@
</p>
<p class=MsoNormal>
<span lang=EN-GB style='font-family:"Arial Nova Cond Light",sans-serif'>
Please request your token as mentioned here {{ notify.helpUrl }}. <o:p></o:p>
Please request a new token as mentioned here {{ notify.helpUrl }}. <o:p></o:p>
</span>
</p>
<p class=MsoNormal>

View File

@ -49,7 +49,7 @@
</p>
<p class=MsoNormal>
<span lang=EN-GB style='font-family:"Arial Nova Cond Light",sans-serif'>
Please request your token as mentioned here {{ notify.helpUrl }}. <o:p></o:p>
Please request a new token as mentioned here {{ notify.helpUrl }}. <o:p></o:p>
</span>
</p>
<p class=MsoNormal>