Check_disk with multiple partitions monitoring

Hello

I am at wits end trying to monitor 2 partition on a server

The partitions are
/srv/postgresql/home
/srv/postgresql/product

Plugin Output

DISK CRITICAL - /srv/postgresql/home , /srv/postgresql/product is not accessible: No such file or directory

This is because the above is taking as a single string as partition instead of 2 partitions
I am using the default check_disk

I am not sure how to pass the two partitions in an array. For whatever reason nothing works.

I have tried passing this as well [“srv/postgresql/product” , “/srv/postgresql/product”]
Please help how to pass the two partitions in array? The master is icinga2 2.8

Hi.

To be honest, I am actually not using the director (don’t get me wrong: the director is great).
Hopefully, I do not write nonsense.
But from my memory and my notes, the following way should be a possibility:

  1. Create an array with a useful name
  2. From Commands -> External Commands:
    Create a new command, based on (included) disk.
  3. Create a service template and import the command from step 2
  4. Add the service from step 3 to a host and add the partitions to the array from step 1.

We had the oposite problem with the exclude parameter. So instead of “–exclude_device” / “-x” we use " --ignore-eregi-path" / -I now.
So your solution could be instead of “-p” / “–path” / " --partition" to use the parameter " -r" / “–ereg-path” / “–ereg-partition”. In case of the director move the values from the variable “disk_partitions” to “disk_ereg_path”.
I think “disk_ereg_path” should be an array. Because we had also to use for our solution with “ignore-eregi-path” an array.

Interesting why the partitions won’t work. In the command line if we just mention -p /partition1 /partition2 it works. But as directer is encapsulating the expression in quote it becomes ‘-p’ ‘/partition1 /partition2’ which is making it 1 single string. Not sure what is the work around for this

So as suggested above i changed it into regex and put like below

Voila the workaround works - but still I really want to know why the partitions parameter won’t work

1 Like

oh interesting if it works without an array. I will try this is also how you wrote it.

Of course it would be interesting. why we need this workarround. I discussed this also with my colleague. His idea was that maybe something changed with the disk-check. Because there were updates for the monitoring-plugins days ago.
But hopefully someone brings light into the dark.

The check_disk plugin at CLI do work fine

check_disk -p /opt /var -w 10%

But: when using icinga director it is sending

‘check_disk’ ‘-p’ ‘/opt /var’ ‘-w’ ‘10%’

This fails as it is becoming a string ‘/opt /var’ becoming 1 string

1 Like