moncmd(1)
π moncmd β bestie's guide to yeeting commands at the mon daemon π
okay so this is the moncmd(1) page from the moncmd manual, and it's basically the little messenger girl that runs your errands over to the mon server. Grab a strawberry π and let's go.
β¨ NAME β¨
moncmd β send commands to mon daemon and show the results. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
moncmd [-a] [-d] [-l username] [-f file] [-s server] [-p port] [command]
look at her. so compact. so iconic. π
π¦ DESCRIPTION π¦
moncmd sends commands to the mon server. literally that's the tea β it's the client, the server does the work, we just deliver the message. π«Ά
π OPTIONS π
-aβ Authenticate with the server. yes bestie, we're doing the whole login thing π-dβ enable debugging, which is the same as-s localhost. (so it's giving "just talk to the local server, we're debugging" energy β¨)-ffileβ Read and execute commands fromfile. batch mode activated π-lusernameβ Supplyusernameas the username while authenticating to the server. tell them who you are π-sserverβ Connect toserver. where we're pointing our little messenger π-pportβ Use TCP portportwhen connecting to the server, instead of the default of32777. (remember that number, it comes back later π)
π MONITOR HOST π
moncmd will use the host specified by the -s parameter as the server.
If there is no -s parameter it will use the host specified in the MONHOST environment variable.
If there is no host in either of these locations it will exit with an error. π no host, no party, she's leaving.
π BATCH OPERATION π
If no commands are supplied to moncmd on the command line, then commands will be taken from either standard input, or from the file specified by the -f parameter.
If standard input is connected to a TTY and the -a option is supplied, then it will prompt for a password. π
If the -a option is supplied without the -f option and standard input is not a TTY, then the username and password are read from standard input using the syntax "USER=username" and "PASS=password". The remaining input lines are interpreted as commands to send to the server.
moncmd will not take usernames or passwords from a file, for obvious security reasons. π₯ no cap, don't even ask.
If the username is neither supplied by the -l parameter or through standard input, it is taken from the effective user ID of the current process. (she knows who you are already, bestie π«Ά)
π COMMANDS π
The following is a list of the commands that the server understands. the whole menu, nothing skipped, periodt β¨
enable | disable service group servicenameβ Enables/disables alerts forgroupandservicename. All disabled states are automatically saved to the state file, which may optionally be re-loaded upon restarting or initial startup of the server. πΎack group service commentβ Acknowledge a failure condition. This will storecommentin the state ofservice(queryable by doing alist opstatuscommand), and will suppress further alerts for the service. Once the service returns to a non-failure state, then the acknowledgement is reset. π«Ά "i see you, i got it, chill"versionβ Displays the protocol version in the form of"version num"wherenumis the protocol version number.list aliasesβ Lists aliases.list aliasgroupsβ Lists alias groups.savestateβ Save the state of the server. Currently, the only state which is saved is the host/watches/services which are disabled.loadstateβ Load the state of the server. Currently, the only state which is loaded is the host/watches/services which are disabled.enable | disable host hostnameβ Enables/disables hosthostnamein all groups. When the monitor is called, thishostnamewill not be included in the list of hostnames sent to the monitor. If a group has only one hostname in it, then theenable | disable watchcommand should be used instead. β οΈenable | disable watch watchgroupβ Enables/disables an entire watch forwatchgroup, as defined in the configuration file. Disabling a watch not only stops alerts from happening, but it stops the actual monitor processes from being scheduled. she's not just quiet, she's GONE. πresetβ Resets the server, forcing it to re-read the configuration file, kill off currently running monitors, restart all monitoring, and reset all counters. This command is only accessible ifmoncmdconnects from the host which is running the mon server. π₯reset stoppedβ Resets the server and immediately stops the scheduler. This is an atomic version of the commandsresetandstop. β¨reload authβ Reloads theauth.cffile in order to incorporate any new changes. The auth table is completely re-generated; it is not merged. re-generated, not merged β that's not the same thing bestie.reset keepstateβ If the word"keepstate"comes after theresetcommand, the server will do a"loadstate"right after the reset, before the scheduler kicks back in. πstopβ Stops the scheduler, but continues to allow client connections. πstartβ Re-starts the scheduler after it has been stopped. βΆοΈtest monitor group servicenameβ Triggers a test forgroupandserviceimmediately by setting the service's countdown timer to zero. β±οΈtest (alert | upalert | startupalert) group servicename retval periodβ Triggers a test alert, upalert, or startupalert forgroupandservicename.retvalis the integer exit value to pass to the alert via theMON_RETVALenvironment variable. You must also specify theperiodas it appears in the configuration file. All alerts of the given type in that period will be triggered, but the alert will not be logged. πservertimeβ Returns the current time of the server as seconds since Jan 1, 1970. β°list group groupnameβ Lists the members of groupgroupname.list descriptionsβ List the descriptions of each service, as defined in the configuration file. If a service description is undefined, then it is not listed.list alerthistβ Lists the last alarms triggered for each service of each watch group, in addition to the summary output. The number of alerts to keep in memory is bounded by themaxkeepvariable, configurable on themoncommand line at startup, and expandable with thesetcommand during runtime. π§list failurehistβ Lists the last failures, in addition to the summary output. This is also limited by themaxkeepvariable.list opstatusβ Lists operational status of all services. Reports whether the last time a service group was tested resulted in success or failure. The output is:
group service untested
group service time timeleft succeeded
group service time timeleft failed output
where output is the first line of output from the monitor script which failed, time is the time that the condition was last noticed in time(2) format, and timeleft is the number of seconds left until the service is tested again. π
list successesβ Generates the same output as thelist opstatuscommand, but only shows the services that have succeeded the last time they were tested. βlist failuresβ Generates the same output as thelist opstatuscommand, but only shows the services that have failed the last time they were tested. βlist disabledβ Lists all hosts and services which have been disabled by thedisable host|servicecommand.list pidsβ Shows the currently active watch groups/services along with their process IDs, and it process ID of the server daemon. πlist watchβ Lists all watches and services.list stateβ Lists the state of the scheduler.set group service variable valueβ Sets avariabletovalue. Useful for temporarily changing an interval or alertevery value.
Be careful, because this can just set any value in the%watchhash, and some values that are specified in the configuration file like"10m"or"35s"are converted and stored as just plain integer seconds (e.g."alertevery"). β οΈ she's powerful, respect her.
get group service variableβ Displays the value ofgroupservicevariable.set variable valueβ Assignsvalueto the global variablevariable.set opstatus group service valueβ Sets the opstatusvalueforgroupandservice.get variableβ Shows the value of global variablevariable.termβ Terminates the server. This command is only accessible ifmoncmdconnects from the host which is running the mon server. π only from the host running the server, bestie, we're not doing remote chaos.
π ENVIRONMENT VARIABLES π
MONSERVERβ The hostname of the server which runs themonprocess.MONPORTβ The port number to connect to.
π§ SEE ALSO π§
mon(8) β go read that one too, she's the main character π
π BUGS π
Report bugs to the email address below. (yes, "below", that's what it says, it's giving vintage π)
β AUTHOR β
Jim Trocki <trockij@arctic.org> β thank you for your service, king π
okay that's the whole page!! written for the moncmd manual on Linux, and the date on the tin is $Date: 2005/04/17 07:42:27 $ β vintage but still slaying β¨ go forth and send your commands, bestie, iykyk ππ
π¦ where this page comes from
- debian bookworm: mon 1.3.6-4 Β· GPL-2.0-or-later
- debian trixie: mon 1.4.1-2
- ubuntu jammy: mon 1.3.6-2 Β· GPL-2.0-or-later
- ubuntu noble: mon 1.3.8-1build3 Β· GPL-2.0-or-later
- ubuntu questing: mon 1.4.1-2
- ubuntu resolute: mon 1.4.2-1
- ubuntu stonking: mon 1.4.2-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms