Modify All Disk Check

Hi everyone,

I have installed the Linux Agent on a Linux machine. The agent also checks the disks. Now I have the problem that the service recognises all partitions and often reports alarms in Icinga, which bothers me. Is it possible to modify the check to only one partition?

My Linux is: Debian10
Monitoring success with an agent

Best Wishes

Hi,

as you can see in the check description Monitoring Plugins - check_disk there is following param:

-p, --path=PATH, --partition=PARTITION
    Mount point or block device as emitted by the mount(8) command (may be repeated)
1 Like

Thanks for the feedback. Where/how can I customize this?

Haven’t tried this yet but:
create Host’s variable ‘partitions’ that lists all the partitions you want to check

I’m not sure that’s going to work. My idea that I have heard is that you can take out partiotions in the Check_Disk check.

Host definition

object Host "hostA" {
 ...
  vars.client_disk["All-discs"] = {
    disk_wfree = "20%",
    disk_cfree = "10%",
    disk_partition = ["/","/boot"], //Define more/less partitions, use mount points
    //You can add more custom variables from 'disk' check command
  }
}

Service definition

apply Service "Disc-" for (key => config in host.vars.client_disk){
  command_endpoint = host.vars.client_endpoint
  check_command = "disk"
  vars += config
}

I just tried it out and it works.

1 Like

or even shorter version

object Host "hostA" {
 ...
  vars.partitions = {
    disk_wfree = "20%",
    disk_cfree = "10%",
    disk_partition = ["/","/boot"], //Define more/less partitions, use mount points
    //You can add more custom variables from 'disk' check command
  }
}
apply Service "disk" {
  command_endpoint = host.vars.client_endpoint
  check_command = "disk"
  vars += host.vars.partitions
}
1 Like

Thanks for the information, it helps me a lot! A stupid question for a newcomer :wink: Where did you open this on the affected device?

Hi @Mamyk , would it be better for the director if I modified the all disk check so that it no longer reads all disks individually but all of them?