forked from infra/ansible
Zabbix: Move Copr-fe CDN check from Nagios
Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
This commit is contained in:
parent
743f69c8a8
commit
7516de601e
6 changed files with 93 additions and 8 deletions
1
roles/copr/frontend/files/zabbix/agent-copr-fe.conf
Normal file
1
roles/copr/frontend/files/zabbix/agent-copr-fe.conf
Normal file
|
|
@ -0,0 +1 @@
|
|||
UserParameter=copr.cdn,/usr/bin/copr-cdn-check.py
|
||||
38
roles/copr/frontend/files/zabbix/template-copr-fe.yml
Normal file
38
roles/copr/frontend/files/zabbix/template-copr-fe.yml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
zabbix_export:
|
||||
version: '7.0'
|
||||
template_groups:
|
||||
- uuid: a333cbd6a3ad44baaa4eee4b0c0b1bec
|
||||
name: Fedora
|
||||
templates:
|
||||
- uuid: 21645ff5fead4d55ad10997123dee18d
|
||||
template: 'Copr FE checks'
|
||||
name: 'Copr FE checks'
|
||||
description: 'Checks from the COPR frontends'
|
||||
groups:
|
||||
- name: Fedora
|
||||
items:
|
||||
- uuid: 6561e5e7bb814f8792913dd270d299b9
|
||||
name: 'CDN check'
|
||||
type: ZABBIX_ACTIVE
|
||||
key: copr.cdn
|
||||
delay: 5m
|
||||
value_type: TEXT
|
||||
trends: '0'
|
||||
description: 'Gathered by a python script on-disk'
|
||||
tags:
|
||||
- tag: application
|
||||
value: cdn
|
||||
- tag: team
|
||||
value: copr
|
||||
triggers:
|
||||
- uuid: 2b463c658f7d4af1a2241ae3a7f0e4da
|
||||
expression: 'last(/Copr FE checks/copr.cdn)<>"Copr''s CDN (https://download.copr.fedorainfracloud.org/) is UP"'
|
||||
name: 'COPR CDN Check failed'
|
||||
tags:
|
||||
- tag: scope
|
||||
value: availability
|
||||
- tag: team
|
||||
value: copr
|
||||
tags:
|
||||
- tag: team
|
||||
value: copr
|
||||
|
|
@ -247,7 +247,7 @@
|
|||
ansible.builtin.template:
|
||||
dest: "/usr/bin/copr-cdn-check.py"
|
||||
src: "copr-cdn-check.py.j2"
|
||||
group: "nagios"
|
||||
group: "zabbix"
|
||||
mode: "0750"
|
||||
vars:
|
||||
api_key: "{{ copr_uptimerobot_api_key_ro | default('not-configured') }}"
|
||||
|
|
@ -257,3 +257,9 @@
|
|||
ansible.builtin.copy: src=gai.conf dest=/etc
|
||||
notify:
|
||||
- Reload httpd
|
||||
|
||||
- name: Configure COPR FE monitoring in Zabbix
|
||||
ansible.builtin.include_tasks: monitoring.yml
|
||||
tags:
|
||||
- zabbix_agent
|
||||
- zabbix_api
|
||||
|
|
|
|||
44
roles/copr/frontend/tasks/monitoring.yml
Normal file
44
roles/copr/frontend/tasks/monitoring.yml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# Zabbix monitoring of the COPR FE status
|
||||
|
||||
- name: Install Zabbix agent config drop-in
|
||||
ansible.builtin.copy:
|
||||
src: zabbix/agent-copr-fe.conf
|
||||
dest: /etc/zabbix/zabbix_agentd.d/copr-fe.conf
|
||||
mode: '0644'
|
||||
notify:
|
||||
- Restart zabbix agent
|
||||
tags:
|
||||
- zabbix_agent
|
||||
|
||||
- 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
|
||||
block:
|
||||
- name: Import COPR FE template file
|
||||
community.zabbix.zabbix_template:
|
||||
template_yaml: "{{ lookup('file', 'zabbix/template-copr-fe.yml') }}"
|
||||
state: present
|
||||
run_once: true
|
||||
|
||||
- name: Ensure COPR Zabbix hostgroup is present
|
||||
community.zabbix.zabbix_group:
|
||||
host_groups:
|
||||
- Copr Hosts
|
||||
state: present
|
||||
run_once: true
|
||||
|
||||
- name: Add self to COPR FE template in Zabbix
|
||||
community.zabbix.zabbix_host:
|
||||
host_name: "{{ inventory_hostname }}"
|
||||
host_groups: Copr Hosts
|
||||
link_templates: Copr FE checks
|
||||
force: false
|
||||
|
|
@ -5,13 +5,6 @@ define service {
|
|||
use defaulttemplate
|
||||
}
|
||||
|
||||
define service {
|
||||
hostgroup_name copr_front_aws, copr_front_dev_aws
|
||||
service_description The copr cdn status
|
||||
check_command check_by_nrpe!check_copr_cdn
|
||||
use defaulttemplate
|
||||
}
|
||||
|
||||
define service {
|
||||
hostgroup_name copr_dist_git_aws
|
||||
service_description http-copr-be.aws.fedoraproject.org
|
||||
|
|
|
|||
|
|
@ -107,9 +107,12 @@
|
|||
operator: "equals"
|
||||
value: "team"
|
||||
value2: "copr"
|
||||
formulaid: A
|
||||
- type: "host_group"
|
||||
operator: "equals"
|
||||
value: "Copr Hosts"
|
||||
formulaid: B
|
||||
formula: A or B
|
||||
operations:
|
||||
- type: send_message
|
||||
media_type: "Matrix"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue