From 8bb8c5e1295643f3a4857302ed7e284acb66fe1d Mon Sep 17 00:00:00 2001 From: Greg Sutcliffe Date: Wed, 10 Jun 2026 12:11:12 +0100 Subject: [PATCH] Zabbix: migrate merged.log age check from Nagios Signed-off-by: Greg Sutcliffe --- roles/logging/files/zabbix-template.yml | 38 +++++++++++++++++++ roles/logging/tasks/main.yml | 27 +++++++++++++ .../services/rdu3_internal/file_age.cfg | 9 ----- roles/nagios_server/tasks/main.yml | 2 - 4 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 roles/logging/files/zabbix-template.yml delete mode 100644 roles/nagios_server/files/nagios/services/rdu3_internal/file_age.cfg diff --git a/roles/logging/files/zabbix-template.yml b/roles/logging/files/zabbix-template.yml new file mode 100644 index 0000000000..fd6dbfc589 --- /dev/null +++ b/roles/logging/files/zabbix-template.yml @@ -0,0 +1,38 @@ +zabbix_export: + version: '7.0' + template_groups: + - uuid: a333cbd6a3ad44baaa4eee4b0c0b1bec + name: Fedora + templates: + - uuid: a881e36d9d0841fc9a1d3a53ac909359 + template: 'Logserver checks' + name: 'Logserver checks' + groups: + - name: Fedora + items: + - uuid: e8fd40599812489aa4810db8605b8b54 + name: 'File age of merged.log' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/log/merged/messages.log,modify]' + units: unixtime + tags: + - tag: application + value: logs + triggers: + - uuid: 9545788aea5a40728163ae7ce2bf9d03 + expression: '(now() - last(/Logserver checks/vfs.file.time[/var/log/merged/messages.log,modify])) > 120' + name: 'Merged.log not written from over 2 mins' + priority: WARNING + dependencies: + - name: 'Merged.log not written from over 5 mins' + expression: '(now() - last(/Logserver checks/vfs.file.time[/var/log/merged/messages.log,modify])) > 300' + tags: + - tag: scope + value: traffic + - uuid: 9ebc5114d33740d68876024b91473fcc + expression: '(now() - last(/Logserver checks/vfs.file.time[/var/log/merged/messages.log,modify])) > 300' + name: 'Merged.log not written from over 5 mins' + priority: HIGH + tags: + - tag: scope + value: traffic diff --git a/roles/logging/tasks/main.yml b/roles/logging/tasks/main.yml index a6c72da019..0080aac679 100644 --- a/roles/logging/tasks/main.yml +++ b/roles/logging/tasks/main.yml @@ -58,3 +58,30 @@ - config - logging - fedora-messaging + +# Add logserver monitoroing +- 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 + block: + - name: Import Logging Zabbix template file + community.zabbix.zabbix_template: + template_yaml: "{{ lookup('file', 'zabbix-template.yml') }}" + state: present + run_once: true + + - name: Add self to Logging template in Zabbix + community.zabbix.zabbix_host: + host_name: "{{ inventory_hostname }}" + link_templates: Logserver checks + force: false diff --git a/roles/nagios_server/files/nagios/services/rdu3_internal/file_age.cfg b/roles/nagios_server/files/nagios/services/rdu3_internal/file_age.cfg deleted file mode 100644 index 41e910cdac..0000000000 --- a/roles/nagios_server/files/nagios/services/rdu3_internal/file_age.cfg +++ /dev/null @@ -1,9 +0,0 @@ -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check Merged Log - check_command check_by_nrpe!check_merged_file_age - use defaulttemplate - check_interval 120 - notification_interval 130 - event_handler restart_rsyslog -} diff --git a/roles/nagios_server/tasks/main.yml b/roles/nagios_server/tasks/main.yml index af2bf09da5..b80d453110 100644 --- a/roles/nagios_server/tasks/main.yml +++ b/roles/nagios_server/tasks/main.yml @@ -184,7 +184,6 @@ with_items: - disk.cfg - fedora_messaging.cfg - - file_age.cfg - koji.cfg - locking.cfg - nrpe.cfg @@ -200,7 +199,6 @@ with_items: - disk.cfg - fedora_messaging.cfg - - file_age.cfg - koji.cfg - locking.cfg - nrpe.cfg