moncmd(1)

NAME
moncmd - send commands to mon daemon and show the results.

SYNOPSIS
moncmd [-d] [-s server] [-p port]

DESCRIPTION
moncmd sends commands to the mon server.

OPTIONS

-d  enable debugging, which is the same as -s localhost.

-s server
    Connect to server.

-p port
    Use TCP port port when connecting to the server, instead of the default of 32777.

MONITOR HOST
moncmd by default will look for a mon host to connect to in the MONHOST environment variable. If it is not defined, it will try to use the -s parameter. Otherwise, it will complain.

COMMANDS
The following is a list of the commands that the server understands.

dump group servicename
    List all variable values for group and servicename.

enable|disable service group servicename
    Enables/disables alerts for group and servicename.

enable|disable host hostname
    Enables/disables host hostname in all groups. When the monitor is called, this hostname will not be included in the list of hostnames sent to the monitor. If a group has only one hostname in it, then the enable|disable watch command should be used instead.

enable|disable watch watchgroup
    Enables/disables an entire watch for watchgroup, 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.

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 if moncmd connects from the host which is running the mon server.

list group groupname
    Lists the members of group groupname.

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 the maxkeep variable, configurable on the mon command line at startup, and expandable with the set command during runtime.

list failurehist
    Lists the last failures, in addition to the summary output. This is also limited by the maxkeep variable.

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 the list opstatus command, but only shows the services that have succeeded the last time they were tested.

list failures
    Generates the same output as the list opstatus command, 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 the disable host|service command.

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 services and all groups.

set group service variable value
    Sets a variable to value. Useful for temporarily changing an interval or alertevery value. Be careful, because this can just set any value in the %watch hash, 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").

get group service variable
    Displays the value of group service variable.

set variable value
    Assigns value to the global variable variable.

get variable
    Shows the value of global variable variable.

term
    Terminates the server. This command is only accessible if moncmd connects from the host which is running the mon server.

VARIABLES
This is a list of the tunable global variables:

maxkeep
    The maximum number lines of alert of failure history to retain.

SEE ALSO
mon(1)

BUGS
Report bugs to the email address below.

AUTHOR
Jim Trocki <trockij@transmeta.com>