Feature request: monit command with regex or wildcard
Issue #915
resolved
Example of command with regex or wildcard
$ monit restart abc*
$ monit restart abc_\d+
Comments (4)
-
-
reporter great! thanks.
-
reporter - changed status to resolved
-
repo owner Fix Issue
#915: Add support for sevice name regular expressions in monit CLI status, summary, start, stop, restart, unmonitor, monitor commands. Examples: monit status myservice # exact match monit status "data.*" # pattern which will match all services whos name contain "data" substring→ <<cset 869a3015cdb5>>
- Log in to comment
I like the idea, so I wrote a little bash function that handles this:
You can source this file in your login-script (
~/.bashrc
or similar) with. ~/.emonit.sh
if you stored it in~/.emonit.sh
. The script uses some non-sh
-compatible syntax. So if you only havesh
orash
at hand, some changes are needed.Syntax:
One important thing to notice: Mind the glob! ;)
Hope that helps.