GUI CSS: Refactored wato styles to nested structure meeting sasslint requirements...
[check_mk.git] / doc / check_mk.1
bloba9b9795e1d80ca56408c88ba14badfc6831d4281
1 .TH CHECK_MK "1" "November 2015" "Check_MK" "Check_MK Command line utility"
3 .SH NAME
4 check_mk \- command line utility for managing Check_MK
6 .SH SYNOPSIS
7 \fBcheck_mk\fR [\fIGLOBAL OPTIONS\fR] [\fIMODE\fR] [\fIMODE OPTIONS\fR] [\fIARGUMENTS...\fR]
9 .SH DESCRIPTION
10 \fBcheck_mk\fR (or its alias \fBcmk\fR) is a command line utility for managing
11 some aspects of the Check_MK Monitoring System. It can be used for diagnosis,
12 for automating things in scripts and for doing some tasks more efficiently than
13 with the web based WATO.
15 .SH GENERIC OPTIONS
17 The following options work in all modes and all situations.
19 .TP
20 .B -v
21 More verbose output. In good old Unix tradition check_mk only outputs texts
22 if something goes wrong. By using \fB-v\fR you can get some more information
23 about what's going on.
25 .TP
26 .B -vv
27 Even more vebose output. Some operations give even more details when this
28 options is used.
30 .TP
31 .B --debug
32 Disables the intern exception handling in Check_MK and let all Python
33 exceptions through. That way you can see the exact location in the code
34 where the actual problem is. This helps finding problems in self written
35 check plugins.
38 .SH SERVICE DISCOVERY
39 .B cmk [--checks=CHECK_TYPE1,CHECK_TYPE2,...] -I|-II [HOSTS...]
41 The options \fB-I\fR and \fB-II\fR do service discovery. Check_MK will analyse
42 the agent output of the specified hosts (or all hosts if none are specified)
43 and automatically create monitored services where it does make sense. While
44 \fB-I\fR only creates new services and keeps the existing ones untouched, \fB-II\fR
45 first removes all existing services before staring the discovery.
47 The option \fB--checks=\fR restricts the option to a list of check types
48 (e.g. \fB--checks=Bdf,diskstat\fR).  When combined with the mode \fB-II\fR
49 only checks of the specified types are be removed and rediscovered.
51 When no hosts are specified then Check_MK will do a discovery for \fBall\fR hosts
52 that are defined in your configuration. In order to speed this operation up
53 no actual data is being fetched from the hosts but cached agent data will
54 be used. When you specify host names then fresh data is fetched from these.
56 .SH AD HOC CHECKING
57 .B cmk [-n] [-p] [--checks=CHECK_TYPE1,CHECK_TYPE2,...] -v HOST
59 This does an ad hoc checking of the host HOST via Check_MK. HOST must be a host
60 that is configured in Check_MK. Check_MK does the same like in real monitoring -
61 it fetches data from the agent and computes the result of all services. Then it
62 outputs each result and sends the result to the monitoring core.
64 \fB-p\fR Also prints metrics data of the services.
66 \fB-n\fR Prevents the check results from being sent to the monitoring core.
67 That way
69 \fB-v\fR Outputs the results of the passive checks on the terminal. Without
70 this option Check_MK behaves like a classical monitoring plugin: it outputs
71 one line of text (essentially the output of the \fICheck_MK\fR service) and
72 exists with 0, 1, 2 or 3 (OK, WARN, CRIT, UNKNOWN). This was how Nagios called
73 Check_MK in ancient times.
75 The option \fB--checks=\fR restricts the option to a list of check types
76 (e.g. \fB--checks=Bdf,diskstat\fR).  That way only a reduced set of service
77 is being checked. This is useful for testing and debugging a check plugin.
79 .br
81 .SH check_mk
82  cmk [-n] [-v] [-p] HOST [IPADDRESS]  check all services on HOST
83  cmk -I [HOST ..]                     inventory - find new services
84  cmk -II ...                          renew inventory, drop old services
85  cmk -N [HOSTS...]                    output Nagios configuration
86  cmk -B                               create configuration for core
87  cmk -C, --compile                    precompile host checks
88  cmk -U, --update                     precompile + create config for core
89  cmk -O, --reload                     precompile + config + core reload
90  cmk -R, --restart                    precompile + config + core restart
91  cmk -D, --dump [H1 H2 ..]            dump all or some hosts
92  cmk -d HOSTNAME|IPADDRESS            show raw information from agent
93  cmk --check-discovery HOSTNAME       check for items not yet checked
94  cmk --discover-marked-hosts          run discovery for hosts known to have changed services
95  cmk --update-dns-cache               update IP address lookup cache
96  cmk -l, --list-hosts [G1 G2 ...]     print list of all hosts
97  cmk --list-tag TAG1 TAG2 ...         list hosts having certain tags
98  cmk -L, --list-checks                list all available check types
99  cmk -M, --man [CHECKTYPE]            show manpage for check CHECKTYPE
100  cmk -m, --browse-man                 open interactive manpage browser
101  cmk --paths                          list all pathnames and directories
102  cmk -X, --check-config               check configuration for invalid vars
103  cmk --backup BACKUPFILE.tar.gz       make backup of configuration and data
104  cmk --restore BACKUPFILE.tar.gz      restore configuration and data
105  cmk --flush [HOST1 HOST2...]         flush all data of some or all hosts
106  cmk --donate                         Email data of configured hosts to MK
107  cmk --snmpwalk HOST1 HOST2 ...       Do snmpwalk on one or more hosts
108  cmk --snmptranslate HOST             Do snmptranslate on walk
109  cmk --snmpget OID HOST1 HOST2 ...    Fetch single OIDs and output them
110  cmk --scan-parents [HOST1 HOST2...]  autoscan parents, create conf.d/parents.mk
111  cmk -P, --package COMMAND            do package operations
112  cmk --localize COMMAND               do localization operations
113  cmk --handle-alerts                  used to handle alerts from core
114  cmk --notify                         used to send notifications from core
115  cmk --create-rrd [--keepalive|SPEC]  create round robin database (only CEE)
116  cmk --convert-rrds [--split] [H...]  convert exiting RRD to new format (only CEE)
117  cmk --compress-history FILES...      optimize monitoring history files for CMC
118  cmk --handle-alerts                  alert handling, always in keepalive mode (only CEE)
119  cmk -i, --inventory [HOST1 HOST2...] Do a HW/SW-Inventory of some ar all hosts
120  cmk --inventory-as-check HOST        Do HW/SW-Inventory, behave like check plugin
121  cmk -A, --bake-agents [-f] [H1 H2..] Bake agents for hosts (not in all versions)
122  cmk --cap pack|unpack|list FILE.cap  Pack/unpack agent packages (not in all versions)
123  cmk --show-snmp-stats                Analyzes recorded Inline SNMP statistics
124  cmk -V, --version                    print version
125  cmk -h, --help                       print this help
127 OPTIONS:
128   -v             show what's going on
129   -p             also show performance data (use with -v)
130   -n             do not submit results to core, do not save counters
131   -c FILE        read config file FILE instead of %s
132   --cache        read info from cache file is present and fresh, use TCP
133                  only, if cache file is absent or too old
134   --no-cache     never use cached information
135   --no-tcp       for -I: only use cache files. Skip hosts without
136                  cache files.
137   --fake-dns IP  fake IP addresses of all hosts to be IP. This
138                  prevents DNS lookups.
139   --usewalk      use snmpwalk stored with --snmpwalk
140   --debug        never catch Python exceptions
141   --interactive  Some errors are only reported in interactive mode, i.e. if stdout
142                  is a TTY. This option forces interactive mode even if the output
143                  is directed into a pipe or file.
144   --procs N      start up to N processes in parallel during --scan-parents
145   --checks A,..  restrict checks/inventory to specified checks (tcp/snmp/check type)
146   --keepalive    used by Check_MK Mirco Core: run check and --notify
147                  in continous mode. Read data from stdin and from cmd line.
148   --cmc-file=X   relative filename for CMC config file (used by -B/-U)
149   --extraoid A   Do --snmpwalk also on this OID, in addition to mib-2 and enterprises.
150                  You can specify this option multiple times.
151   --oid A        Do --snmpwalk on this OID instead of mib-2 and enterprises.
152                  You can specify this option multiple times.
153   --hw-changes=S --inventory-as-check: Use monitoring state S for HW changes
154   --sw-changes=S --inventory-as-check: Use monitoring state S for SW changes
156 NOTES:
157   -I can be restricted to certain check types. Write '--checks df -I' if you
158   just want to look for new filesystems. Use 'check_mk -L' for a list
159   of all check types. Use 'tcp' for all TCP based checks and 'snmp' for
160   all SNMP based checks.
162   -II does the same as -I but deletes all existing checks of the
163   specified types and hosts.
165   -N outputs the Nagios configuration. You may optionally add a list
166   of hosts. In that case the configuration is generated only for
167   that hosts (useful for debugging).
169   -U redirects both the output of -S and -H to the file %s
170   and also calls check_mk -C.
172   -D, --dump dumps out the complete configuration and information
173   about one, several or all hosts. It shows all services, hostgroups,
174   contacts and other information about that host.
176   -d does not work on clusters (such defined in main.mk) but only on
177   real hosts.
179   --check-discovery make check_mk behave as monitoring plugins that
180   checks if an inventory would find new or vanished services for the host.
181   If configured to do so, this will queue those hosts for automatic
182   discover-marked-hosts
184   --discover-marked-hosts run actual service discovery on all hosts that
185   are known to have new/vanished services due to an earlier run of
186   check-discovery. The results of this discovery may be activated
187   automatically if that was discovered.
189   --list-hosts called without argument lists all hosts. You may
190   specify one or more host groups to restrict the output to hosts
191   that are in at least one of those groups.
193   --list-tag prints all hosts that have all of the specified tags
194   at once.
196   -M, --man shows documentation about a check type. If
197   /usr/bin/less is available it is used as pager. Exit by pressing
198   Q. Use -M without an argument to show a list of all manual pages.
200   --backup saves all configuration and runtime data to a gzip
201   compressed tar file. --restore *erases* the current configuration
202   and data and replaces it with that from the backup file.
204   --flush deletes all runtime data belonging to a host. This includes
205   the inventorized checks, the state of performance counters,
206   cached agent output, and logfiles. Precompiled host checks
207   are not deleted.
209   -P, --package brings you into packager mode. Packages are
210   used to ship inofficial extensions of Check_MK. Call without
211   arguments for a help on packaging.
213   --localize brings you into localization mode. You can create
214   and/or improve the localization of Check_MKs Multisite.  Call without
215   arguments for a help on localization.
217   --donate is for those who decided to help the Check_MK project
218   by donating live host data. It tars the cached agent data of
219   those host which are configured in main.mk:donation_hosts and sends
220   them via email to donatehosts@mathias-kettner.de. The host data
221   is then publicly available for others and can be used for setting
222   up demo sites, implementing checks and so on.
223   Do this only with test data from test hosts - not with productive
224   data! By donating real-live host data you help others trying out
225   Check_MK and developing checks by donating hosts. This is completely
226   voluntary and turned off by default.
228   --snmpwalk does a complete snmpwalk for the specified hosts both
229   on the standard MIB and the enterprises MIB and stores the
230   result in the directory %s. Use the option --oid one or several
231   times in order to specify alternative OIDs to walk. You need to
232   specify numeric OIDs. If you want to keep the two standard OIDS
233   .1.3.6.1.2.1  and .1.3.6.1.4.1 then use --extraoid for just adding
234   additional OIDs to walk.
236   --snmptranslate does not contact the host again, but reuses the hosts
237   walk from the directory %s.%s
239   --scan-parents uses traceroute in order to automatically detect
240   hosts's parents. It creates the file conf.d/parents.mk which
241   defines gateway hosts and parent declarations.
243   -A, --bake-agents creates RPM/DEB/MSI packages with host-specific
244   monitoring agents. If you add the option -f, --force then all
245   agents are renewed, even if an uptodate version for a configuration
246   already exists. Note: baking agents is only contained in the
247   subscription version of Check_MK.
249   --show-snmp-stats analyzes and shows a summary of the Inline SNMP
250   statistics which might have been recorded on your system before.
251   Note: This is only contained in the subscription version of Check_MK.
253   --convert-rrds converts the internal structure of existing RRDs
254   to the new structure as configured via the rulesets cmc_host_rrd_config
255   and cmc_service_rrd_config. If you do not specify hosts, then all
256   RRDs will be converted. Conversion just takes place if the configuration
257   of the RRDs has changed. The option --split will activate conversion
258   from exising RRDs in PNP storage type SINGLE to MULTIPLE.
260   -i, --inventory does a HW/SW-Inventory for all, one or several
261   hosts. If you add the option -f, --force then persisted sections
262   will be used even if they are outdated.