Skip to content

bvdwalt/pinger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pinger

A simple Go application that periodically pings HTTP endpoints on a configurable cron schedule.

Features

  • Configure multiple endpoints to ping via YAML
  • Cron-based scheduling (e.g., every 5 minutes)
  • Custom API key header support
  • Custom User-Agent header support
  • Full HTTP request/response logging for debugging and monitoring
  • Parameterized endpoints with iterations (ping multiple organizations with one config)
  • Logs response status codes and duration
  • Graceful shutdown

Installation

Homebrew (macOS / Linux)

brew install --cask bvdwalt/tap/pinger

From source

git clone https://github.com/bvdwalt/pinger.git
cd pinger
just build

Usage

  1. Copy the example configuration:

    cp config-example.yaml config.yaml
  2. Edit config.yaml with your endpoints and API key

  3. Run the pinger:

    just run

Configuration

The config.yaml file supports:

  • schedule: Cron expression (e.g., */5 * * * * for every 5 minutes)
  • timeout-seconds: HTTP request timeout in seconds
  • api-key-header-name: Header name for API authentication
  • api-key-value: Your API key
  • user-agent: Custom User-Agent header (optional)
  • endpoints: List of endpoints to ping
    • Simple endpoints with name, url, and method
    • Parameterized endpoints with iterations for dynamic URL/name substitution

See config-example.yaml for examples.

Logging

Pinger logs all HTTP activity including:

  • HTTP request details (method, URL, headers)
  • HTTP response status and headers
  • Endpoint response time and status code
  • Any errors encountered during requests

This comprehensive logging is useful for:

  • Debugging endpoint issues
  • Monitoring API availability
  • Tracking response times
  • Identifying configuration problems

Development

just build          # Build the binary to ./pinger
just run            # Build and run the application
just test           # Run all tests
just test-verbose   # Run tests with verbose output
just test-coverage  # Run tests with coverage report (outputs coverage.html)
just fmt            # Format all Go code
just lint           # Run golangci-lint
just clean          # Remove build artifacts

About

A simple Go application that periodically pings HTTP endpoints on a configurable cron schedule.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors