Git Product home page Git Product logo

swatchdog's Introduction

swatchdog - simple watchdog!

Just... Send an HTTP request per interval to a given URL. You can use any uptime monitoring service to monitor your machine.

Download & Install

The latest version is available at GitHub Releases. It's just a single binary file, so you can download it and run it directly.

Usage

Just as simple as... No need to explain anything! Just run it with --help to see the help message.

Usage: swatchdog [OPTIONS] --url <URL>

Options:
  -u, --url <URL>
      --method <METHOD>      [default: GET]
      --interval <INTERVAL>  [default: 60s]
      --verbose
  -h, --help                 Print help
  -V, --version              Print version

The tool is tested with uptime-kuma and I personally recommend it.

Configure

You may need to configure it to make it run as a service (start on boot).

linux systemd service example

[Unit]
Description=swatchdog

[Service]
User=nobody
Group=nobody
ExecStart=/path/to/swatchdog -u http://example.com --interval 60s

[Install]
WantedBy=multi-user.target

(place it under /lib/systemd/system/swatchdog.service and run systemctl enable swatchdog)

macos launchd service example

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>me.singee.swatchdog</string>
    <key>ProgramArguments</key>
    <array>
      <string>/path/to/your/swatchdog</string>
      <string>-u=http://example.com</string>
      <string>--interval=60s</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/Users/USERNAME/.swatchdog.log</string>
    <key>StandardErrorPath</key>
    <string>/Users/USERNAME/.swatchdog.log</string>
  </dict>
</plist>

(place it under ~/Library/LaunchAgents/me.singee.swatchdog.plist and run launchctl load ~/Library/LaunchAgents/me.singee.swatchdog.plist)

License

MIT

swatchdog's People

Contributors

imsingee avatar ladbaby avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.