Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/suer/amp-silence

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/suer/amp-silence

  • v0.0.5
  • Source
  • Go
  • Socket score

Version published
Created
Source

amp-silence

This is a simple CLI to add/delete silences in AMP(Amazon Managed Service for Prometheus) Alertmanager.

Usage

Add silence

$ echo '{
    "startsAt": "2024-06-30T15:00:00.000Z",
    "endsAt": "2024-06-30T23:59:59.000Z",
    "comment": "Maintenance",
    "createdBy": "suer",
    "matchers": [        {
            "name": "host",
            "value": "www.example.com",
            "isEqual": true,
            "isRegex": false
        }
    ]
}' | ./amp-silence add -e https://aps-workspaces.ap-northeast-1.amazonaws.com/workspaces/ws-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/

{"silenceID": "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"}

Required permission: aps:PutAlertManagerSilences

Delete silence

$ ./amp-silence delete -e https://aps-workspaces.ap-northeast-1.amazonaws.com/workspaces/ws-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/ -s yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy

Required permission: aps:DeleteAlertManagerSilence

List silences

$ ./amp-silence list -e https://aps-workspaces.ap-northeast-1.amazonaws.com/workspaces/ws-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/
[{"comment":"Maintenance","createdBy":"suer","endsAt":"2024-06-30T23:59:59.000Z","id":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","matchers":[{"isEqual":true,"isRegex":false,"name":"host","value":"www.example.com"}],"startsAt":"2024-06-30T15:00:00.000Z","status":{"state":"pending"},"updatedAt":"2024-06-29T10:57:20.518Z"}]

Required permission: aps:ListAlertManagerSilences

List workspaces

$ ./amp-silence list-workspaces
[{"Arn":"arn:aws:aps:ap-northeast-1:XXXXXXXXXXXX:workspace/ws-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","CreatedAt":"2024-02-06T08:33:51.749Z","Status":{"StatusCode":"ACTIVE"},"WorkspaceId":"ws-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","Alias":"aaaa","KmsKeyArn":null,"Tags":{}}]

Required permission: aps:ListWorkspaces

Advanced Usage

Query with JMESPath

$ ./amp-silence list -e https://aps-workspaces.ap-northeast-1.amazonaws.com/workspaces/ws-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/ -q "[0].id"
"yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"

Raw output

$ ./amp-silence list -e https://aps-workspaces.ap-northeast-1.amazonaws.com/workspaces/ws-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/ -q "[0].id" -r 
yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy

Build

$ go build

FAQs

Package last updated on 04 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc