Create a bash script named silencealerts.sh which will read the AlertManagerSilences file and create an array of the entries
Create a loop in the bash script which will perform the following task per item of the above array: Read the alert.json file and replace KEY w/ alertname and VALUE with the array element
Within the loop also make an HTTP call to post your silence to the following URL: https://alertmanager.admin.doesnotreallyexist.com
Output the array, updated json, and HTTP results to a logfile

Sample Solution

This question has been answered.

Get Answer