snapshot
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
---
|
||||
checkmk_windows_user_cfg: "C:\\ProgramData\\checkmk\\agent\\check_mk.user.yml"
|
||||
checkmk_windows_updates_timeout: 3600
|
||||
checkmk_windows_updates_cache: 43200
|
||||
checkmk_mk_inventory_timeout: 120
|
||||
checkmk_plugins_default_timeout: 120
|
||||
checkmk_plugins_default_cache: 600
|
||||
checkmk_extra_plugin_patterns: []
|
||||
checkmk_extra_local_patterns: []
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
galaxy_info:
|
||||
role_name: checkmk_agent_config
|
||||
description: Render Windows Checkmk agent configuration from detected server roles
|
||||
min_ansible_version: "2.18"
|
||||
dependencies: []
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: "Debug detected role flags"
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.builtin.debug:
|
||||
msg:
|
||||
dc: "{{ is_dc | default(false) }}"
|
||||
dhcp: "{{ is_dhcp_server | default(false) }}"
|
||||
vbr: "{{ has_veeam_vbr | default(false) }}"
|
||||
vbo: "{{ has_veeam_vbo | default(false) }}"
|
||||
em: "{{ has_veeam_em | default(false) }}"
|
||||
hv: "{{ is_hyperv_host | default(false) }}"
|
||||
timeout_updates: "{{ checkmk_windows_updates_timeout }}"
|
||||
|
||||
- name: "Windows | Render check_mk.user.yml"
|
||||
when: ansible_facts['os_family'] == "Windows"
|
||||
ansible.windows.win_template:
|
||||
src: "windows_check_mk.user.yml.j2"
|
||||
dest: "{{ checkmk_windows_user_cfg }}"
|
||||
backup: true
|
||||
notify: "checkmk | windows | agent-ensure-running"
|
||||
@@ -0,0 +1,130 @@
|
||||
# Managed by Ansible (checkmk_agent_config)
|
||||
# Windows Checkmk Agent user configuration built from detected roles.
|
||||
|
||||
# $CUSTOM_PLUGINS_PATH$ -> ProgramData\checkmk\agent\plugins
|
||||
# $BUILTIN_PLUGINS_PATH$ -> Program Files (x86)\checkmk\service\plugins
|
||||
# $CUSTOM_AGENT_PATH$ -> ProgramData\checkmk\agent
|
||||
# $CUSTOM_LOCAL_PATH$ -> ProgramData\checkmk\agent\local
|
||||
|
||||
global:
|
||||
_only_from:
|
||||
_realtime:
|
||||
enabled: yes
|
||||
timeout: 90
|
||||
port: 6559
|
||||
encrypted: no
|
||||
passphrase: this is my password
|
||||
run:
|
||||
- mem
|
||||
- df
|
||||
- winperf_processor
|
||||
|
||||
winperf:
|
||||
counters:
|
||||
- MSExchangeTransport Queues: msx_queues
|
||||
|
||||
_logfiles:
|
||||
enabled: no
|
||||
|
||||
fileinfo:
|
||||
path: []
|
||||
|
||||
logwatch:
|
||||
logfile: []
|
||||
|
||||
plugins:
|
||||
execution:
|
||||
# --- Built-in defaults ---
|
||||
- pattern: '$BUILTIN_PLUGINS_PATH$\windows_updates.vbs'
|
||||
run: yes
|
||||
async: yes
|
||||
timeout: {{ checkmk_windows_updates_timeout }}
|
||||
cache_age: {{ checkmk_windows_updates_cache }}
|
||||
retry_count: 0
|
||||
|
||||
- pattern: '$BUILTIN_PLUGINS_PATH$\mk_inventory.vbs'
|
||||
run: yes
|
||||
async: yes
|
||||
timeout: {{ checkmk_mk_inventory_timeout }}
|
||||
cache_age: 3600
|
||||
|
||||
- pattern: '$BUILTIN_PLUGINS_PATH$\mssql.vbs'
|
||||
run: yes
|
||||
timeout: {{ checkmk_plugins_default_timeout }}
|
||||
|
||||
{% if has_veeam_vbr | default(false) %}
|
||||
# --- Veeam Backup & Replication ---
|
||||
- pattern: '$BUILTIN_PLUGINS_PATH$\veeam_backup_status.ps1'
|
||||
run: yes
|
||||
async: yes
|
||||
timeout: {{ checkmk_plugins_default_timeout }}
|
||||
cache_age: {{ checkmk_plugins_default_cache }}
|
||||
{% endif %}
|
||||
|
||||
{% if is_dc | default(false) %}
|
||||
# --- Domain Controller ---
|
||||
- pattern: '$BUILTIN_PLUGINS_PATH$\ad_replication.bat'
|
||||
run: yes
|
||||
timeout: {{ checkmk_plugins_default_timeout }}
|
||||
{% endif %}
|
||||
|
||||
{% if is_dhcp_server | default(false) %}
|
||||
# --- DHCP Server ---
|
||||
- pattern: '$BUILTIN_PLUGINS_PATH$\win_dhcp_pools.bat'
|
||||
run: yes
|
||||
timeout: {{ checkmk_plugins_default_timeout }}
|
||||
{% endif %}
|
||||
|
||||
# --- Generic patterns / precedence ---
|
||||
- pattern: '$CUSTOM_PLUGINS_PATH$\*.ps1'
|
||||
run: yes
|
||||
async: yes
|
||||
timeout: {{ checkmk_plugins_default_timeout }}
|
||||
cache_age: {{ checkmk_plugins_default_cache }}
|
||||
|
||||
- pattern: '$CUSTOM_PLUGINS_PATH$\*.*'
|
||||
run: yes
|
||||
timeout: {{ checkmk_plugins_default_timeout }}
|
||||
|
||||
- pattern: '$BUILTIN_PLUGINS_PATH$\*.*'
|
||||
run: no
|
||||
timeout: {{ checkmk_plugins_default_timeout }}
|
||||
|
||||
- pattern: '*'
|
||||
run: no
|
||||
|
||||
{% for p in (checkmk_extra_plugin_patterns | default([])) %}
|
||||
- pattern: '{{ p.pattern }}'
|
||||
{% if p.run is defined %}
|
||||
run: {{ p.run | bool }}
|
||||
{% endif %}
|
||||
{% if p.async is defined %}
|
||||
async: {{ p.async | bool }}
|
||||
{% endif %}
|
||||
{% if p.timeout is defined %}
|
||||
timeout: {{ p.timeout }}
|
||||
{% endif %}
|
||||
{% if p.cache_age is defined %}
|
||||
cache_age: {{ p.cache_age }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
local:
|
||||
_execution:
|
||||
- pattern: '*.*'
|
||||
run: yes
|
||||
{% for l in (checkmk_extra_local_patterns | default([])) %}
|
||||
- pattern: '{{ l.pattern }}'
|
||||
{% if l.run is defined %}
|
||||
run: {{ l.run | bool }}
|
||||
{% endif %}
|
||||
{% if l.async is defined %}
|
||||
async: {{ l.async | bool }}
|
||||
{% endif %}
|
||||
{% if l.timeout is defined %}
|
||||
timeout: {{ l.timeout }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
mrpe:
|
||||
config: []
|
||||
Reference in New Issue
Block a user