~ben-kaehne/charms/trusty/nagios-extra-scripts/newchecks

« back to all changes in this revision

Viewing changes to templates/conntrack_nagios.cfg.j2

  • Committer: Jill Rouleau
  • Date: 2015-10-10 00:36:15 UTC
  • Revision ID: jill.rouleau@canonical.com-20151010003615-r72xswup4jtvwxm0
Clean up the rest of the template problems by getting parent unit name, update and sync charmhelpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#define command{
2
 
#    command_name                    check_conntrack_max
3
 
#    command_line                    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_conntrack_max -n
4
 
#}
5
 
#define service{
6
 
#    use                             generic-service
7
 
#    host_name                       juju
8
 
#    service_description             check_conntrack_max
9
 
#    check_command                   check_conntrack_max
10
 
#    }
11
 
#define command{
12
 
#    command_name                    check_conntrack_used
13
 
#    command_line                    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_conntrack_used -n
14
 
#}
15
 
#define service{
16
 
#    use                             generic-service
17
 
#    host_name                       juju
18
 
#    service_description             check_conntrack_used
19
 
#    check_command                   check_conntrack_used
20
 
#    }
21
 
##################################################################
 
1
#---------------------------------------------------
 
2
# This file is Juju managed
 
3
#---------------------------------------------------
22
4
#
23
 
#    "             "
24
 
#  mmm   m   m   mmm   m   m
25
 
#    #   #   #     #   #   #
26
 
#    #   #   #     #   #   #
27
 
#    #   "mm"#     #   "mm"#
28
 
#    #             #
29
 
#  ""            ""
30
 
# This file is managed by Juju. Do not make local changes.
31
 
 
32
5
{% macro servicegroup(default='juju') -%}
33
6
    {%- if config['nagios_servicegroups'] -%}
34
7
{{ config['nagios_servicegroups'] }}
38
11
{{ default }}
39
12
    {%- endif -%}
40
13
{%- endmacro %}
41
 
 
42
14
{% for rel in nrpe_external_master -%}
43
15
define service {
44
16
    use                             active-service
45
 
    host_name                       {{rel.nagios_hostname}}
46
 
    service_description             {{rel.nagios_hostname}}[check_conntrack_max] Check Max Connections
47
 
    check_command                   check_nrpe!check_conntrack_used
 
17
    host_name                       {{ servicegroup() }}-{{ parent_unit }}
 
18
    service_description             {{ servicegroup() }}-{{ parent_unit }}[check_conntrack_max] Check Max Connections
 
19
    check_command                   check_nrpe!check_conntrack_max
48
20
    servicegroups                   {{ servicegroup() }}
49
21
 
50
22
define service {
51
23
    use                             active-service
52
 
    host_name                       {{rel.nagios_hostname}}
53
 
    service_description             {{rel.nagios_hostname}}[check_conntrack_used] Check Used Connections
 
24
    host_name                       {{ servicegroup() }}-{{ parent_unit}}
 
25
    service_description             {{ servicegroup() }}-{{ parent_unit }}[check_conntrack_used] Check Used Connections
54
26
    check_command                   check_nrpe!check_conntrack_used
55
27
    servicegroups                   {{ servicegroup() }}
56
28
}