You use the
mon command mainly to stop and start the monitor system processes and to set up distributed or load-balanced environments.
You run the
mon tool at the command line using SSH.
Caution: This command can be very destructive if not used correctly. Do not use it unless specifically instructed to do so by ITRS or the OP5 Monitor documentation.
To get a list of available sub-commands, run the command without any arguments, as follows:
You can also run sub-commands to see a list of their sub-commands, for example:
# mon query
You can get more detailed information about specific sub-command options by using option
# mon query ls --help
The table below lists some of the most useful
mon commands. Most commands take two arguments, with a few exceptions.
||Prints templates for all available commands matching the regular expression
||Submits a command to the monitoring engine using the supplied values.||Available
||Runs the showlog helper program. Arguments passed to this command are sent to the showlog helper.|
||Adds a node with the designated type and variables.|
||Lists all nodes by type, if specified.|
||Removes one or more nodes from the merlin configuration.|
Displays all variables for all nodes, or for one node in a way suitable for use as
Shows status of all nodes configured in the running Merlin daemon. Red text indicates problem areas, such as high latency or the node being inactive, not handling any checks, or not sending regular enough
||Prints the last modification time among all object configuration files.|
||Prints a list of Naemon object configuration files in alphabetical order.|
||Prints an SHA-1 hash of the running configuration.|
||Splits the configuration based on Merlin's peer and poller configuration, and sends object configuration to all peers and pollers, restarting those that receive a configuration update. SSH keys need to be set up for this to be usable without administrator supervision.|
||Lists monitored objects. You can specify filters to show only objects and statuses you are interested in.|
Fetches all the SSH keys from peers and pollers.
This command is not recommended — run the
||Pushes the local SSH keys to all peers and pollers.|
Checks a specific spool directory for files that are older than
Checks for memory dumps resulting from segmentation violation from core parts of OP5 Monitor. Detected core files are moved to
|check distribution||mon check distribution [--no-perfdata]||Checks to make sure distribution is working properly in a distributed environment. Note that it takes a few minutes to work properly after a new machine has been brought online or taken offline.|
||Checks execution time of active checks.||
||Checks latency time of active checks.||
||Checks for checks that have not been run in a long time.|
The following example adds a new comment to the PING service on host
mon ecmd submit add_svc_comment service='foo;PING' persistent=1 \author='John Doe' comment='the comment'
You can also use positional arguments, provided you respect the order of command arguments, as in the following example:
mon ecmd submit add_svc_comment 'foo;PING' 1 'John Doe' 'the comment'
Use single quotes to execute commands with shell variables, output redirection or scriptlets, as follows:
mon node ctrl -- '(for x in 1 2 3; do echo $x; done) > /tmp/foo'