Skip to content
Snippets Groups Projects
Commit 43b0f20a authored by Jörg Sachse's avatar Jörg Sachse
Browse files

fix: deploy Oracle monitoring plugins correctly, cleanup old locations

parent fb6d04a6
Branches
No related tags found
No related merge requests found
Pipeline #2761 passed
LOG_DIRECTORY_CLIENT = /var/log/check_mk/oracle_client
DIAG_ADR_ENABLED = OFF
SQLNET.WALLET_OVERRIDE = FALSE
WALLET_LOCATION =
(SOURCE=
(METHOD = FILE)
(METHOD_DATA = (DIRECTORY=/etc/check_mk/oracle_wallet))
)
--- ---
- name: delete legacy directory for self-developed Check_MK plugins (they were in the wrong location)
ansible.builtin.file:
path: "/usr/lib/check_mk_agent/nrpe"
state: absent
- name: create directory for self-developed Check_MK plugins
ansible.builtin.file:
path: "/usr/lib/check_mk_agent/local/3600/"
state: directory
mode: "0755"
- name: install self-developed Check_MK plugins for Oracle - name: install self-developed Check_MK plugins for Oracle
ansible.builtin.copy: ansible.builtin.copy:
src: "usr/lib/check_mk_agent/local/3600/{{ item }}" src: "usr/lib/check_mk_agent/local/3600/{{ item }}"
...@@ -9,8 +20,25 @@ ...@@ -9,8 +20,25 @@
loop: loop:
- "check_oracle_db_segment_size.sh" - "check_oracle_db_segment_size.sh"
- "check_oracle_db_table_integrity.sh" - "check_oracle_db_table_integrity.sh"
register: cmk_plugins
- name: find cache files for local Check_MK checks
ansible.builtin.find:
path: "/var/lib/check_mk_agent/cache"
pattern: "local_*.cache"
register: cachefiles
- name: >
delete cache files for local Check_MK checks, so when the new plugins run
for the first time, they produce fresh data
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
loop: "{{ cachefiles.files }}"
when: cmk_plugins.changed # noqa no-handler
# get vendor plugins straight from monitoring server to make sure we get the latest version # get vendor plugins straight from monitoring server to make sure we get the
# latest version
- name: install vendor Check_MK plugins for Oracle - name: install vendor Check_MK plugins for Oracle
ansible.builtin.get_url: ansible.builtin.get_url:
url: "https://cmk.slub-dresden.de/slubmon/check_mk/agents/plugins/{{ item }}" url: "https://cmk.slub-dresden.de/slubmon/check_mk/agents/plugins/{{ item }}"
...@@ -20,3 +48,18 @@ ...@@ -20,3 +48,18 @@
mode: "0755" mode: "0755"
loop: loop:
- "mk_oracle" - "mk_oracle"
- name: configure vendor Check_MK plugin for Oracle
ansible.builtin.lineinfile:
path: "/etc/check_mk/mk_oracle.cfg"
line: "DBUSER={{ vault_oracle_user_nagios.name }}:{{ vault_oracle_user_nagios.pass }}"
owner: "root"
group: "root"
mode: "0640"
create: true
- name: deploy sqlnet.ora
ansible.builtin.copy:
src: "etc/check_mk/sqlnet.ora"
dest: "/etc/check_mk/sqlnet.ora"
mode: "0644"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment