Modularize declaration of Nagios commands
This commit is contained in:
parent
2a7d343ef1
commit
1ca062d6ea
@ -1,5 +1,9 @@
|
|||||||
# This file is managed via Ansible
|
#
|
||||||
# Any changes made WILL be overwritten
|
# STOP
|
||||||
|
#
|
||||||
|
# This file is managed via Ansible; any changes made WILL be overwritten
|
||||||
|
# If you need to add site-specific configuration, do it in another file!
|
||||||
|
#
|
||||||
|
|
||||||
# Templates
|
# Templates
|
||||||
define host {
|
define host {
|
||||||
@ -37,18 +41,27 @@ define contact {
|
|||||||
email rehashedsalt@cock.li
|
email rehashedsalt@cock.li
|
||||||
}
|
}
|
||||||
|
|
||||||
# Default hostgroup and its checks
|
# Default hostgroup
|
||||||
define hostgroup {
|
define hostgroup {
|
||||||
hostgroup_name ansible
|
hostgroup_name ansible
|
||||||
alias Ansible-managed Hosts
|
alias Ansible-managed Hosts
|
||||||
}
|
}
|
||||||
|
|
||||||
# Commands
|
# Commands
|
||||||
|
# Everything here is defined in nagios_commands
|
||||||
|
{% if nagios_commands is defined %}
|
||||||
|
{% for command in nagios_commands %}
|
||||||
define command {
|
define command {
|
||||||
# This command is included in the container image
|
command_name {{ command.name }}
|
||||||
command_name check_nrpe
|
command_line {{ command.line }}
|
||||||
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
|
{% if command.extra is defined %}
|
||||||
|
{% for kvp in command.extra %}
|
||||||
|
{{ kvp.key }} {{ kvp.value }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# Services
|
# Services
|
||||||
# Everything here is defined in nagios_services
|
# Everything here is defined in nagios_services
|
||||||
|
@ -5,6 +5,10 @@
|
|||||||
- name: template out config for nagios
|
- name: template out config for nagios
|
||||||
template: src=nagios-ansible.cfg.j2 dest=/data/nagios/etc/objects/ansible.cfg owner=root group=root mode=0644
|
template: src=nagios-ansible.cfg.j2 dest=/data/nagios/etc/objects/ansible.cfg owner=root group=root mode=0644
|
||||||
vars:
|
vars:
|
||||||
|
nagios_commands:
|
||||||
|
# This command is included in the container image
|
||||||
|
- name: check_nrpe
|
||||||
|
command: "$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$"
|
||||||
nagios_services:
|
nagios_services:
|
||||||
# Agentless checks
|
# Agentless checks
|
||||||
- name: HTTP
|
- name: HTTP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user