Alertmanager-cli is a cli writtin in golang to silence alerts in AlertManager

Alertmanager-cli

alertmanager-cli is a cli writtin in golang to silence alerts in AlertManager

usage: alertmanager-cli [
   
    ]

Flags:

--help                         Show context-sensitive help (also try --help-long and --help-man).
-m, --mode="show"              work mode: create/delete/show silence
--silence-period=2             default period for silenced alerts in hours
-l, --labels=LABELS            comma separated silence matching labels, eg. key1=value1,key2=value2
-c, --creator="auto-silencer"  creator of the silence
-C, --comment="auto-silencer"  comment attached to the silence. Recommended to add the jira ticket
-u, --URL="http://127.0.0.1"   Alertmanager URL
-t, --timeout=3                Alertmanager connection timeout

   

Build the code

Using the makefile we can build, tag and push the cli to docker registry

DOCKERFLAGS := --rm -v $(CURDIR):/app:rw -w /app
BUILD_DEV_IMAGE_PATH := golang:1.16.3-buster
IMAGE_PATH := snigdhasambit/travix-com/alertmanager-cli
REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
export IMAGE_VERSION ?= ${REF_NAME}-$(shell git rev-parse HEAD)

.PHONY: clean
clean:
	rm -rf ./bin/*

.PHONY: build
build: clean
	GOOS=linux go build -a -o ./bin/alertmanager-cli

.PHONY: build-image
build-image:
	docker run $(DOCKERFLAGS) $(BUILD_DEV_IMAGE_PATH) make build
	docker build -t $(IMAGE_PATH):$(IMAGE_VERSION) .

.PHONY: tag-image
tag-image:
	docker tag $(IMAGE_PATH):$(IMAGE_VERSION) $(IMAGE_PATH):$(IMAGE_VERSION)

.PHONY: push-image
push-image:
	docker push $(IMAGE_PATH):$(IMAGE_VERSION)

Create Alerts

./alertmanager-cli -u https://alertmanager.example.com -l alertname="DeprecatedAPIUsageWarning" -m create

Creating silence [creator: auto-silencer, comment: auto-silencer, start: 2022-01-03T17:10:50Z, end: 2022-01-03T19:10:50Z]

Show Alerts

./alertmanager-cli -u https://alertmanager.example.com -l alertname="DeprecatedAPIUsageWarning" -m show

ID: bcba8dec-75ca-4546-8275-c6b2d0db70e6, creator: auto-silencer, comment: auto-silencer, start: 2022-01-03T17:10:50.678848412Z, end: 2022-01-03T19:10:50Z, labels: alertname=DeprecatedAPIUsageWarning

Delete Alerts

./alertmanager-cli -u https://alertmanager.example.com -l alertname="DeprecatedAPIUsageWarning" -m delete

Deleting silence [creator: auto-silencer, comment: auto-silencer, start: 2022-01-03T17:10:50.678848412Z, end: 2022-01-03T19:10:50Z]
Owner
Snigdha Sambit Aryakumar
SRE @ Travix International | Helps building and delivering software faster
Snigdha Sambit Aryakumar
Similar Resources

Jenkins CLI allows you manage your Jenkins as an easy way

Quick start ็ฎ€ไฝ“ไธญๆ–‡ Jenkins CLI Jenkins CLI allows you manage your Jenkins in an easy way. No matter if you're a plugin developer, administrator or just

Jan 4, 2023

Fast, concurrent, streaming access to Amazon S3, including gof3r, a CLI. http://godoc.org/github.com/rlmcpherson/s3gof3r

s3gof3r s3gof3r provides fast, parallelized, pipelined streaming access to Amazon S3. It includes a command-line interface: gof3r. It is optimized for

Dec 26, 2022

A CLI tool for Kafka

A CLI tool for Kafka

Trubka is a Kafka CLI tool built in Go which gives you everything you need to Manage, query and troubleshoot your Kafka clusters. Consume protocol buf

Dec 16, 2022

Easily run your Compose application to the cloud with compose-cli

This CLI tool makes it easy to run Docker containers and Docker Compose applications in the cloud using either Amazon Elastic Container Service (ECS) or Microsoft Azure Container Instances (ACI) using the Docker commands you already know.

Jan 8, 2023

๐Ÿถ Kubernetes CLI To Manage Your Clusters In Style!

๐Ÿถ Kubernetes CLI To Manage Your Clusters In Style!

K9s - Kubernetes CLI To Manage Your Clusters In Style! K9s provides a terminal UI to interact with your Kubernetes clusters. The aim of this project i

Jan 9, 2023

Reward is a Swiss Army knife CLI utility for orchestrating Docker based development environments.

Reward is a Swiss Army knife CLI utility for orchestrating Docker based development environments.

Reward Reward is a Swiss Army knife CLI utility for orchestrating Docker based development environments. It makes possible to run multiple local envir

Dec 9, 2022

A cli that exposes your local resources to kubernetes

A cli that exposes your local resources to kubernetes

ktunnel Expose your local resources to kubernetes ๐Ÿ“ Table of Contents About Getting Started Usage Documentation Contributing Authors Acknowledgments

Jan 7, 2023

Beagle is a CLI written in Go to search for an specific username across the Internet.

Beagle __ \,--------/_/'--o Use beagle with /_ ___ /~" responsibility. /_/_/ /_/_/ ^^^^^^^^^^^^^^^^^^ Beagle is a CLI w

Nov 16, 2022

Prevent Kubernetes misconfigurations from ever making it (again ๐Ÿ˜ค) to production! The CLI integration provides policy enforcement solution to run automatic checks for rule violations. Docs: https://hub.datree.io

Prevent Kubernetes misconfigurations from ever making it  (again ๐Ÿ˜ค) to production! The CLI integration provides policy enforcement solution to run automatic checks for rule violations.  Docs: https://hub.datree.io

What is Datree? Datree helps to prevent Kubernetes misconfigurations from ever making it to production. The CLI integration can be used locally or in

Jan 1, 2023
Wechatbot for prometheus alertmanager webhook

prometheus-wechatbot-webhook wechatbot for prometheus alertmanager webhook Build

Aug 19, 2022
Translate Prometheus Alerts into Kubernetes pod readiness

prometheus-alert-readiness Translates firing Prometheus alerts into a Kubernetes readiness path. Why? By running this container in a singleton deploym

Oct 31, 2022
SLOs, Error windows and alerts are complicated. Here an attempt to make it easy

slo-computer SLOs, Error windows and alerts are complicated. Here's an attempt to make it easy SLO, burn_rate, error_rate, budget_spend are convoluted

Dec 30, 2022
AWS Cloudtrail event alerting lambda function. Send alerts to Slack, Email, or SNS.
AWS Cloudtrail event alerting lambda function. Send alerts to Slack, Email, or SNS.

Cloudtrail-Tattletail is a Lambda based Cloudtrail alerting tool. It allows you to write simple rules for interesting Cloudtrail events and forward those events to a number of different systems.

Jan 6, 2023
A Terraform module that creates AWS alerts billing for your resources.

terraform-aws-billing-alarms terraform-aws-billing-alarms for project Replace name project to New Project agr 'terraform-aws-billing-alarms' 'new-pr

Oct 20, 2021
HSDP Metrics alerts webhook broker and CF events forwarder for Microsoft Teams

hsdp-events Microservice helper to translate HSDP Metrics webhooks to Microsoft Teams webhooks Configuration Environment Description EVENTS_TOKEN Rand

Mar 18, 2022
A cross platform CLI for Flyte. Written in Golang. Offers an intuitive interface to Flyte https://flytectl.readthedocs.io/en/latest/
A cross platform CLI for Flyte. Written in Golang. Offers an intuitive interface to Flyte https://flytectl.readthedocs.io/en/latest/

FlyteCTL Flyte's official command-line interface Documentation ยท Contribution Guide FlyteCTL was designed as a portable and lightweight command-line i

Nov 7, 2022
Kubernetes create pod cli with golang

kubernatestest- Anand #Added more coments Anand2 and K8s #GO COMMANDS to RUN : go run xxx.go to install : go install xyz.go - this created binary file

Dec 2, 2021
CLI tool to setup Golang project.

go-setup CLI tool to setup Golang project. Installation Execute go install github.com/dark-shade/go-setup. Usage A CLI app that provides the ability t

Dec 29, 2021
Golang Cli Tool

step Easy Alias Management tool Arguments step {ALIAS} {COMMAND} init step init Store to create a new alias step store customer_1 -c "ssh user@IP

Oct 24, 2022