{"id":37182849,"url":"https://github.com/vorsprung/bettergoapi","last_synced_at":"2026-01-14T21:05:39.765Z","repository":{"id":257789191,"uuid":"850328357","full_name":"vorsprung/bettergoapi","owner":"vorsprung","description":"go library for setting up and pausing and unpausing BetterUptime Monitors","archived":false,"fork":false,"pushed_at":"2025-04-02T10:56:37.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T11:34:52.429Z","etag":null,"topics":["aws","betterstack","golang","monitoring-automation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vorsprung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-31T13:22:28.000Z","updated_at":"2025-04-02T10:56:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce2dc531-f9ab-43bc-ac22-07613cc8a2fc","html_url":"https://github.com/vorsprung/bettergoapi","commit_stats":null,"previous_names":["vorsprung/bettergoapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vorsprung/bettergoapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorsprung%2Fbettergoapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorsprung%2Fbettergoapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorsprung%2Fbettergoapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorsprung%2Fbettergoapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vorsprung","download_url":"https://codeload.github.com/vorsprung/bettergoapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorsprung%2Fbettergoapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","betterstack","golang","monitoring-automation"],"created_at":"2026-01-14T21:05:38.403Z","updated_at":"2026-01-14T21:05:39.754Z","avatar_url":"https://github.com/vorsprung.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"bettergoapi Uptime API Clients\n-------------------------\nThis is a go library for setting up and pausing and unpausing bettergoapiUptime Monitors\n\nThis can be used to temporarily pause monitoring during patching\n\nIt uses the Uptime API see [Getting started with Uptime API](https://bettergoapistack.com/docs/uptime/api/getting-started-with-uptime-api/)\n\nExample programs are included to set up from a CSV file and to pause and unpause monitors\n\nPrograms using the library\n--------------------------\n| path                            |                            |\n| --------------------------------| -------------------------- |\n| scripts/alarmtoggle/main.go     | alarmtoggle                |\n| scripts/fromCSV/main.go         | fromCSV                    |\n\n\nHow to build alarm toggle for Linux\n-----------------------------------\n    go mod tidy\n    env GOOS=linux GOARCH=amd64 go build -ldflags \"-w -s\" -o alarmtoggle scripts/alarmtoggle/main.go\n\nThis makes a single file static binary that can be copied directly to Intel / AMD hosts and used\nDoes not bundle the TEAM_TOKEN (see below).  This must be in the environment where alarmtoggle is used\n\nRunning alarm toggle\n--------------------\n#### To test script is working\n\n    ./alarmtoggle \n\nShows verbose dump of json of monitors\n\n#### To store all alarm states locally\n\n    ./alarmtoggle  -store=true\n\nalarm states are stored in /tmp/alarms.json\n\n#### To turn off monitors (pause monitors)\n\n   ./alarmtoggle  -set=off -pattern=testrpt1\n\noutput is lines in this format\n\n    2023/04/14 11:53:25 OK paused=true https://romeo.linuxufo.com/state.txt alarm id 1148817\n\npattern match is on the URL only.  It is a substring match.  alarmtoggle -set= only works if -store=true was previously run.  It uses /tmp/alarms.json as a list of alarms\n\n#### To turn on monitors (unpause monitors)\n\n   ./alarmtoggle  -set=on  -pattern=testrpt1\n\noutput is lines in this format\n\n    2023/04/14 11:57:05 OK paused=false https://romeo.linuxufo.com/state.txt alarm id 1148817\n\npattern match is on the URL only.  It is a substring match.  alarmtoggle -set= only works if -store=true was previously run.  It uses /tmp/alarms.json as a list of alarms\n\n#### To run without building\nTo run a local copy without building\n\n    go run scripts/alarmtoggle/main.go  -set=on  -pattern=testrpt1\n\n#### Problem \"patch failed 401 Unauthorized\"\nIf this happens\n\n    2023/04/14 11:59:39 env var not set and failed to get from ssm\n    2023/04/14 11:59:39 patch failed 401 Unauthorized\n    2023/04/14 11:59:39 response was {\"errors\":\"Invalid Team API token. How to find your Team API token: https://bettergoapistack.com/docs/uptime/api/getting-started-with-bettergoapi-uptime-api#obtaining-a-bettergoapi-uptime-api-token\"}\n    2023/04/14 11:59:39 patch failed paused=false https://romeo.linuxufo.com/state.txt alarm id 1148817\n    exit status 1\n\nThe TEAM_TOKEN is not set, see below\n\n#### alarmtoggle all options\n\n| option   | parameter  | default | use or result                                                         |\n| -------- | ---------- | ------- | --------------------------------------------------------------------- |\n| -show    | true/false | false   | when true verbose show as json all monitors.  Do not do anything else |\n| -store   | true/false | false   | write json of monitors to /tmp/alarms.json                            |\n| -set     | on         |         | on monitors force on                                                  |\n| -set     | off        |         | off monitors force off                                                |\n| -set     | last       |         | use previously stored values for pause state of monitor               |\n| -set     | reverse    |         | use opposite of stored values for pause state of monitor              |\n| -pattern | string     |         | only set alarms that substring match this url pattern                 |\n\n\nDependencies\n------------\n * To build, go lang compiler (v 1.23 used during development)\n * Access to bettergoapi Uptime requires API Token, see https://bettergoapistack.com/docs/uptime/api/getting-started-with-bettergoapi-uptime-api/#obtaining-a-bettergoapi-uptime-api-token\n * The API Token should be set as a env variable called TEAM_TOKEN\n * There is code to use a SSM parameter called \"bettergoapi-monitor-token\" to store/retrieve the token but this is not tested\n * The host running the alarmtoggle program needs to have network access to the uptime.betterstack.com api endpoints\n\nFiles\n-----\n| file                |                                                           |\n| ------------------- | --------------------------------------------------------- |\n| client.go           | golang http client                                        |\n| client_test.go      |                                                           |\n| get_monitor_test.go |                                                           |\n| go.mod              | go module config file                                     |\n| go.sum              | go module config file                                     |\n| loadcompare.go      | golang compare monitors (not currently used)              |\n| loadcompare_test.go |                                                           |\n| monitor.go          | golang definition of bettergoapi uptime monitor data structure |\n| save.go             | save monitors as json to file or s3                       |\n| save_test.go        |                                                           |\n\n\nPlatforms\n---------\nTested on Ubuntu 22.04 and MacOS 14.6\ngo version go 1.23.8\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvorsprung%2Fbettergoapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvorsprung%2Fbettergoapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvorsprung%2Fbettergoapi/lists"}