[icinga-checkins] icinga.org: icinga2-ansible/master: Added Plesk and WHM services.

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


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

Author: Valentino Gagliardi <valentino.g at servermanaged.it>
Date:   Mon Jun  2 14:40:11 2014 +0200

Added Plesk and WHM services.

---

 templates/host_def.j2      |   26 +++++++++++++++++++++++++-
 templates/plesk_service.j2 |    5 +++++
 templates/whm_service.j2   |    5 +++++
 vars/icinga2_services.yml  |    2 ++
 4 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/templates/host_def.j2 b/templates/host_def.j2
index d4d9a48..f6540ff 100644
--- a/templates/host_def.j2
+++ b/templates/host_def.j2
@@ -25,7 +25,7 @@ object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
 }
 {% endfor %}
 
-{% for host in groups['checks_all'] %}
+{% for host in groups['smtp_http'] %}
 object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
   import "generic-host"
   address = "{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}"
@@ -34,3 +34,27 @@ object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
   vars.smtp = "yes"
 }
 {% endfor %}
+
+{% for host in groups['plesk'] %}
+object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
+  import "generic-host"
+  address = "{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}"
+  #This host will be monitored for http, smtp, plesk and ping
+  vars.http = "yes"
+  vars.smtp = "yes"
+  vars.plesk = "yes"
+  vars.tcp_port = "8443"
+}
+{% endfor %}
+
+{% for host in groups['whm_cpanel'] %}
+object Host "{{ hostvars[host]['ansible_fqdn'] }}" {
+  import "generic-host"
+  address = "{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}"
+  #This host will be monitored for http, smtp, whm and ping
+  vars.http = "yes"
+  vars.smtp = "yes"
+  vars.whm = "yes"
+  vars.tcp_port = "2087"
+}
+{% endfor %}
diff --git a/templates/plesk_service.j2 b/templates/plesk_service.j2
new file mode 100644
index 0000000..7a889b7
--- /dev/null
+++ b/templates/plesk_service.j2
@@ -0,0 +1,5 @@
+apply Service "plesk" {
+  import "generic-service"
+  check_command = "tcp"
+  assign where host.vars.plesk == "yes"
+}
diff --git a/templates/whm_service.j2 b/templates/whm_service.j2
new file mode 100644
index 0000000..ec2fa18
--- /dev/null
+++ b/templates/whm_service.j2
@@ -0,0 +1,5 @@
+apply Service "whm" {
+  import "generic-service"
+  check_command = "tcp"
+  assign where host.vars.whm == "yes"
+}
diff --git a/vars/icinga2_services.yml b/vars/icinga2_services.yml
index 8f215ca..a6d58b3 100644
--- a/vars/icinga2_services.yml
+++ b/vars/icinga2_services.yml
@@ -2,3 +2,5 @@
 services:
  - { template: "smtp_service.j2" , config: "smtp_service.conf" }
  - { template: "http_service.j2" , config: "http_service.conf" }
+ - { template: "plesk_service.j2" , config: "plesk_service.conf" }
+ - { template: "whm_service.j2" , config: "whm_service.conf" }



More information about the icinga-checkins mailing list