summaryrefslogtreecommitdiffstats
path: root/test/config/8063.conf
blob: 75676d1eacb7140c6d33fc53f740bfaae0ab0572 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
object CheckCommand "8063-my-disk" {
  command = [ PluginDir + "/check_disk" ]

  arguments = {
    "-w" = {
      value = "$disk_wfree$"
      description = "Exit with WARNING status if less than INTEGER units of disk are free or Exit with WARNING status if less than PERCENT of disk space is free"
      required = true
    }
    "-c" = {
      value = "$disk_cfree$"
      description = "Exit with CRITICAL status if less than INTEGER units of disk are free or Exit with CRITCAL status if less than PERCENT of disk space is free"
      required = true
    }
    "-W" = {
      value = "$disk_inode_wfree$"
      description = "Exit with WARNING status if less than PERCENT of inode space is free"
    }
    "-K" = {
      value = "$disk_inode_cfree$"
      description = "Exit with CRITICAL status if less than PERCENT of inode space is free"
    }
    "-p" = {
      value = "$disk_partitions$"
      description = "Path or partition (may be repeated)"
      repeat_key = true
      order = 1
    }
    "-x" = {
      value = "$disk_partitions_excluded$"
      description = "Ignore device (only works if -p unspecified)"
    }
  }

  vars.disk_wfree = "20%"
  vars.disk_cfree = "10%"
}

object Host "8063-my-server" {
  import "generic-host"
  address = "127.0.0.1"
  address6 = "::1"

  vars.local_disks["basic-partitions"] = {
    disk_partitions = [ "/", "/tmp", "/var", "/home", "/run/user/1000/gvfs" ]
  }
}

apply Service "8063-" for (disk => config in host.vars.local_disks) {
  import "generic-service"
  check_command = "8063-my-disk"
  check_interval = 5s
  retry_interval = 5s

  volatile = true
  vars.volatile_check = true

  vars += config

  vars.disk_wfree = "10%"
  vars.disk_cfree = "5%"

  assign where host.vars.local_disks
}

apply Notification "disk-notification" to Service {
  import "test-mail-service-notification"

  users = [ "test-icingaadmin" ]

  assign where service.vars.volatile_check == true
}