{"id":18030863,"url":"https://github.com/atc0005/go-lockss","last_synced_at":"2025-09-18T00:32:33.549Z","repository":{"id":38828500,"uuid":"285800536","full_name":"atc0005/go-lockss","owner":"atc0005","description":"Go-based tooling for monitoring and troubleshooting LOCKSS nodes.","archived":false,"fork":false,"pushed_at":"2024-12-23T08:43:14.000Z","size":5876,"stargazers_count":2,"open_issues_count":16,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T19:13:58.202Z","etag":null,"topics":["go","golang","lockss","nagios","node","peer","port"],"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/atc0005.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-08-07T10:19:16.000Z","updated_at":"2024-12-04T16:00:13.000Z","dependencies_parsed_at":"2022-08-09T06:15:34.760Z","dependency_job_id":"ba888f97-b7e3-4080-9355-30bad868a5d2","html_url":"https://github.com/atc0005/go-lockss","commit_stats":null,"previous_names":[],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atc0005%2Fgo-lockss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atc0005%2Fgo-lockss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atc0005%2Fgo-lockss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atc0005%2Fgo-lockss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atc0005","download_url":"https://codeload.github.com/atc0005/go-lockss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233433686,"owners_count":18675603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","golang","lockss","nagios","node","peer","port"],"created_at":"2024-10-30T09:15:24.712Z","updated_at":"2025-09-18T00:32:32.717Z","avatar_url":"https://github.com/atc0005.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- omit in toc --\u003e\n# go-lockss\n\nGo-based tooling for monitoring and troubleshooting LOCKSS nodes.\n\n[![Latest Release](https://img.shields.io/github/release/atc0005/go-lockss.svg?style=flat-square)](https://github.com/atc0005/go-lockss/releases/latest)\n[![Go Reference](https://pkg.go.dev/badge/github.com/atc0005/go-lockss.svg)](https://pkg.go.dev/github.com/atc0005/go-lockss)\n[![go.mod Go version](https://img.shields.io/github/go-mod/go-version/atc0005/go-lockss)](https://github.com/atc0005/go-lockss)\n[![Lint and Build](https://github.com/atc0005/go-lockss/actions/workflows/lint-and-build.yml/badge.svg)](https://github.com/atc0005/go-lockss/actions/workflows/lint-and-build.yml)\n[![Project Analysis](https://github.com/atc0005/go-lockss/actions/workflows/project-analysis.yml/badge.svg)](https://github.com/atc0005/go-lockss/actions/workflows/project-analysis.yml)\n\n\u003c!-- omit in toc --\u003e\n## Table of contents\n\n- [Project home](#project-home)\n- [Overview](#overview)\n- [Status](#status)\n- [Features](#features)\n- [Changelog](#changelog)\n- [Requirements](#requirements)\n  - [Building source code](#building-source-code)\n  - [Running](#running)\n- [Installation](#installation)\n  - [From source](#from-source)\n  - [Using release binaries](#using-release-binaries)\n- [Configuration](#configuration)\n  - [Command-line arguments](#command-line-arguments)\n    - [`hayoh`](#hayoh)\n    - [Worth noting](#worth-noting)\n- [Examples](#examples)\n  - [`hayoh`](#hayoh-1)\n    - [No options](#no-options)\n- [License](#license)\n- [References](#references)\n\n## Project home\n\nSee [our GitHub repo][repo-url] for the latest code, to file an issue or\nsubmit improvements for review and potential inclusion into the project.\n\n## Overview\n\nThis project provides a set of library packages and tools to help with\nmonitoring and troubleshooting LOCKSS nodes.\n\n## Status\n\nAlpha quality.\n\nIn the current state, this project provides a single (usable) application that\nattempts to automatically obtain the list of peer nodes from a central LOCKSS\nproperty/configuration server and check access to 9729/tcp (LCAP) to determine\nwhether the node is accessible for polling, voting and repair purposes.\n\nThe plan is to expose underlying libraries for use elsewhere once some\nadditional \"bake time\" has occurred.\n\n## Features\n\n- Single binary\n  - a nice side-effect is that this makes deployment to LOCKSS nodes easier\n- User configurable logging levels\n- User configurable logging format\n- User configurable timeouts (config file retrieval, port connection tests)\n- User configurable location of LOCKSS configuration/property settings (custom\n  file or URL)\n- User configurable *additional* TCP ports to check\n  - the default is to scan the LCAP port provided in the LOCKSS\n    configuration/property XML file\n\n## Changelog\n\nSee the [`CHANGELOG.md`](CHANGELOG.md) file for the changes associated with\neach release of this application. Changes that have been merged to `master`,\nbut not yet in an official release may also be noted in the file under the\n`Unreleased` section. A helpful link to the Git commit history since the last\nofficial release is also provided for further review.\n\n## Requirements\n\nThe following is a loose guideline. Other combinations of Go and operating\nsystems for building and running tools from this repo may work, but have not\nbeen tested.\n\n### Building source code\n\n- Go\n  - see this project's `go.mod` file for *preferred* version\n  - this project tests against [officially supported Go\n    releases][go-supported-releases]\n    - the most recent stable release (aka, \"stable\")\n    - the prior, but still supported release (aka, \"oldstable\")\n- GCC\n  - if building with custom options (as the provided `Makefile` does)\n- `make`\n  - if using the provided `Makefile`\n\n### Running\n\n- Windows 10\n- Ubuntu Linux 18.04+\n\n## Installation\n\n### From source\n\n1. [Download][go-docs-download] Go\n1. [Install][go-docs-install] Go\n1. Clone the repo\n   1. `cd /tmp`\n   1. `git clone https://github.com/atc0005/go-lockss`\n   1. `cd go-lockss`\n1. Install dependencies (optional)\n   - for Ubuntu Linux\n     - `sudo apt-get install make gcc`\n   - for CentOS Linux\n     1. `sudo yum install make gcc`\n1. Build\n   - for current operating system\n     - `go build -mod=vendor ./cmd/hayoh/`\n       - *forces build to use bundled dependencies in top-level `vendor`\n         folder*\n   - for all supported platforms (where `make` is installed)\n      - `make all`\n   - for Windows\n      - `make windows`\n   - for Linux\n     - `make linux`\n1. Copy the applicable binary to whatever systems needs to run it\n   - if using `Makefile`: look in the subdirectories within\n     `/tmp/go-lockss/release_assets/`\n   - if using `go build`: look in `/tmp/go-lockss/`\n\n**NOTE**: Depending on which `Makefile` recipe you use the generated binary\nmay be compressed and have an `xz` extension. If so, you should decompress the\nbinary first before deploying it (e.g., `xz -d hayoh-linux-amd64.xz`).\n\n### Using release binaries\n\n1. Download the [latest\n   release](https://github.com/atc0005/go-lockss/releases/latest) binaries\n1. Decompress binaries\n   - e.g., `xz -d hayoh-linux-amd64.xz`\n1. Deploy\n   - Place `hayoh` in a location of your choice\n     - e.g., `/usr/local/bin/` (ongoing use) or `$HOME/` (one-off\n       use)\n\n**NOTE**:\n\nDEB and RPM packages are provided as an alternative to manually deploying\nbinaries.\n\n## Configuration\n\n### Command-line arguments\n\n#### `hayoh`\n\n- Flags marked as **`required`** must be set via CLI flag\n- Flags *not* marked as required are for settings where a useful default is\n  already defined, *or* automatically obtained **when run on a LOCKSS node**\n\n| Flag                        | Required | Default                  | Repeat  | Possible                                   | Description                                                                                                                                                                                                                                                                        |\n| --------------------------- | -------- | ------------------------ | ------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `h`, `help`                 | No       | `false`                  | No      | `h`, `help`                                | Show Help text along with the list of supported flags.                                                                                                                                                                                                                             |\n| `p`, `port`                 | No       | *empty list*             | **Yes** | *one valid TCP port per flag invocation*   | Additional TCP port to connect to on remote LOCKSS nodes to verify connectivity. This flag may be repeated for each additional TCP port to check. If not set, this application connects only to the port (usually `9729`) specified in the LOCKSS configuration/property XML file. |\n| `cf`, `config-file`         | No       | *empty string*           | No      | *valid filename*                           | Fully-qualified path to the fully-qualified path to an on-disk copy of the LOCKSS configuration/property XML file, usually named lockss.xml. This is NOT the same file as the /etc/lockss/config.dat file used to bootstrap the LOCKSS daemon at startup time.                     |\n| `cs`, `config-server`       | No       | [*Maybe*](#worth-noting) | No      | *valid URL*                                | Fully-qualified URL to the LOCKSS configuration/property XML file.                                                                                                                                                                                                                 |\n| `v`, `version`              | No       | `false`                  | No      | `v`, `version`                             | Whether to display application version and then immediately exit application.                                                                                                                                                                                                      |\n| `ll`, `log-level`           | No       | `info`                   | No      | `fatal`, `error`, `warn`, `info`, `debug`  | Log message priority filter. Log messages with a lower level are ignored.                                                                                                                                                                                                          |\n| `lf`, `log-format`          | No       | `text`                   | No      | `cli`, `json`, `logfmt`, `text`, `discard` | Use the specified `apex/log` package \"handler\" to output log messages in that handler's format.                                                                                                                                                                                    |\n| `pt`, `port-timeout`        | No       | `2`                      | No      | *any positive whole number*                | Maximum number of seconds allowed for a connection test against a remote TCP port before timing out.                                                                                                                                                                               |\n| `ct`, `config-read-timeout` | No       | `10`                     | No      | *any positive whole number*                | Maximum number of seconds allowed for a request for the LOCKSS configuration XML file before timing out.                                                                                                                                                                           |\n\n#### Worth noting\n\n- When run on a LOCKSS node, and if the `config-server` setting is not\n  specified, an attempt is made to automatically lookup the central\n  configuration/properties server from the local `/etc/lockss/config.dat`\n  file.\n\n- Log format names map directly to the Handlers provided by the `apex/log`\n  package. Their descriptions are copied from the [official\n  README](https://github.com/apex/log/blob/master/Readme.md) and provided\n  below for reference:\n\n  | Log Format (\"Handler\") | Description                        |\n  | ---------------------- | ---------------------------------- |\n  | `cli`                  | human-friendly CLI output          |\n  | `json`                 | provides log output in JSON format |\n  | `logfmt`               | plain-text logfmt output           |\n  | `text`                 | human-friendly colored output      |\n  | `discard`              | discards all logs                  |\n\n## Examples\n\n### `hayoh`\n\n#### No options\n\nThis output is from running `hayoh` (commit `d7a2103`) without any options:\n\n```ShellSession\n$ ./hayoh\n\n[2020-08-16 08.17:56] Starting hayoh version \"d7a2103\" ...\n[2020-08-16 07.30:33] Checking 1 ports on 11 peer nodes ...\n\nPeer            Port    Open    Error\n----            ----    ----    -----\n1.2.3.4         9729    true\n5.6.7.8         9729    true\n2.3.4.5         9729    true\n2.6.4.3         9729    true\n1.3.6.7         9729    true\n9.7.6.5         9729    false   dial tcp 9.7.6.5:9729: connect: connection refused\n3.2.1.6         9729    false   dial tcp 3.2.1.6:9729: connect: connection refused\n7.4.2.1         9729    false   dial tcp 7.4.2.1:9729: i/o timeout\n7.5.2.1         9729    false   dial tcp 7.5.2.1:9729: i/o timeout\n7.8.9.0         9729    false   dial tcp 7.8.9.0:9729: i/o timeout\n5.6.4.2         9729    false   dial tcp 5.6.4.2:9729: i/o timeout\n\nSummary:\n\n- 1 unique ports checked on each of 11 hosts.\n- 45% (5/11) of peer nodes are reachable (at least one open port) from this system.\n- 45% (5/11) of ports scanned are reachable from this system.\n```\n\n## License\n\nTaken directly from the [`LICENSE`](LICENSE) file:\n\n```License\nMIT License\n\nCopyright (c) 2020-Present Adam Chalkley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n## References\n\nVarious references used when developing this project can be found in our\n[references](docs/references.md) doc.\n\n\u003c!-- Footnotes here  --\u003e\n\n[repo-url]: \u003chttps://github.com/atc0005/go-lockss\u003e  \"This project's GitHub repo\"\n\n[go-docs-download]: \u003chttps://golang.org/dl\u003e  \"Download Go\"\n\n[go-docs-install]: \u003chttps://golang.org/doc/install\u003e  \"Install Go\"\n\n[go-supported-releases]: \u003chttps://go.dev/doc/devel/release#policy\u003e \"Go Release Policy\"\n\n\u003c!-- []: PLACEHOLDER \"DESCRIPTION_HERE\" --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatc0005%2Fgo-lockss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatc0005%2Fgo-lockss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatc0005%2Fgo-lockss/lists"}