~canonical-sysadmins/charms/trusty/wordpress-services/trunk

« back to all changes in this revision

Viewing changes to templates/wp-nagios.j2

  • Committer: Thomas Cuthbert
  • Date: 2016-12-21 00:53:23 UTC
  • mfrom: (108.13.1 wordpress-services)
  • Revision ID: thomas.cuthbert@canonical.com-20161221005323-0l3hbt3o3rqrtov2
[sajoupa,r=tcuthbert] merge with lp:~canonical-sysadmins/canonical-is-charms/wordpress-services

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
#    "             "
3
 
#  mmm   m   m   mmm   m   m
4
 
#    #   #   #     #   #   #
5
 
#    #   #   #     #   #   #
6
 
#    #   "mm"#     #   "mm"#
7
 
#    #             #
8
 
#  ""            ""
9
 
# This file is managed by Juju. Do not make local changes.
10
 
 
11
 
{% macro servicegroup(default='juju') -%}
12
 
    {%- if config['nagios_servicegroups'] -%}
13
 
{{ config['nagios_servicegroups'] }}
14
 
    {%- elif config['nagios_context'] -%}
15
 
{{ config['nagios_context'] }}
16
 
    {%- else -%}
17
 
{{ default }}
18
 
    {%- endif -%}
19
 
{%- endmacro %}
20
 
 
21
 
{% for rel in nrpe_external_master -%}
22
 
define service {
23
 
    use                             active-service
24
 
    host_name                       {{rel.nagios_hostname}}
25
 
    service_description             {{rel.nagios_hostname}}[wordpress_http] Check Wordpress HTTP
26
 
    check_command                   check_nrpe!check_wordpress_http
27
 
    servicegroups                   {{ servicegroup() }}
28
 
}
29
 
 
30
 
    {% if config['ssl_enabled'] -%}
31
 
define service {
32
 
    use                             active-service
33
 
    host_name                       {{rel.nagios_hostname}}
34
 
    service_description             {{rel.nagios_hostname}}[wordpress_https] Check Wordpress HTTPS
35
 
    check_command                   check_nrpe!check_wordpress_https
36
 
    servicegroups                   {{ servicegroup() }}
37
 
}
38
 
    {%- endif %}
39
 
    {% for plugin in wordpress_plugin %}
40
 
define service {
41
 
    use                             active-service
42
 
    host_name                       {{rel.nagios_hostname}}
43
 
    service_description             {{rel.nagios_hostname}}[{{plugin['plugin_name']|replace('-','_')}}] Check {{plugin['plugin_name']}} Wordpress Plug-In
44
 
    check_command                   check_nrpe!check_{{plugin['plugin_name']|replace('-','_')}}
45
 
    servicegroups                   {{ servicegroup() }}
46
 
}
47
 
    {%- endfor %}
48
 
{%- endfor %}