---
# Copyright 2014, Rackspace US, Inc.
#
# 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.

- include: local_setup.yml
  vars:
    check_name: conntrack_count
    check_details: file={{ check_name }}.py
    check_period: "{{ maas_check_period }}"
    check_timeout: "{{ maas_check_timeout }}"
    alarms:
      - { 'name': 'conntrack_count_status', 'criteria': ':set consecutiveCount={{ maas_alarm_local_consecutive_count }} if (percentage(metric["ip_conntrack_count"], metric["ip_conntrack_max"]) > 90) { return new AlarmStatus(CRITICAL, "Connection count is > 90% of maximum allowed."); }' }
  user: root

---
# Copyright 2014, Rackspace US, Inc.
#
# 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.

- include: local_setup.yml
  vars:
    check_name: conntrack_count
    check_details: file={{ check_name }}.py
    check_period: "{{ maas_check_period }}"
    check_timeout: "{{ maas_check_timeout }}"
    alarms:
      - { 'name': 'conntrack_count_status', 'criteria': ':set consecutiveCount={{ maas_alarm_local_consecutive_count }} if (percentage(metric["nf_conntrack_count"], metric["nf_conntrack_max"]) > 90) { return new AlarmStatus(CRITICAL, "Connection count is > 90% of maximum allowed."); }' }
  user: root

Fix typographical error in nf_conntrack metrics
Fix typographical error in nf_conntrack metrics

Metric names fixed:

ip_conntrack_count -> nf_conntrack_count
ip_conntrack_max -> nf_conntrack_max
