Check for new hosts in wato folder

Hello everyone,

I want to have a check for the number of hosts in a specified WATO folder. So if there is one new host I got an alert (new hosts from automation). I’m not sure if it was discussed so I ask here, if there is already a solution because I was not able to find it.

I’m not aware of such a check but it’s a nice idea.

The number of hosts is stored in the .wato files below ~/etc/check_mk/conf.d/wato, e.g.

~/etc/check_mk/conf.d/wato/.wato:

{'attributes': {'meta_data': {'created_at': None, 'created_by': None}},
 'lock': False,
 'lock_subfolders': False,
 'num_hosts': 2,
 'title': 'Main directory'}

For subfolders it’s ~/etc/check_mk/conf.d/wato/SUBFOLDER/.wato.

It cannot be that hard to write a check that keeps track of the number…

Hi,
you can check for the num_hosts like @Dirk mentioned in your own check. An other way is, to log the audit.log if new hosts added by the automation user.
There is no build-in solution in check_mk.
Cheers,
Christian

Thanks for your help. This file is what I was looking for. But also a nice idea from you @ChristianM .