Want to replace and Email IDs from the alert rules as few members left the organization

Want to replace and Email IDs from the alert rules as few members left the organization

Question:
I wanted to replace email IDs from all alert rules as few members left the organization from RBL and escalation matrix needs to be upadated.

I can find details from kibana index but I don’t have idea about replacing of email Ids.

Can we do it through index or we need to do any update at Db level?

Answer1:
If you want to remove email IDs from many alerts follow the below steps
  1. download the alert JSON file using manage_vienna_data.py [~/workspace/Cairo/tools]
  2. Edit the Alert Json with vim
  3. Use VIM’s search and replace option to remove the email ID’s For example, if you want to delete manojk@vunetsystems.com from an alert, edit the file with vim and run the below command.
    :%s/manojk@vunetsystems.com//g
    Note: Don’t forget to remove the ‘,’ as well in case if the email ID is in the middle of the list. :%s/manojk@vunetsystems.com,//g
  4. Save and upload the alerts back to vuSmartMaps using the same script

  In the future, to avoid these issues you can use email groups instead of the recipient lists. Steps to configure Email-Groups

  1. Go to Settings -> Definitions -> Email Groups.
  2. Add an Email group by clicking the ‘+’ button. Enter details as shown below snapshot.
  3. Use this Email group in Alerts. And if any of the users leave the organization you can come to this email group and delete the particular email id instead of editing all alerts.
Answer2:
If the requirement is for modifying email Id’s in multiple Json files (say 30+ or 50+ files) then performing search and replace in VIM wouldn’t be ideal. Instead we could try running the below command which would search and replace string over multiple files.

grep -rli ‘old-email’ | xargs sed -i ‘s/old-email/new-email/g’

If the activity is to search and remove a particular email id then as Answer1 pointed out — comma to be removed as well

grep -rli ‘old-email’ | xargs sed -i ‘s/old-email,//g’

But wondering, if we modify these Json files and then re-upload would create any duplicates ?


    • Related Articles

    • Info Section In Alert

      Scenario: To set up an alert on ‘no. of corporates for which corporate limit breached > o’, and current count is 18 and along with the alert, we also want to show all 18 corporate names for which the condition is true. Info section in alert ...
    • Device Temperature Alert Issue

      For Device temperature alert, Alert should trigger only if temperature_value > temperature_threshold How to check the above condition? Initially, we are giving a custom threshold in BMV. Temperature_value and temperature_threshold are getting from ...
    • Receiving Errors in logs while trying to use Evaluation Script for populating Additional field in Summary of Alert mail.Same is working perfectly fine for few alerts.

      Refer Below Evaluation Script Used to populate Additional field from BMV to Summary of Alert Mail. def get_vumetric_value(metric_dict, vuMetricName, metricName):   if not metric_dict:     return None   if vuMetricName not in metric_dict:     return ...
    • Automatic health check report-mail setting

      Solution Document Healthcheck Report Mail Settings Overview General/Customer specific General Author Mantika Jadhav Reviewer Rukmini Approver  Ravi  Release date 08/09/2022 Product Version 8.5r5 Steps to be followed to send a health check report via ...
    • Issue With Complete List of Users

      Not able to see complete list of users in following viz.. we are logging in every day with our individual ids, but not able to see our ids apart from Jaydeep’s id. Ids are visible in the index. Bucket size of viz is also not an issue. ANS - The issue ...