mon for Mac
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
- Open Terminal (press ⌘ + Space and type “Terminal”).
- If Homebrew is not installed yet, run the command below first.
- 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.
| App | Version | License | Architecture | 30-day installs |
|---|---|---|---|---|
| mon | 1.2.3 | MIT | CLI | 1 |
| Command Pad | v0.1.2 | — | Universal binary | 0 |
| librest | 0.10.2 | LGPL-2.1-or-later AND LGPL-3.0-or-later | CLI | 0 |
| pelikan | 0.1.2 | Apache-2.0 | CLI | 0 |
Similar apps: Command-line Tools
Command Pad
Command Pad is a handy GUI application for running your command line tasks.librest
librest is a development library for accessing RESTful web services, aimed primarily at…pelikan
Production-ready cache servicesshmux
The most likely way for the world to be destroyed, most experts agree, is by accident.openssl@4
Cryptography and SSL/TLS Toolkitxz
General-purpose data compression with high compression ratioCategories: Command-line Tools