Browse Source

use grains.fqdn and localhost

sensu
vmikes 8 years ago
parent
commit
5f2c93ccdb
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      mongodb/meta/sensu.yml

+ 4
- 4
mongodb/meta/sensu.yml View File

@@ -1,9 +1,9 @@
{%- from "linux/map.jinja" import network with context -%}
{%- if grains.ipv4[0] == '127.0.0.1' %}{%- set address = grains.ipv4[1] %}{% else %}{%- set address = grains.ipv4[0] %}{% endif %}
{%- from "mongodb/map.jinja" import server with context -%}
{%- if server.bind.address == '0.0.0.0' %}{%- set address = '127.0.0.1' %}{% else %}{%- set address = server.bind.address %}{% endif %}
check:
remote_mongodb_mdb_{{ network.fqdn }}:
remote_mongodb_mdb_{{ grains.fqdn }}:
command: "PATH=$PATH:/etc/sensu/plugins check_mongodb.py -H {{ address }} -A connect -P 27017"
interval: 60
occurrences: 1
subscribers:
- local-mongodb-server
- local-mongodb-server

Loading…
Cancel
Save