1
0
Fork 0
forked from infra/ansible

Zabbix: migrate Copr ping check on the copr-be from Nagios

Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
This commit is contained in:
Greg Sutcliffe 2026-06-04 13:22:25 +01:00
commit 1b8573d6bc
Signed by: gwmngilfen
SSH key fingerprint: SHA256:dNHcz65ApR68w2TkCIAXDBdt4oNL62Fyx48U7dXWuk0
6 changed files with 109 additions and 10 deletions

View file

@ -0,0 +1 @@
UserParameter=copr.ping,/usr/bin/copr-ping-check.py

View file

@ -0,0 +1,55 @@
zabbix_export:
version: '7.0'
template_groups:
- uuid: a333cbd6a3ad44baaa4eee4b0c0b1bec
name: Fedora
templates:
- uuid: 6b28fcfe9ca94acd8dd900905754d10f
template: 'Copr BE checks'
name: 'Copr BE checks'
groups:
- name: Fedora
items:
- uuid: ebc1f1bf301640b4a316ab1d0e95dedd
name: 'Build copr-ping check (seconds)'
type: ZABBIX_ACTIVE
key: copr.ping
delay: 5m
trends: '0'
preprocessing:
- type: REGEX
parameters:
- 'last stop (.*) seconds'
- \1
error_handler: CUSTOM_VALUE
error_handler_params: '999999'
tags:
- tag: application
value: copr
- tag: team
value: copr
triggers:
- uuid: 509a697156324112a6e4838e998879a6
expression: 'last(/Copr BE checks/copr.ping)>2160'
name: 'copr-ping check older than 36mins'
priority: WARNING
dependencies:
- name: 'copr-ping check older than 50mins'
expression: 'last(/Copr BE checks/copr.ping)>3000'
tags:
- tag: scope
value: availability
- tag: team
value: copr
- uuid: db21d936a57540d29f145085a51dabfd
expression: 'last(/Copr BE checks/copr.ping)>3000'
name: 'copr-ping check older than 50mins'
priority: AVERAGE
tags:
- tag: scope
value: availability
- tag: team
value: copr
tags:
- tag: team
value: copr

View file

@ -18,7 +18,7 @@
ansible.builtin.file:
path: "{{ ping_log }}"
owner: "{{ ping_user }}"
group: nagios
group: zabbix
mode: '0644'
state: touch
register: ping_log_created
@ -43,14 +43,14 @@
dest: "/usr/bin/copr-ping-check.py"
src: "copr-ping-check.py.j2"
owner: "{{ ping_user }}"
group: "nagios"
group: "zabbix"
mode: "0750"
tags: copr_ping
- name: Selinux - allow nrpe_t to read ping_log
sefcontext:
target: "{{ ping_log }}"
setype: nrpe_var_run_t
setype: zabbix_log_t
state: present
register: semanage_run
tags: copr_ping

View file

@ -454,3 +454,9 @@
path: /var/lib/pgsql/data/pg_hba.conf
line: local all resalloc peer
notify: Restart postgresql
- name: Configure COPR BE monitoring in Zabbix
ansible.builtin.include_tasks: zabbix.yml
tags:
- zabbix_agent
- zabbix_api

View file

@ -0,0 +1,44 @@
# Zabbix monitoring of the COPR BE status
- name: Install Zabbix agent config drop-in
ansible.builtin.copy:
src: zabbix/agent-copr-be.conf
dest: /etc/zabbix/zabbix_agentd.d/copr-be.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 BE template file
community.zabbix.zabbix_template:
template_yaml: "{{ lookup('file', 'zabbix/template-copr-be.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 BE template in Zabbix
community.zabbix.zabbix_host:
host_name: "{{ inventory_hostname }}"
host_groups: Copr Hosts
link_templates: Copr BE checks
force: false

View file

@ -1,10 +1,3 @@
define service {
hostgroup_name copr_back_aws, copr_back_dev_aws
service_description The copr-ping package builds
check_command check_by_nrpe!check_copr_ping
use defaulttemplate
}
define service {
hostgroup_name copr_dist_git_aws
service_description http-copr-be.aws.fedoraproject.org