Director : Multiple disk type to exclude

  • Director version : 1.9.1
  • Icinga Web 2 version and modules : 2.11.1
  • Icinga 2 version : 2.13-5.1
  • Operating System and version: linux redhat 7.6
  • Webserver, PHP versions: 7.3

Hello,
I can’t enter multiple FS type to exclude using director interface.
With the manual config I write this : vars.disk_exclude_type = [ “nfs4” , “nfs” ] and it’s working.
But with director it works only if I put only one type.
I tried to enter the different types separated by “,” or spaces, with ’ " ’ or with “[” at the end or at the beginning, but without success.
Could you tell me the right syntax please.
Thanks

In the director you can change the property of your field ( disk_exclude_type) to array

https://your-icinga-master/icingaweb2/director/data/fields

Hello,

I think I wasn’t very clear.
I set the variable disk_partition_excluded = nfs, it’s working

The variable :

Here the director service :

Here the file in /var :

apply Service “Disk Used” {
import “Agent-based service”
check_command = “disk”
assign where “LinuxAgent” in host.groups
vars.disk_exclude_type = [ “nfs” ]
zone = “master_prd”
import DirectorOverrideTemplate
}

The host view :

I don’t see the nfs (/home/ldaphome) but I see the nfs4 (great !) : /tools and /distribnas

So I have to add nfs4 in my variable

apply Service “Disk Used” {
import “Agent-based service”

check_command = "disk"
assign where "LinuxAgent" in host.groups
vars.disk_exclude_type = [ "nfs, nfs4" ]
zone = "master_prd"

import DirectorOverrideTemplate

}
And now I see the both type nfs and nfs4 FS : /home/ldaphome (nfs) and /tools and /distribnas (nfs4)

So, how to exclude both types ? I don’t see what I did wrong.
Thanks

Here is an example to define an array.

Hello,
I don’t want a list of FS to monitor in the host, I want a list of FS to exclude in an “apply service”.

It doesn’t matter if your array variable is in a host template, service template or service apply rule.
They all behave the same.

You are currently putting your two to be excluded file systems into one field of the array.
But you need to put each into a separate field.
Add another string to the array list and click the + icon
image
Then save the config and deploy the changes

This will result in the slight difference in the config.
You already posted the correct one in your first post, when using the config files

Versus the second one generated by the wrong usage of the Directors array variable.

1 Like

Hello,

Thank you. It’s OK. It’s working.