Bulk rename of folder titles

Hi,

I’ve a lot of folders I’d like to shorten the titles of (this can just be a simple find/replace type operation). Is there a way to do this in WATO or on the command line, e.g. using a find / sed type approach?

Note that I only need to rename the titles of folders, not their underlying internal names.

Edit:
I’m also using distributed monitoring - would it be sufficient to rename by whatever method on the master and then trigger a sync/activation to the slaves?

Cheers,
Rich

The folder names are stored in the files ~/etc/check_mk/conf.d/wato/$folder_id/.wato, for example for a folder wserver:

OMD[site]:~/etc/check_mk/conf.d/wato/wserver$ cat .wato
{'attributes': {'meta_data': {'created_at': None, 'created_by': None}},
 'lock': False,
 'lock_subfolders': False,
 'num_hosts': 5,
 'title': u'Webservers'}

I’d suggest to stop the site, edit these files, and then restart the site.

Thanks @Dirk , would it suffice to just do this on the master in a distributed monitoring setup, then trigger a sync/activation to the slaves?

You are welcome.
Unfortunately I cannot tell because I have no distributed system at hand right now. I’d just try it out :wink:

1 Like

I did try it and it worked. To update the slaves I just went to the properties page of the Main directory and clicked Save and finish without actually changing anything there. This forced a sync and reload on all the slaves which updated the folder titles.

Cheers,
Rich

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.