☰ Menu
CLI Open source 1 installs/mo

mon for Mac

mon

Super-simple monitoring program.

mon — overview

mon(1)

Super-simple monitoring program.

mon spawned from the needlessly complex frustration that tools like monit provide, with their awkward DSLs and setup. mon is written in C, uses less than 400kb of memory, and is incredibly simple to set up.

Installation

Too lazy to clone?:

Usage

Example

The most simple use of mon(1) is to simply keep a command running:

You may daemonize mon and disassociate from the term with -d:

Failure alerts

mon(1) will continue to attempt restarting your program unless the maximum number of --attempts has been exceeded within 60 seconds. Each time a restart is performed the --on-restart command is executed, and when mon(1) finally bails the --on-error command is then executed before mon itself exits and gives up.

For example the following will echo "hey" three times before mon realizes that the program is unstable, since it's exiting immediately, thus finally invoking ./email.sh, or any other script you like.

__NOTE__: The process id is passed as an argument to both --on-error and --on-restart scripts.

Managing several mon(1) processes

mon(1) is designed to monitor a single program only, this means a few things, firstly that a single mon(1) may crash and it will not influence other programs, secondly that the "configuration" for mon(1) is simply a shell script, no need for funky weird inflexible DSLs.

I highly recommend checking out jgallen23's mongroup(1), which provides a great interface for managing any number of mon(1) instances.

Logs

By default mon(1) logs to stdio, however when daemonized it will default to writing a log file named ./mon.log. If you have several instances you may wish to --prefix the log lines, or specify separate files.

Signals __SIGQUIT__ graceful shutdown __SIGTERM__ graceful shutdown

Links

Tools built with mon(1): mongroup(1) - monitor a group of processes (shell script) node-mongroup - node implementation of mongroup(1)

License

MIT

Build Status

Details

监视主机/服务/任何东西并在出现问题时发出警报

How to install mon

  1. Open Terminal (press ⌘ + Space and type “Terminal”).
  2. If Homebrew is not installed yet, run the command below first.
  3. Run this command:

Latest 10 releases

This project has no GitHub releases yet.

Prebuilt bottle platforms

Official Homebrew bottles cover:

  • Apple silicon · latest macOS
  • Apple silicon · macOS 26 Tahoe
  • Apple silicon · macOS 15 Sequoia
  • Apple silicon · macOS 14 Sonoma
  • Apple silicon · macOS 13 Ventura
  • arm64_monterey
  • arm64_big_sur
  • Intel · macOS 14 Sonoma
  • Intel · macOS 13 Ventura
  • Intel · macOS 12 Monterey
  • big_sur
  • Linux · ARM64
  • Linux · x86_64

Compared with similar apps

Only public metadata is compared, with no subjective recommendation; see the compare pages for field-by-field comparisons.

Compared with similar apps
AppVersionLicenseArchitecture30-day installs
mon1.2.3MITCLI1
Command Padv0.1.2—Universal binary0
librest0.10.2LGPL-2.1-or-later AND LGPL-3.0-or-laterCLI0
pelikan0.1.2Apache-2.0CLI0

Similar apps: Command-line Tools

Leave a comment

评论表单加载中…