Omd cleanup - default link

Hi, I’m not sure if this is the right place to report this. If it’s not, please let me know where to write this issue.

Problem:
After “omd cleanup”, “omd/versions/default” link was broken.

Expected:
“omd/versions/default” link rebuild or at least a warning.

Scenario:
1.6.0p15.cee.demo - unused and was removed
1.6.0p17.cee.demo - unused and was removed
1.6.0p18.cee.demo - in use and was kept
1.6.0p22.cee.demo - unused but set as default and was removed

If you uninstall the current default version the post remove scripts select a available version and set it as a new default. Until now i had no problems with this.
I think the “omd cleanup” command should not be used if your omd versions are installed with the normal package management. It would be good if in the help text is something like “don’t use it:smiley:

1 Like

I’ll second that. I had a situation where the sites’ version link had been removed in preparation of a distribution upgrade and then omd cleanup was used to quickly deinstall the checkmk packages.

What was not expected was that omd cleanup then happily removed everything under /opt/omd as there was no site using any version any more. :frowning:

Luckily there had been backups.

1 Like

Sorry to hear that, what story! I took a big risk then running this command in production without test before. It seemed to me so harmless at the time :sweat_smile:

So what would be a good case to use “omd cleanup”? Maybe it would be better to change the name or something like to warn users?

IMHO omd cleanup should just call the package manager of the distribution to remove unused versions of checkmk and then be good with it.

Instead it tries to really clean up, which is kind of unexpected.

Yes, I agree.
I open a PR just now to, at least, ignore default version (even if it has no site created yet).

1 Like

Fixed :slight_smile:

4 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.