icinga: add apt and disk service definitions

This commit is contained in:
Markus 2024-10-28 19:53:06 +01:00
parent c2b8944756
commit df069adc5e
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,21 @@
apply Service "apt" {
import "generic-service"
check_command = "apt"
command_endpoint = host.vars.agent_endpoint
assign where host.vars.agent_endpoint && host.vars.os == "Linux"
}
apply Service "disk" for (disk => config in host.vars.disks) {
import "generic-service"
check_command = "disk"
command_endpoint = host.vars.agent_endpoint
assign where host.vars.agent_endpoint
vars += config
}

View File

@ -72,6 +72,10 @@
owner: "{{ icinga_user }}" owner: "{{ icinga_user }}"
group: "{{ icinga_group }}" group: "{{ icinga_group }}"
- name: Configure services
copy: src=icinga2/zones.d/master/services.conf dest=/etc/icinga2/zones.d/master/services.conf owner={{ icinga_user }} group={{ icinga_group }}
notify: Restart icinga2
- name: Configure zones - name: Configure zones
template: src=icinga2/zones.conf.j2 dest=/etc/icinga2/zones.conf owner={{ icinga_user }} group={{ icinga_group }} template: src=icinga2/zones.conf.j2 dest=/etc/icinga2/zones.conf owner={{ icinga_user }} group={{ icinga_group }}
notify: Restart icinga2 notify: Restart icinga2