diff options
| author | Paul Buetow <paul@buetow.org> | 2026-01-08 21:41:29 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-01-08 21:41:29 +0200 |
| commit | a10cbd4e27d944464cec88aaf49d8b8c354d26e1 (patch) | |
| tree | 0bdd0a23fbb8939c15544b857c74101cb5721a6c /AGENTS.md | |
| parent | f5cffe240c44045684d4f74981235b060828550e (diff) | |
Add Prometheus alert scraping with configurable timeout and host failover
Diffstat (limited to 'AGENTS.md')
| -rw-r--r-- | AGENTS.md | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..ed5e50a --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,73 @@ +# Gogios - Agent Guidelines + +## Project Overview + +Gogios is a lightweight, minimalistic monitoring tool written in Go. It executes Nagios/Icinga monitoring plugins and sends email notifications on status changes. + +## Commands + +### Build +```bash +mage build # Build the gogios binary +go build -o gogios cmd/gogios/main.go # Alternative without mage +``` + +### Development Build (with race detector) +```bash +mage dev # Runs vet + lint, then builds with -race +``` + +### Test +```bash +mage test # Run all unit tests (clears test cache first) +go test ./... # Alternative without mage +``` + +### Lint & Vet +```bash +mage vet # Run go vet +mage lint # Run golangci-lint +mage lintInstall # Install golangci-lint +``` + +### Cross-compile for OpenBSD +```bash +mage openbsd # Build and deploy for OpenBSD +mage buildOpenbsd # Build only +``` + +## Project Structure + +``` +cmd/gogios/ # Main entry point +internal/ # Core implementation + check.go # Check execution logic + config.go # Configuration parsing + dependency.go # Check dependency handling + federated.go # Federated monitoring + html.go # HTML report generation + nagioscode.go # Nagios exit code handling + notify.go # Email notification + run.go # Main run logic + runchecks.go # Check orchestration + state.go # State persistence +``` + +## Code Conventions + +- Go 1.24+ +- Use standard Go formatting (`gofmt`) +- Tests use the standard `testing` package with `*_test.go` suffix +- Internal packages under `internal/` are not exported +- Module path: `codeberg.org/snonux/gogios` + +## Testing + +Tests exist in `internal/` with the `*_test.go` naming convention: +- `federated_test.go` +- `html_test.go` +- `state_test.go` + +Run tests before committing changes. + +For best practices also follow ~/git/conf/snippets/go/go-projects/go-projects.md if present. |
