# Icinga director - Monitor several Linux partitions with their own disk threshold

**URL:** <https://community.icinga.com/t/icinga-director-monitor-several-linux-partitions-with-their-own-disk-threshold/7037>\
**Category:** Icinga Director\
**Created:** [March 30, 2021, 11:22am UTC](https://community.icinga.com/t/icinga-director-monitor-several-linux-partitions-with-their-own-disk-threshold/7037 "2021-03-30T11:22:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kosli](https://community.icinga.com/letter_avatar_proxy/v4/letter/k/b2d939/32.png) [@kosli](https://community.icinga.com/u/kosli)\
**Post date:** [March 30, 2021, 11:23am UTC](https://community.icinga.com/t/icinga-director-monitor-several-linux-partitions-with-their-own-disk-threshold/7037/1 "2021-03-30T11:23:00Z")

</div>

I have a server monitored by check\_disk which has multiple disks. By default all disks are listed in results with the same thresholds. As some of the disks are large, e.g. 10 TB, so a threshold with 10% is not relevant for that disk and I would like to adjust it per-disk.  
I haven’t found a way how to configure different thresholds per disk in Icinga director (despite adding separate services for separate disks).

e.g. I looked at the following threads, but haven’t found anything regards director:

> [@Monitoring disk space on server with multiple drives](https://community.icinga.com/t/monitoring-disk-space-on-server-with-multiple-drives/1299):
>
> Hello. I am new to Icinga. can you please help me get this point: How does Icinga monitor disk space on Server with multiple drives. do I have to write a script for each drive, an will get an alarm for each one, that would not be practical for us cause we dont want to get notified because of just one drive while the other are not full. or it s possible to set a trigger for the total amount of disk space. Thanks

> [@Help please: adapting disk thresholds per host](https://community.icinga.com/t/help-please-adapting-disk-thresholds-per-host/6253/5):
>
> Hi, for that check i think you could add a second assign where to the service object - something like // assign check where host.vars.disk\_custom\_partitions is defined assign where host.vars.disk\_custom\_partitions Greetz

> <https://github.com/Icinga/puppet-icinga2/issues/428>
>
> The example vars do not work as expected. What is the correct way to raise the t…hresholds for single disks?
> 
> https://github.com/Icinga/puppet-icinga2/blob/6412e421cbfac31b696fa1bca81d6f6f9af1d899/examples/example4/hieradata/nodes/example.domain.org.yaml#L2-L7
> 
> Adding these host vars results in following object for the host:
> \`\`\`
> \#cat /etc/icinga2/conf.d/host.rz.example.com.conf
> \# This file is managed by Puppet. DO NOT EDIT.
> 
> object Host "host.rz.example.com" {
> \[..\]
> vars.os = "linux"
> vars.disks\["disk /opt/IBM"\] = {
> disk\_cfree = "8%"
> disk\_wfree = "10%"
> }
> \`\`\`
> 
> Setting the disk\_cfree value directly raises the threshold for all disks
> \`\`\`
> object Host "host.rz.example.com" {
> \[..\]
> vars.os = "linux"
> vars.disk\_cfree = "8%"
> vars.disk\_wfree = "10%"
> \`\`\`
> 
> The check\_disk config:
> \`\`\`
> cat /etc/icinga2/conf.d/check\_disk\_monitor.rz.example.com.conf
> \# This file is managed by Puppet. DO NOT EDIT.
> 
> apply Service "check\_disk\_monitor.rz.example.com" to Host {
> display\_name = "disk"
> check\_command = "disk"
> check\_interval = 1m
> retry\_interval = 30s
> max\_check\_attempts = 5
> command\_endpoint = host.name
> vars.disk\_all = true
> assign where host.vars.puppetversion
> }
> \`\`\`

---

<div class="post-metadata">

**Author:** ![fireba11](https://community.icinga.com/letter_avatar_proxy/v4/letter/f/7ab992/32.png) [@fireba11](https://community.icinga.com/u/fireba11)\
**Post date:** [April 5, 2021, 3:34pm UTC](https://community.icinga.com/t/icinga-director-monitor-several-linux-partitions-with-their-own-disk-threshold/7037/2 "2021-04-05T15:34:19Z")

</div>

you got two options …

1. have one check per disk. then you can even template the limits (like 10% for system disk, 10GB for data disk etc.)
2. add a hole heap of custom options to the check to set different warning/critical limits  
option 2) is reasonable if you need that onle on very vew hosts, i’d go with option 1. then you can easily override limits for each check as needed

---

<div class="post-metadata">

**Author:** ![kosli](https://community.icinga.com/letter_avatar_proxy/v4/letter/k/b2d939/32.png) [@kosli](https://community.icinga.com/u/kosli)\
**Post date:** [April 5, 2021, 11:23pm UTC](https://community.icinga.com/t/icinga-director-monitor-several-linux-partitions-with-their-own-disk-threshold/7037/3 "2021-04-05T23:23:31Z")

</div>

Thanks @fireba11 . In the meantime I had implemented already option 1 as I thought this is most likely the best way to go 🙂

---

<div class="post-metadata">

**Author:** ![bamboo](https://community.icinga.com/user_avatar/community.icinga.com/bamboo/32/4190_2.png) [@bamboo](https://community.icinga.com/u/bamboo)\
**Post date:** [May 20, 2021, 8:10am UTC](https://community.icinga.com/t/icinga-director-monitor-several-linux-partitions-with-their-own-disk-threshold/7037/4 "2021-05-20T08:10:05Z")

</div>

Hello, just found this thread as we are currently in a migration process from filebased to director. We have the same issue, not only for disk but for processes as well and was wondering how this could best be solved. this is an example with services, this is defined within the host object:

```
    vars.linux_service["Service VMwareTools"] = {
        procs_argument = "/usr/bin/vmtoolsd"
        procs_warning = "1:1"
        procs_critical = "1:1"
        procs_user = "root"
    }
    vars.linux_service["Service SSH"] = {
        procs_argument = "sshd -D"
        procs_warning = "1:1"
        procs_critical = "1:1"
        procs_user = "root"
    }

```

and a simple apply rule like this:

```
apply Service for (linux_service => config in host.vars.linux_service) {
    import "default-service"
    check_command = "procs"
    command_endpoint = host.vars.remote_client

    vars += config
}

```

I doesn’t seem practical to create one check per process, as there are way to many different ones. It is also possible that i am missing something here but i couldn’t get a valid example on a scenario like this.

---

<div class="post-metadata">

**Author:** ![bamboo](https://community.icinga.com/user_avatar/community.icinga.com/bamboo/32/4190_2.png) [@bamboo](https://community.icinga.com/u/bamboo)\
**Post date:** [May 20, 2021, 11:51am UTC](https://community.icinga.com/t/icinga-director-monitor-several-linux-partitions-with-their-own-disk-threshold/7037/5 "2021-05-20T11:51:20Z")

</div>

Sorry for taking over your thread but i just found the github issue which points to this [icingaweb2-module-director/issues/337](https://github.com/Icinga/icingaweb2-module-director/issues/337).

would still be interesting to know how Thomas would solve this with custom thresholds for different services as he seems not convinced that this is the way to do it
