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 index b4a994e40e..41e910cdac 100644 --- a/roles/nagios_server/files/nagios/services/rdu3_internal/file_age.cfg +++ b/roles/nagios_server/files/nagios/services/rdu3_internal/file_age.cfg @@ -7,95 +7,3 @@ define service { notification_interval 130 event_handler restart_rsyslog } - -# Fedora Countme: -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check Fedora countme raw DB age - check_command check_by_nrpe!check_countme_fedora_raw - use defaulttemplate - check_interval 120 - notification_interval 130 -} - -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check Fedora countme totals DB age - check_command check_by_nrpe!check_countme_fedora_tot - use defaulttemplate - check_interval 120 - notification_interval 130 -} - -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check Fedora countme web DB1 age - check_command check_by_nrpe!check_countme_fedora_web1 - use defaulttemplate - check_interval 120 - notification_interval 130 -} - -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check Fedora countme web DB2 age - check_command check_by_nrpe!check_countme_fedora_web2 - use defaulttemplate - check_interval 120 - notification_interval 130 -} - -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check Fedora countme web DB3 age - check_command check_by_nrpe!check_countme_fedora_web3 - use defaulttemplate - check_interval 120 - notification_interval 130 -} - -# CentOS countme -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check CentOS countme raw DB age - check_command check_by_nrpe!check_countme_centos_raw - use defaulttemplate - check_interval 120 - notification_interval 130 -} - -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check CentOS countme totals DB age - check_command check_by_nrpe!check_countme_centos_tot - use defaulttemplate - check_interval 120 - notification_interval 130 -} - -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check CentOS countme web DB1 age - check_command check_by_nrpe!check_countme_centos_web1 - use defaulttemplate - check_interval 120 - notification_interval 130 -} - -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check CentOS countme web DB2 age - check_command check_by_nrpe!check_countme_centos_web2 - use defaulttemplate - check_interval 120 - notification_interval 130 -} - -define service { - host_name log01.rdu3.fedoraproject.org - service_description Check CentOS countme web DB3 age - check_command check_by_nrpe!check_countme_centos_web3 - use defaulttemplate - check_interval 120 - notification_interval 130 -} diff --git a/roles/web-data-analysis/files/zabbix-template.yml b/roles/web-data-analysis/files/zabbix-template.yml new file mode 100644 index 0000000000..d888ad650a --- /dev/null +++ b/roles/web-data-analysis/files/zabbix-template.yml @@ -0,0 +1,293 @@ +zabbix_export: + version: '7.0' + template_groups: + - uuid: a333cbd6a3ad44baaa4eee4b0c0b1bec + name: Fedora + templates: + - uuid: 447d0b4d8918402a916f8412a7c96f34 + template: 'Web-Data checks' + name: 'Web-Data checks' + description: 'Checks on log01 for the CountMe datasets' + groups: + - name: Fedora + items: + - uuid: de95b200d3dd4f73a598d1dbbab53f4e + name: 'CentOS countme raw DB timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/lib/countme/raw-centos.db,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: ade949dbd0a94e24925a2d291b85e65a + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/raw-centos.db,modify]) > 86400' + name: 'CentOS countme raw DB timestamp is more than 24 hours old' + priority: WARNING + dependencies: + - name: 'CentOS countme raw DB timestamp is more than 48 hours old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/raw-centos.db,modify]) > 172800' + tags: + - tag: scope + value: file_age + - uuid: 0d7a51ceb35e4016b10ba66224134d1a + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/raw-centos.db,modify]) > 172800' + name: 'CentOS countme raw DB timestamp is more than 48 hours old' + priority: HIGH + tags: + - tag: scope + value: file_age + - uuid: 19fce9d2507a4e1b847687c8489d6a8e + name: 'Fedora countme raw DB timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/lib/countme/raw.db,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: c26d7114364f4024b2c578941ec33e25 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/raw.db,modify]) > 86400' + name: 'Fedora countme raw DB timestamp is more than 24 hours old' + priority: WARNING + dependencies: + - name: 'Fedora countme raw DB timestamp is more than 48 hours old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/raw.db,modify]) > 172800' + tags: + - tag: scope + value: file_age + - uuid: 32ab177829ac4f3c9c7dedf2554e7cf3 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/raw.db,modify]) > 172800' + name: 'Fedora countme raw DB timestamp is more than 48 hours old' + priority: HIGH + tags: + - tag: scope + value: file_age + - uuid: 9b5d2df694ec4b6b82bece288fdb6b09 + name: 'CentOS countme totals DB timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/lib/countme/totals-centos.db,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: c5dc12e66f1f49209bfd415d462faab2 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/totals-centos.db,modify]) > 604800' + name: 'CentOS countme totals DB timestamp is more than 7 days old' + priority: WARNING + dependencies: + - name: 'CentOS countme totals DB timestamp is more than 8 days old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/totals-centos.db,modify]) > 691200' + tags: + - tag: scope + value: file_age + - uuid: ec0ed1a4fc2f4e9fa214426cbb81459e + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/totals-centos.db,modify]) > 691200' + name: 'CentOS countme totals DB timestamp is more than 8 days old' + priority: HIGH + tags: + - tag: scope + value: file_age + - uuid: 7f066857c5df40378be6e82bb9d5df0f + name: 'Fedora countme totals DB timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/lib/countme/totals.db,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: 7e500bd165284a3aa73bd683b341711a + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/totals.db,modify]) > 604800' + name: 'Fedora countme totals DB timestamp is more than 7 days old' + priority: WARNING + dependencies: + - name: 'Fedora countme totals DB timestamp is more than 8 days old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/totals.db,modify]) > 691200' + tags: + - tag: scope + value: file_age + - uuid: c396067105874fe69ab37663cc8b643e + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/lib/countme/totals.db,modify]) > 691200' + name: 'Fedora countme totals DB timestamp is more than 8 days old' + priority: HIGH + tags: + - tag: scope + value: file_age + - uuid: 900bf5585bdf45618e5759ee24dfad9e + name: 'CentOS countme web totals DB (gzip) timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/www/html/csv-reports/countme/totals-centos-countme.db.gz,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: e8e05a96d13e470cb6e9284cd44c192f + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-centos-countme.db.gz,modify]) > 604800' + name: 'CentOS countme web totals DB (gzip) timestamp is more than 7 days old' + priority: WARNING + dependencies: + - name: 'CentOS countme web totals DB (gzip) timestamp is more than 8 days old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-centos-countme.db.gz,modify]) > 691200' + tags: + - tag: scope + value: file_age + - uuid: afe95177e98e4c3fb022aa07cbfedb3d + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-centos-countme.db.gz,modify]) > 691200' + name: 'CentOS countme web totals DB (gzip) timestamp is more than 8 days old' + priority: HIGH + tags: + - tag: scope + value: file_age + - uuid: d31e85b93bb14ba1907a24783919261e + name: 'CentOS countme web unique totals DB (gzip) timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/www/html/csv-reports/countme/totals-centos-unique.db.gz,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: 969db33400f24ef7a8739bc4cd481418 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-centos-unique.db.gz,modify]) > 604800' + name: 'CentOS countme web unique totals DB (gzip) timestamp is more than 7 days old' + priority: WARNING + dependencies: + - name: 'CentOS countme web unique totals DB (gzip) timestamp is more than 8 days old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-centos-unique.db.gz,modify]) > 691200' + tags: + - tag: scope + value: file_age + - uuid: f2f699582e4f4d0c9b6ce48aa4113cb0 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-centos-unique.db.gz,modify]) > 691200' + name: 'CentOS countme web unique totals DB (gzip) timestamp is more than 8 days old' + priority: HIGH + tags: + - tag: scope + value: file_age + - uuid: 6830cb82c2bf47e99d8f7472c41c63ed + name: 'CentOS countme web totals DB timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/www/html/csv-reports/countme/totals-centos.db,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: 9fff0bccd1c9471a8eb201b9224a0462 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-centos.db,modify]) > 86400' + name: 'CentOS countme web totals DB timestamp is more than 24 hours old' + priority: WARNING + dependencies: + - name: 'CentOS countme web totals DB timestamp is more than 48 hours old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-centos.db,modify]) > 172800' + tags: + - tag: scope + value: file_age + - uuid: 2dcfc8ceddd34aaabecd90ce8ac3aa51 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-centos.db,modify]) > 172800' + name: 'CentOS countme web totals DB timestamp is more than 48 hours old' + priority: HIGH + tags: + - tag: scope + value: file_age + - uuid: 489ac2f375ed4efcaba287f1f49647fa + name: 'Fedora countme web totals DB (gzip) timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/www/html/csv-reports/countme/totals-countme.db.gz,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: 91a373f54ac54a678c74eee83e2cd876 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-countme.db.gz,modify]) > 604800' + name: 'Fedora countme web totals DB (gzip) timestamp is more than 7 days old' + priority: WARNING + dependencies: + - name: 'Fedora countme web totals DB (gzip) timestamp is more than 8 days old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-countme.db.gz,modify]) > 691200' + tags: + - tag: scope + value: file_age + - uuid: 24e361f74ad248e2a2acba7b6327a1b4 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-countme.db.gz,modify]) > 691200' + name: 'Fedora countme web totals DB (gzip) timestamp is more than 8 days old' + priority: HIGH + tags: + - tag: scope + value: file_age + - uuid: c1f87919fe4a4c22a7f9e28d9ab24ef9 + name: 'Fedora countme web unique totals DB (gzip) timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/www/html/csv-reports/countme/totals-unique.db.gz,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: f887f1c0bd884b75b8825c87526df479 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-unique.db.gz,modify]) > 604800' + name: 'Fedora countme web unique totals DB (gzip) timestamp is more than 7 days old' + priority: WARNING + dependencies: + - name: 'Fedora countme web unique totals DB (gzip) timestamp is more than 8 days old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-unique.db.gz,modify]) > 691200' + tags: + - tag: scope + value: file_age + - uuid: 55df9f8ee62d4c9691bf4f9071df52cf + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals-unique.db.gz,modify]) > 691200' + name: 'Fedora countme web unique totals DB (gzip) timestamp is more than 8 days old' + priority: HIGH + tags: + - tag: scope + value: file_age + - uuid: 044a800e8fd6440a86810a44aa3f2b19 + name: 'Fedora countme web totals DB timestamp' + type: ZABBIX_ACTIVE + key: 'vfs.file.time[/var/www/html/csv-reports/countme/totals.db,modify]' + history: 1d + trends: '0' + units: unixtime + tags: + - tag: application + value: countme + triggers: + - uuid: 5c24063c245a40899aea54d62357864b + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals.db,modify]) > 86400' + name: 'Fedora countme web totals DB timestamp is more than 24 hours old' + priority: WARNING + dependencies: + - name: 'Fedora countme web totals DB timestamp is more than 48 hours old' + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals.db,modify]) > 172800' + tags: + - tag: scope + value: file_age + - uuid: e3970e1a01e1460b928eea98c4534ff3 + expression: 'now() - last(/Web-Data checks/vfs.file.time[/var/www/html/csv-reports/countme/totals.db,modify]) > 172800' + name: 'Fedora countme web totals DB timestamp is more than 48 hours old' + priority: HIGH + tags: + - tag: scope + value: file_age diff --git a/roles/web-data-analysis/tasks/main.yml b/roles/web-data-analysis/tasks/main.yml index 3b7f338bf6..f7135eaf9a 100644 --- a/roles/web-data-analysis/tasks/main.yml +++ b/roles/web-data-analysis/tasks/main.yml @@ -252,3 +252,30 @@ tags: - config - web-data + +# Zabbix monitoring of the CountMe datasets +- 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: + - web-data + - zabbix_api + block: + - name: Import web-data checks template + community.zabbix.zabbix_template: + template_yaml: "{{ lookup('file', 'zabbix-template.yml') }}" + state: present + run_once: true + + - name: Add self to web-data checks template in Zabbix + community.zabbix.zabbix_host: + host_name: "{{ inventory_hostname }}" + link_templates: Web-Data checks + force: false