How to pull the List of Windows hosts

Is there any possibility to pull list of all servers which are on windows operating system and Linux Separately from check_mk.

Hi nvnbs,

you can create hostgroups depending on tags / labels or folders and do a an export of a csv file in the hostgroup view.

Andre

1 Like

without creating host tags or groups based on the services it discovers is there anything we can do as we don’t have tags applied to all servers and applying tags manually will take time

Depending on your wato folder structure, your server naming convention and the amount of hosts, it might not be such a big deal to add labels like os:windows and os:linux to your servers.
In wato you can search for patterns and do a bulk assign on these hosts.

Either you adopt the sugestions already mentioned (tags, groups, labels, etc…)

Or It really depends on what services you monitor in each servers.
For example, you can query livestatus to give you back every servers with filesystem C:(Windows) or Filesystem / (Linux) in a LQL :

echo -e “GET services\nFilter: display_name ~~ Filesystem /$\nColumns: host_name” | lq

echo -e “GET services\nFilter: display_name ~~ Filesystem C.*\nColumns: host_name” | lq

You might get non-linux servers from the LQL above since some devices like network devices may contain Filesystem / regarding HOST-RESOURCE-MIB.

But, just another idea regarding what you need.

1 Like

You could also try something like this:
cmk --list-tag [TAG1 TAG2…] List hosts having certain tags

In my case, all windows servers have been tagged as windows and linux servers as linux so, I can pull all like this

cmk --list-tag windows
cmk --list-tag linux

I have those tags created already and i have the regex for all the windows prod servers but im not sure how can i add those regex to a host tag

Hi,

go to WATO - Hosts. There in the upper menu is a “search” Button.
Within the search you can search for the hosts that match your criteria in different ways.
Then you can edit all resulting hosts from the search and add the label/tag you created.

hi ,

When i am searching im finding the list of servers but not finding an option to apply the host tags

Hey,

you can just multi select all hosts that result from your search, multi edit them and in the edit window you can attach labels or select tags that you created beforhands.

1 Like

yeah found it after replying to your post

Thanks alot

is ther any way we can remove the unknown services as i created a periodic discovery rule but it is not removing the vanished services.

service like this

Nothing to do with initial thread … but … what’s your periodic discovery rule configured ?

Cheers,

this is rule that is currently configured

What is the output of your discovery service?
Does it state that there are vanished services and a rediscovery is scheduled?

could you please help me where can i find that

? On your host you should see a “check_mk discovery” service. If it is not there your defined rule matches not your host.

i don’t see that service so how can i enable that particular service for the host,

You posted the discovery rule - that means this rule does not match your host. You need to fix the rule condition that it matches your host.