aboutsummaryrefslogtreecommitdiffstats
path: root/nagios3.yaml
blob: e2ba8ccfc096e4a23cc86dcb3fc588e018d677d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
heat_template_version: 2013-05-23
description: Deploy Nagios
parameters:
  adm_web_passwd:
    type: string
    description: Password for initial admin user
    hidden: true
  external_network:
    type: string
    description: Network to attach floating ips to.
    default: ext-net
  flavor:
    type: string
    description: What flavor to use for the nagios server.
    default: m1.small
  image:
    type: string
    description: Image for Nagios.
    default: nagios
  key_name:
    type: string
    description: What Nova SSH key to use for the nagios server.
    default: default
  monitor_networks:
    type: json
    description: Neutron networks to monitor.
    default: []
  nova_os_auth_url:
    type: string
    default: ''
    description: URL for Keystone to access Nova.
  nova_os_password:
    type: string
    hidden: true
    description: password to present to nova_host_ip.
    default: ''
  nova_os_username:
    type: string
    description: username to present to nova_host_ip.
    default: ''
  nova_os_tenant_name:
    type: string
    description: tenant name to present to nova_host_ip.
    default: ''
  server_network:
    type: string
    description: Network id for server.
    default: default-net
resources:
  nagios_config:
    type: OS::Heat::StructuredConfig
    properties:
      config:
        nagios3:
          adm_web_passwd: { get_input: adm_web_passwd }
          os_auth_url: { get_input: nova_os_auth_url }
          os_password: { get_input: nova_os_password }
          os_username: { get_input: nova_os_username }
          os_tenant_name: { get_input: nova_os_tenant_name }
          monitor_networks: { get_input: monitor_networks }
        completion-signal: { get_input: deploy_signal_id }
  nagios_security_group:
    type: OS::Neutron::SecurityGroup
    properties:
      name: monitoring
      rules:
        - direction: ingress
          port_range_max: 22
          port_range_min: 22
          protocol: tcp
        - direction: ingress
          port_range_max: 80
          port_range_min: 80
          protocol: tcp
        - direction: ingress
          protocol: icmp
        - direction: egress
          protocol: tcp
        - direction: egress
          protocol: udp
        - direction: egress
          protocol: icmp
  nagios_net_port:
    type: OS::Neutron::Port
    properties:
      network_id: { get_param: server_network }
      security_groups: [ { get_resource: nagios_security_group } ]
  nagios_server:
    type: OS::Nova::Server
    properties:
      flavor: { get_param: flavor }
      image: { get_param: image }
      key_name: { get_param: key_name }
      networks:
        - network: { get_param: server_network }
          port: { get_resource: nagios_net_port }
      user_data_format: SOFTWARE_CONFIG
      user_data: {get_resource: NodeUserData}

  NodeUserData:
    type: OS::TripleO::NodeUserData

  nagios_floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network_id: { get_param: external_network }
      port_id: { get_resource: nagios_net_port }
  nagios_deploy:
    type: OS::Heat::StructuredDeployment
    properties:
      server: { get_resource: nagios_server }
      config: { get_resource: nagios_config }
      input_values:
        adm_web_passwd: { get_param: adm_web_passwd }
        nova_os_auth_url: { get_param: nova_os_auth_url }
        nova_os_password: { get_param: nova_os_password }
        nova_os_username: { get_param: nova_os_username }
        nova_os_tenant_name: { get_param: nova_os_tenant_name }
        monitor_networks: { get_param: monitor_networks }
outputs:
  nagios_address:
    description: Address of Nagios admin interface.
    value: { get_attr: [ nagios_floating_ip, floating_ip_address ] }