[icinga-checkins] icinga.org: icinga2-ansible/master: Added disk, home and var NRPE services

git at icinga.org git at icinga.org
Sat Jun 7 13:16:05 CEST 2014


Module: icinga2-ansible
Branch: master
Commit: 7e01e8f56bbdb72218083688ea8c69247890e6f2
URL:    https://git.icinga.org/?p=icinga2-ansible.git;a=commit;h=7e01e8f56bbdb72218083688ea8c69247890e6f2

Author: Valentino Gagliardi <valentino.g at servermanaged.it>
Date:   Mon Jun  2 15:52:32 2014 +0200

Added disk, home and var NRPE services

---

 templates/host_def.j2                   |   18 ++++++++++++++++++
 templates/services/disk_nrpe_service.j2 |    6 ++++++
 templates/services/home_nrpe_service.j2 |    6 ++++++
 templates/services/var_nrpe_service.j2  |    6 ++++++
 vars/icinga2_services.yml               |    3 +++
 5 files changed, 39 insertions(+)

diff --git a/templates/host_def.j2 b/templates/host_def.j2
index 03a450b..868a21c 100644
--- a/templates/host_def.j2
+++ b/templates/host_def.j2
@@ -4,6 +4,9 @@ object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
   address = "{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}"
   vars.smtp = "no" 
   vars.nrpe_load = "yes"
+  vars.nrpe_disk = "yes"
+  vars.nrpe_var = "yes"
+  vars.nrpe_home = "yes"
 }
 {% endfor %}
 
@@ -13,6 +16,9 @@ object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
   address = "{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}"
   vars.smtp = "yes"
   vars.nrpe_load = "yes"
+  vars.nrpe_disk = "yes"
+  vars.nrpe_var = "yes"
+  vars.nrpe_home = "yes"
 }
 {% endfor %}
 
@@ -22,6 +28,9 @@ object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
   address = "{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}"
   vars.http = "yes"
   vars.nrpe_load = "yes"
+  vars.nrpe_disk = "yes"
+  vars.nrpe_var = "yes"
+  vars.nrpe_home = "yes"
 }
 {% endfor %}
 
@@ -32,6 +41,9 @@ object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
   vars.http = "yes"
   vars.smtp = "yes"
   vars.nrpe_load = "yes"
+  vars.nrpe_disk = "yes"
+  vars.nrpe_var = "yes"
+  vars.nrpe_home = "yes"
 }
 {% endfor %}
 
@@ -44,6 +56,9 @@ object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
   vars.plesk = "yes"
   vars.tcp_port = "8443"
   vars.nrpe_load = "yes"
+  vars.nrpe_disk = "yes"
+  vars.nrpe_var = "yes"
+  vars.nrpe_home = "yes"
 }
 {% endfor %}
 
@@ -56,5 +71,8 @@ object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
   vars.whm = "yes"
   vars.tcp_port = "2087"
   vars.nrpe_load = "yes"
+  vars.nrpe_disk = "yes"
+  vars.nrpe_var = "yes"
+  vars.nrpe_home = "yes"
 }
 {% endfor %}
diff --git a/templates/services/disk_nrpe_service.j2 b/templates/services/disk_nrpe_service.j2
new file mode 100644
index 0000000..af1c702
--- /dev/null
+++ b/templates/services/disk_nrpe_service.j2
@@ -0,0 +1,6 @@
+apply Service "disk" {
+  import "generic-service"
+  check_command = "check_nrpe"
+  vars.remote_nrpe_command = "check_disk"
+  assign where host.vars.nrpe_disk == "yes"
+}
diff --git a/templates/services/home_nrpe_service.j2 b/templates/services/home_nrpe_service.j2
new file mode 100644
index 0000000..a6bca1d
--- /dev/null
+++ b/templates/services/home_nrpe_service.j2
@@ -0,0 +1,6 @@
+apply Service "home" {
+  import "generic-service"
+  check_command = "check_nrpe"
+  vars.remote_nrpe_command = "check_home"
+  assign where host.vars.nrpe_home == "yes"
+}
diff --git a/templates/services/var_nrpe_service.j2 b/templates/services/var_nrpe_service.j2
new file mode 100644
index 0000000..def2e63
--- /dev/null
+++ b/templates/services/var_nrpe_service.j2
@@ -0,0 +1,6 @@
+apply Service "var" {
+  import "generic-service"
+  check_command = "check_nrpe"
+  vars.remote_nrpe_command = "check_var"
+  assign where host.vars.nrpe_var == "yes"
+}
diff --git a/vars/icinga2_services.yml b/vars/icinga2_services.yml
index 1b71b42..e7ddf1c 100644
--- a/vars/icinga2_services.yml
+++ b/vars/icinga2_services.yml
@@ -5,3 +5,6 @@ services:
  - { template: "plesk_service.j2" , config: "plesk_service.conf" }
  - { template: "whm_service.j2" , config: "whm_service.conf" }
  - { template: "load_nrpe_service.j2" , config: "load_nrpe_service.conf" }
+ - { template: "disk_nrpe_service.j2" , config: "disk_nrpe_service.conf" }
+ - { template: "var_nrpe_service.j2" , config: "var_nrpe_service.conf" }
+ - { template: "home_nrpe_service.j2" , config: "home_nrpe_service.conf" }



More information about the icinga-checkins mailing list