Command 'cmk' not found

Checkmk Raw Edition 2.2.0p3
Ubuntu 22.10

Command ‘cmk’ not found, but can be installed with:
sudo snap install cloudmonkey

I’m trying to solve a different problem, and in the forum I apparently need to run the “cmk” command in order to provide data for the troubleshooting post… but the cmk command fails to be recognized.

This install of CheckMK is an appliance I downloaded about a week ago from the CheckMK website, complete with Ubuntu. It is loaded onto our VMware server. If there is some special setup required to make cmk work, I missed that memo.

I found if you run sudo is better and works

e.g. sudo cmk …

etc

Thanks. Was already running sudo, but wrong about something else.

This is not an appliance from CheckMK, but rather a VM image from OSBoxes.org. I installed CheckMK on top of that, following the directions for the RAW install. That went well, and CheckMK works, though trying to run the cmk command fails as if there isn’t a command by that name.

osboxes@osboxes:~$ sudo cmk
[sudo] password for osboxes:
sudo: cmk: command not found

The command cmk is only available to site users! So you first have to run

omd su mysitename

Then you have a shell as site user. Paths are adjusted and you can run cmk.

See also:

Thrice “command” in the meta description. I guess, we have to fix this… :see_no_evil:

3 Likes

Thanks, that works.

Very non-obvious, got the impression this was something to be run in the Linux command line (as opposed to one level deeper).

@mschlenker would it make sense to add a dummy “cmk” command to the root user that just says “cmk should be run as the site user” (and maybe the output of “omd sites” or a link to the docs article you posted).

It seems this issue is becoming more an more popular :smiley:

1 Like

I slightly agree but this is basic OS knowledge, setup your path environment the correct/incorrect way. Better to learn the basic stuff instead try to workaround every possible lack of knowledge :wink:

If we call cmk as root it already display the following message:

root@sol:~# /omd/sites/mysite/bin/cmk
Check_MK can be used only as site user.
1 Like

hm. I suppose people who know to include /omd/sites//bin/ in their PATH don’t need the reminder, but for everyone starting with checkmk, a reminder that root or non-omd users cannot run “cmk” would be good and safe a few forum threads or replies each month :slight_smile:

1 Like

Hmmm. I suppose the process of including that path would be a good thing to have a computer do… in fact, perhaps the installation package could add it… But it seems that OMD needs to be run in order to have the environment for the CMK command to be used, so would the path in the Linux environment have any affect on how CMK is processed outside of the OMD environment?

Yes, workarounds aren’t great, but the “basic stuff” for CheckMK is voluminous. Perhaps some of the program could be engineered to have tasks be more obvious?

just noticed I tagged the wrong person :slight_smile: this is less of a documentation issue and more one of user experience. Just 1 day later, here is the next “cmk: command not found” issue. @thohenstatt maybe that is a quick win :slight_smile:

2 Likes