Assign host to hostgroup when having specific service

Hi everyone,

I got a little stuck here with a task I would suppose to be quite easy. So here is the situation: We are hosting a bunch of orcale DB servers that are monitored by the checkMK OraBD Plugin. So far so good.

In the next step I want to provide a dashboard to our DBAs that only contains servers where the service discovery detected an oracle service. This works fine with everything concering services but I would also like to show host problems ONLY for DB-Servers. If a DB-server is down it should be displayed but I do not want any other offline hosts to pop up within the dashboard.

So first step would be creating a view based on a hostgroup right? But: What I don’t want to is assigning all these servers to a hostgroup manually because we are talking about hundereds of servers.

What I tried ist to do ist createing a rule that can assing a host to a hostgroup according to the deteced DB services - which did not work because there is no option to do this. I tried the same to assign host labels to use the labels to assign a host group but ran into the same problem.

So is there a way to assign a host to a hostgroup when having a specific service? If not, do you have any idea how I could achive my goal to filter my dashboard for database servers host-problems without having them in a hostgroup or beeing labeld?

Thanks in Advance
Daniel

Hi,

so if I understand the issue correctly, you need a way to dynamically assign a host label to your Oracle hosts.

You can either do that using the process discovery, i.e. if an oracle process is running, create a host label using Werk #10079: ps: Create Host Labels on process discovery

or you use Robert Sanders Data2Label and scan for Oracle Instance Services using a service search view and label based on that. It’s on Checkmk Exchange

and google/something else will probably translate Checkmk-Monitoring automatisieren mit unserem Data2label-Plugin | Heinlein Support GmbH quite well :slight_smile:

1 Like

I was curious how to do it, so tried stuff out with ā€˜solution’ I thought worked.
But for some vague reason it keeps assigning labels to all hosts and I can’t seem to make it work now, so I deleted my post.

We can try to help if you share what you tried :slight_smile:

Not sure if it will work for you but I usually assign a ā€œhost roleā€ tag to the servers as a start point..ie..HostRole=OracleDBServer. Once you have that in place it’s relatively easy to build out the host groups etc or assign host labels via rules.

You can bulk edit the host attributes to assign the HostRole tag - doesn’t have to be done individually.