forked from infra/ansible
Zabbix: Move DNS checks from Nagios
Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
This commit is contained in:
parent
e537215abc
commit
9e3cd9d4ff
4 changed files with 82 additions and 8 deletions
55
roles/dns/files/zabbix/template.yml
Normal file
55
roles/dns/files/zabbix/template.yml
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
zabbix_export:
|
||||
version: '7.0'
|
||||
template_groups:
|
||||
- uuid: a333cbd6a3ad44baaa4eee4b0c0b1bec
|
||||
name: Fedora
|
||||
templates:
|
||||
- uuid: 469d49d18d9f4da28aaf775b50084b08
|
||||
template: 'DNS checks'
|
||||
name: 'DNS checks'
|
||||
groups:
|
||||
- name: Fedora
|
||||
items:
|
||||
- uuid: 681147b6755a453ab5e26e2ad8ad2402
|
||||
name: 'DNS performance for fedoraproject.org'
|
||||
type: ZABBIX_ACTIVE
|
||||
key: 'net.dns.perf[,fedoraproject.org,A]'
|
||||
value_type: FLOAT
|
||||
trends: '0'
|
||||
units: ms
|
||||
preprocessing:
|
||||
- type: MULTIPLIER
|
||||
parameters:
|
||||
- '1000'
|
||||
tags:
|
||||
- tag: component
|
||||
value: dns
|
||||
triggers:
|
||||
- uuid: c5721fb738374074a26810e8e75b260d
|
||||
expression: 'avg(/DNS checks/net.dns.perf[,fedoraproject.org,A],#3)>1000'
|
||||
name: 'DNS performance for fedoraproject.org is more than 1s'
|
||||
priority: AVERAGE
|
||||
tags:
|
||||
- tag: scope
|
||||
value: performance
|
||||
- uuid: e189ee7aee2c451586573a1d03207a98
|
||||
name: 'DNS query for fedoraproject.org'
|
||||
type: ZABBIX_ACTIVE
|
||||
key: 'net.dns.record[,fedoraproject.org,A]'
|
||||
value_type: CHAR
|
||||
trends: '0'
|
||||
tags:
|
||||
- tag: component
|
||||
value: dns
|
||||
triggers:
|
||||
- uuid: 225808c08f0a480a948d68ef43fe2d10
|
||||
expression: 'find(/DNS checks/net.dns.record[,fedoraproject.org,A],,"like","fedoraproject.org A")=0'
|
||||
name: 'DNS query for fedoraproject.org is incorrect'
|
||||
priority: HIGH
|
||||
description: |
|
||||
https://www.zabbix.com/documentation/7.0/en/manual/appendix/functions/history#find
|
||||
|
||||
returns 0 if string not found, so we test for 0. look for fedoraproject.org because some are internal (10.x) records and some are external (38.x) records
|
||||
tags:
|
||||
- tag: scope
|
||||
value: availability
|
||||
|
|
@ -122,3 +122,30 @@
|
|||
service: name=named state=started enabled=yes
|
||||
tags:
|
||||
- dns
|
||||
|
||||
- name: Zabbix API Block
|
||||
vars:
|
||||
ansible_zabbix_auth_key: "{{ zabbix_auth_key }}"
|
||||
ansible_network_os: "{{ zabbix_network_os }}"
|
||||
ansible_connection: "{{ zabbix_connection }}"
|
||||
ansible_httpapi_port: "{{ zabbix_httpapi_port }}"
|
||||
ansible_httpapi_use_ssl: "{{ zabbix_httpapi_use_ssl }}"
|
||||
ansible_httpapi_validate_certs: "{{ zabbix_httpapi_validate_certs }}"
|
||||
ansible_host: "{{ zabbix_server }}"
|
||||
ansible_zabbix_url_path: "{{ zabbix_url_path }}"
|
||||
tags:
|
||||
- zabbix_api
|
||||
- zabbix_agent
|
||||
- dns
|
||||
block:
|
||||
- name: Import DNS Zabbix template file
|
||||
community.zabbix.zabbix_template:
|
||||
template_yaml: "{{ lookup('file', 'zabbix/template.yml') }}"
|
||||
state: present
|
||||
run_once: true
|
||||
|
||||
- name: Add self to DNS template in Zabbix
|
||||
community.zabbix.zabbix_host:
|
||||
host_name: "{{ inventory_hostname }}"
|
||||
link_templates: DNS checks
|
||||
force: false
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
define service {
|
||||
hostgroup_name dns
|
||||
service_description DNS: fp.o
|
||||
check_command check_dns_fpo
|
||||
use criticaltemplate
|
||||
}
|
||||
|
|
@ -221,7 +221,6 @@
|
|||
ansible.builtin.copy: src=nagios/services/{{ item }} dest=/etc/nagios/services/{{ item }}
|
||||
with_items:
|
||||
- copr.cfg
|
||||
- dns.cfg
|
||||
- memcached.cfg
|
||||
- nagios.cfg
|
||||
- pagure_redis.cfg
|
||||
|
|
@ -243,7 +242,6 @@
|
|||
- name: Copy /etc/nagios/services (External)
|
||||
ansible.builtin.copy: src=nagios/services/{{ item }} dest=/etc/nagios/services/{{ item }}
|
||||
with_items:
|
||||
- dns.cfg
|
||||
- smtp-mm.cfg
|
||||
- templates.cfg
|
||||
- ping-ipv6.cfg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue