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