forked from infra/ansible
Zabbix: migrate merged.log age check from Nagios
Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
This commit is contained in:
parent
fc72ee6a93
commit
8bb8c5e129
4 changed files with 65 additions and 11 deletions
38
roles/logging/files/zabbix-template.yml
Normal file
38
roles/logging/files/zabbix-template.yml
Normal file
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue