Initial commit

Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
Julien Riou 2024-04-27 15:18:41 +02:00
parent d547c7f607
commit 096a3e0540
No known key found for this signature in database
GPG key ID: A2EB1F2CA8E3F677
69 changed files with 1650 additions and 0 deletions

View file

@ -0,0 +1,9 @@
{{ ansible_managed | comment }}
{% for command in nagios_commands | default([]) %}
define command {
command_name {{ command['command_name'] }}
command_line {{ command['command_line'] }}
}
{% endfor %}

View file

@ -0,0 +1,10 @@
{{ ansible_managed | comment }}
{% for hostgroup in nagios_hostgroups | default([]) %}
define hostgroup {
hostgroup_name {{ hostgroup['hostgroup_name'] }}
alias {{ hostgroup['alias'] }}
members {{ hostgroup['members'] | sort | join(',') }}
}
{% endfor %}

View file

@ -0,0 +1,11 @@
{{ ansible_managed | comment }}
{% for host in nagios_hosts | default([]) %}
define host {
use {{ host['use'] }}
host_name {{ host['host_name'] }}
alias {{ host['alias'] }}
address {{ host['address'] }}
}
{% endfor %}

View file

@ -0,0 +1,23 @@
{{ ansible_managed | comment }}
{% for service in nagios_services | default([]) %}
define service {
use {{ service['use'] }}
hostgroup_name {{ service['hostgroup_name'] }}
service_description {{ service['service_description'] }}
check_command {{ service['check_command'] }}
}
{% endfor %}
{% for service_dependency in nagios_service_dependencies | default([]) %}
define servicedependency {
host_name {{ service_dependency['host_name'] }}
service_description {{ service_dependency['service_description'] }}
dependent_host_name {{ service_dependency['dependent_host_name'] }}
dependent_service_description {{ service_dependency['dependent_service_description'] }}
execution_failure_criteria {{ service_dependency['execution_failure_criteria'] }}
notification_failure_criteria {{ service_dependency['notification_failure_criteria'] }}
}
{% endfor %}

View file

@ -0,0 +1,31 @@
{{ ansible_managed | comment }}
{% for template in nagios_host_templates | default([]) %}
define host {
register 0 ; template
name {{ template['name'] }}
use {{ template['use'] }}
check_command {{ template['check_command'] }}
contact_groups {{ template['contact_groups'] }}
notification_options {{ template['notification_options'] | sort | join(',') }}
check_interval {{ template['check_interval'] }}
retry_interval {{ template['retry_interval'] }}
max_check_attempts {{ template['max_check_attempts'] }}
notification_interval {{ template['notification_interval'] }}
}
{% endfor %}
{% for template in nagios_service_templates | default([]) %}
define service {
register 0 ; template
name {{ template['name'] }}
use {{ template['use'] }}
contact_groups {{ template['contact_groups'] }}
check_interval {{ template['check_interval'] }}
retry_interval {{ template['retry_interval'] }}
max_check_attempts {{ template['max_check_attempts'] }}
notification_interval {{ template['notification_interval'] }}
}
{% endfor %}

View file

@ -0,0 +1,35 @@
{{ ansible_managed | comment }}
{% for contact in nagios_contacts | default([]) %}
define contact {
contact_name {{ contact['contact_name'] }}
use {{ contact['use'] }}
alias {{ contact['alias'] }}
email {{ contact['email'] }}
{% if 'pager' in contact %}
pager {{ contact['pager'] }}
{% endif %}
{% if 'host_notifications_enabled' in contact %}
host_notifications_enabled {{ contact['host_notifications_enabled'] }}
{% endif %}
{% if 'service_notifications_enabled' in contact %}
service_notifications_enabled {{ contact['service_notifications_enabled'] }}
{% endif %}
{% if 'host_notification_commands' in contact %}
host_notification_commands {{ contact['host_notification_commands'] }}
{% endif %}
{% if 'service_notification_commands' in contact %}
service_notification_commands {{ contact['service_notification_commands'] }}
{% endif %}
}
{% endfor %}
{% for contact_group in nagios_contact_groups | default([]) %}
define contactgroup {
contactgroup_name {{ contact_group['contactgroup_name'] }}
alias {{ contact_group['alias'] }}
members {{ contact_group['members'] | sort | join(',') }}
}
{% endfor %}

View file

@ -0,0 +1,3 @@
{% for user in nagios_htdigest_users | default([]) %}
{{ user['name'] }}:{{ user['hash'] }}
{% endfor %}