Ignoring specific services for one host

Happy Friday!

My host is in a specific hostgroup which has multiple services applied to. I would like to remove all services containing the word “mount” in it…only for that one host of course.

I’m thinking about the cleanest solution for this. My ideal solution would be to ignore them (with the match command…) in the Host definition of my server. I did try an “ignore where” but it gave me an error about not being able to have both “assign” and “ignore” together. I understand the logic behind this.

Any tips are welcomed!

Thank you and have a good week-end.
Gen

There is no reason why you cannot combine assign and ignore directives.

See https://icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/
#apply-rules-expressions-examples for some examples.

If you get an error message, show us what your service check definition looks
like and tell us what the error message actually says.

Antony.

2 Likes

@Pooh

In the Host definition?
I would like to avoid going into every services and add that ignore statement. This is what I would like to do and I get this error : critical/config: Error: object rule ‘ignore where’ cannot be used without ‘assign where’

object Host “myserver” {
import “generic-host-homeu1io”

groups = [ “common-checks-centos-server-24x7”,“IBM-ESS-server-24x7”,“IBM-ESS-client-24x7”,“IBM-ESS-HOMEU1IO-server-24x7”]
ignore where match(“mount”, service.name)
}

There are 2 * around mount, doesn’t show up here somehow