check_mk (1) - Linux Manuals
check_mk: command line utility for managing Check_MK
NAME
check_mk - command line utility for managing Check_MK
SYNOPSIS
check_mk [GLOBAL OPTIONS] [MODE] [MODE OPTIONS] [ARGUMENTS...]DESCRIPTION
check_mk (or its alias cmk) is a command line utility for managing some aspects of the Check_MK Monitoring System. It can be used for diagnosis, for automating things in scripts and for doing some tasks more efficiently than with the web based WATO.GENERIC OPTIONS
The following options work in all modes and all situations.
- -v
-
More verbose output. In good old Unix tradition check_mk only outputs texts
if something goes wrong. By using -v you can get some more information
about what's going on.
- -vv
-
Even more vebose output. Some operations give even more details when this
options is used.
- --debug
-
Disables the intern exception handling in Check_MK and let all Python
exceptions through. That way you can see the exact location in the code
where the actual problem is. This helps finding problems in self written
check plugins.
SERVICE DISCOVERY
cmk [--checks=CHECK_TYPE1,CHECK_TYPE2,...] -I|-II [HOSTS...]The options -I and -II do service discovery. Check_MK will analyse the agent output of the specified hosts (or all hosts if none are specified) and automatically create monitored services where it does make sense. While -I only creates new services and keeps the existing ones untouched, -II first removes all existing services before staring the discovery.
The option --checks= restricts the option to a list of check types (e.g. --checks=Bdf,diskstat). When combined with the mode -II only checks of the specified types are be removed and rediscovered.
When no hosts are specified then Check_MK will do a discovery for all hosts that are defined in your configuration. In order to speed this operation up no actual data is being fetched from the hosts but cached agent data will be used. When you specify host names then fresh data is fetched from these.
AD HOC CHECKING
cmk [-n] [-p] [--checks=CHECK_TYPE1,CHECK_TYPE2,...] -v HOSTThis does an ad hoc checking of the host HOST via Check_MK. HOST must be a host that is configured in Check_MK. Check_MK does the same like in real monitoring - it fetches data from the agent and computes the result of all services. Then it outputs each result and sends the result to the monitoring core.
-p Also prints metrics data of the services.
-n Prevents the check results from being sent to the monitoring core. That way
-v Outputs the results of the passive checks on the terminal. Without this option Check_MK behaves like a classical monitoring plugin: it outputs one line of text (essentially the output of the Check_MK service) and exists with 0, 1, 2 or 3 (OK, WARN, CRIT, UNKNOWN). This was how Nagios called Check_MK in ancient times.
The option --checks= restricts the option to a list of check types (e.g. --checks=Bdf,diskstat). That way only a reduced set of service is being checked. This is useful for testing and debugging a check plugin.