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

Add manager alert support #572

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

athiruma
Copy link
Collaborator

  • disabled the manager alerts for resources: empty_roles, s3_inactive, nat_gateway_unused, ip_unattached

The following rules will be applied.

  1. ec2_idle - manager in alert
  2. ec2_stop - manager in alert
  3. ebs_unattached - manager in alert
  4. zombie_cluster_resource - No Alerts
  5. zombie_snapshots - manager in alert
  6. zombie_elastic_ips - NO Need manager in alert
  7. zombie_nat_gateways - NO Need manager in alert
  8. s3_inactive - NO Need manager in alert
  9. empty_roles - NO Need manager in alert

@athiruma athiruma added the bug Something isn't working label Mar 14, 2023
@athiruma athiruma requested a review from ebattat March 14, 2023 16:37
@athiruma athiruma self-assigned this Mar 14, 2023
os.system(f"""podman run --rm --name cloud-governance --net="host" -e account="PERF-DEPT" -e policy="{policy}" -e AWS_ACCESS_KEY_ID="{AWS_ACCESS_KEY_ID_DELETE_PERF}" -e AWS_SECRET_ACCESS_KEY="{AWS_SECRET_ACCESS_KEY_DELETE_PERF}" -e AWS_DEFAULT_REGION="{region}" -e dry_run="no" -e LDAP_HOST_NAME="{LDAP_HOST_NAME}" -e special_user_mails="{special_user_mails}" -e account_admin="{account_admin}" -e es_host="{ES_HOST}" -e es_port="{ES_PORT}" -e policy_output="s3://{BUCKET_PERF}/{LOGS}/{region}" -e log_level="INFO" quay.io/ebattat/cloud-governance:latest""")
os.system(f"""podman run --rm --name cloud-governance --net="host" -e account="PERF-SCALE" -e policy="{policy}" -e AWS_ACCESS_KEY_ID="{AWS_ACCESS_KEY_ID_DELETE_PERF_SCALE}" -e AWS_SECRET_ACCESS_KEY="{AWS_SECRET_ACCESS_KEY_DELETE_PERF_SCALE}" -e AWS_DEFAULT_REGION="{region}" -e dry_run="no" -e LDAP_HOST_NAME="{LDAP_HOST_NAME}" -e special_user_mails="{special_user_mails}" -e account_admin="{account_admin}" -e es_host="{ES_HOST}" -e es_port="{ES_PORT}" -e policy_output="s3://{BUCKET_PERF_SCALE}/{LOGS}/{region}" -e log_level="INFO" quay.io/ebattat/cloud-governance:latest""")
elif policy in ('ec2_idle', 'zombie_snapshots', 'ec2_stop', 'ebs_unattached'):
os.system(f"""podman run --rm --name cloud-governance --net="host" -e MANAGER_EMAIL_ALERT="True" -e account="PERF-DEPT" -e policy="{policy}" -e AWS_ACCESS_KEY_ID="{AWS_ACCESS_KEY_ID_DELETE_PERF}" -e AWS_SECRET_ACCESS_KEY="{AWS_SECRET_ACCESS_KEY_DELETE_PERF}" -e AWS_DEFAULT_REGION="{region}" -e dry_run="no" -e LDAP_HOST_NAME="{LDAP_HOST_NAME}" -e special_user_mails="{special_user_mails}" -e account_admin="{account_admin}" -e es_host="{ES_HOST}" -e es_port="{ES_PORT}" -e policy_output="s3://{BUCKET_PERF}/{LOGS}/{region}" -e log_level="INFO" quay.io/ebattat/cloud-governance:latest""")
Copy link
Collaborator

Choose a reason for hiding this comment

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

MANAGER_EMAIL_ALERT="True"
This variable should be True by default in environment variable no need to pass it
Same for EMAIL_ALERT="True"
Meaning that we pass those parameters to the container only when its False.
Can you please fix it for both variables ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@ebattat ebattat changed the title disabled the manager alerts Add manager alert support Mar 14, 2023
Copy link
Collaborator

@ebattat ebattat left a comment

Choose a reason for hiding this comment

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

/LGTM

@ebattat ebattat added Approved enhancement New feature or request and removed bug Something isn't working labels Mar 14, 2023
@ebattat ebattat merged commit 9b265b2 into redhat-performance:main Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants