mirror of
https://github.com/CentOS/ansible-role-mbs
synced 2026-02-02 18:19:58 +08:00
Basic AMQP monitoring for fedmsg-hub/mbs
Signed-off-by: Fabian Arrotin <arrfab@centos.org>
This commit is contained in:
@@ -153,3 +153,10 @@ mbs_frontend_krb_keytab: localhost.keytab
|
||||
mbs_frontend_krb_host: 'localhost'
|
||||
mbs_frontend_ldap_uri: ''
|
||||
mbs_frontend_ldap_dn_groups: ''
|
||||
|
||||
|
||||
# Zabbix monitoring additional groups and templates specific to mbs
|
||||
# Worth knowing that because we import other roles, it has already some attached templates like http server, and also one for tls monitoring, so just adding mbs features in new template
|
||||
mbs_zabbix_templates:
|
||||
- Template CentOS MBS
|
||||
mbs_zabbix_groups: []
|
||||
|
||||
10
files/zabbix/zabbix-mbs-amqp-status.sh
Normal file
10
files/zabbix/zabbix-mbs-amqp-status.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# Called by Zabbix to check if we have error message in fedmsg-hub about ubm/amqp connection error
|
||||
|
||||
PATH=$PATH:/usr/local/bin:/sbin:/usr/sbin/
|
||||
|
||||
|
||||
journalctl --no-pager --since="1 hour ago" -u fedmsg-hub |grep -E 'twisted.internet.error.ConnectionLost|twisted.internet.error.ConnectionRefusedError|twisted.internet.error.TimeoutError'
|
||||
|
||||
zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k amqp.connection.status -o "$?" 2>&1 >/dev/null
|
||||
|
||||
@@ -25,3 +25,8 @@
|
||||
- pki
|
||||
- tls
|
||||
- certs
|
||||
|
||||
- include_tasks: monitoring.yml
|
||||
tags:
|
||||
- monitoring
|
||||
|
||||
|
||||
33
tasks/monitoring.yml
Normal file
33
tasks/monitoring.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
- block:
|
||||
- name: Configuring agent in Zabbix server
|
||||
include_role:
|
||||
name: zabbix-server
|
||||
tasks_from: agent_config
|
||||
vars:
|
||||
zabbix_templates: "{{ mbs_zabbix_templates }}"
|
||||
zabbix_groups: "{{ mbs_zabbix_groups }}"
|
||||
delegate_to: "{{ zabbix_api_srv }}"
|
||||
tags:
|
||||
- monitoring
|
||||
when: zabbix_api_srv is defined
|
||||
|
||||
- block:
|
||||
- name: Importing MBS zabbix scripts
|
||||
copy:
|
||||
src: "zabbix/{{ item }}"
|
||||
dest: "/usr/lib/zabbix/{{ item }}"
|
||||
owner: root
|
||||
mode: '0755'
|
||||
with_items:
|
||||
- zabbix-mbs-amqp-status.sh
|
||||
- name: Zabbix cron jobs for mbs
|
||||
cron:
|
||||
name: "MBS zabbix job {{ item }}"
|
||||
job: "/usr/lib/zabbix/{{ item }}"
|
||||
hour: '*'
|
||||
minute: '0'
|
||||
with_items:
|
||||
- zabbix-mbs-amqp-status.sh
|
||||
|
||||
tags:
|
||||
- monitoring
|
||||
Reference in New Issue
Block a user