You've already forked role-check-mk-agent
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 829ca8310d | |||
| 9cd948dcdc | |||
| fbac11b098 |
@@ -1,2 +1,3 @@
|
|||||||
FROM docker.io/pycontribs/centos:7
|
FROM docker.io/pycontribs/centos:7
|
||||||
RUN yum install -y iproute
|
RUN yum install -y iproute firewalld python-firewall net-tools && \
|
||||||
|
systemctl enable firewalld
|
||||||
|
|||||||
6
Centos8-Dockerfile
Normal file
6
Centos8-Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Centos8-Dockerfile
|
||||||
|
FROM docker.io/pycontribs/centos:8
|
||||||
|
RUN yum install -y iproute firewalld net-tools && \
|
||||||
|
systemctl disable nftables && \
|
||||||
|
systemctl enable firewalld && \
|
||||||
|
|
||||||
@@ -1,12 +1,17 @@
|
|||||||
---
|
---
|
||||||
cmk_add_host: false # Should be true/false whether we should automatically add host for monitoring.
|
cmk_add_host: false # Should be true/false whether we should automatically add host for monitoring.
|
||||||
|
cmk_omd_protocol: http # Should be http or https
|
||||||
cmk_omd_host: your-checkmk-hostname
|
cmk_omd_host: your-checkmk-hostname
|
||||||
cmk_omd_site: your-checkmk-site # e.g the first piece after the / following your hostname
|
cmk_omd_site: your-checkmk-site # e.g the first piece after the / following your hostname
|
||||||
|
|
||||||
# If you have created a folder in WATO already you want hosts to be put in when registered
|
# If you have created a folder in WATO already you want hosts to be put in when registered
|
||||||
# uncomment cmk_folder below and specify the folder to use. Otherwise the role creates and
|
# uncomment cmk_folder below and specify the folder to use. Otherwise the role creates and
|
||||||
# adds new hosts by default to Unsorted folder
|
# adds new hosts by default to Unsorted folder
|
||||||
# cmk_folder: your_folder_in_WATO
|
# cmk_folder: your_folder_in_WATO
|
||||||
|
|
||||||
|
# Copy paste the link address for rpm agent from CheckMK
|
||||||
cmk_rpm_agent: http://url-from-your-agent-bakery-in-checkmk.rpm
|
cmk_rpm_agent: http://url-from-your-agent-bakery-in-checkmk.rpm
|
||||||
|
# Copy paste the link address for MSI (Windows) agent from CheckMK
|
||||||
cmk_msi_agent: http://url-from-your-agent-bakery-in-checkmk.msi
|
cmk_msi_agent: http://url-from-your-agent-bakery-in-checkmk.msi
|
||||||
|
|
||||||
|
|
||||||
@@ -17,6 +22,7 @@ cmk_username: some-username
|
|||||||
# I recommend encrypting this with ansible-vault.
|
# I recommend encrypting this with ansible-vault.
|
||||||
# Example: ansible-vault encrypt_string somesecret_string --name cmk_secret
|
# Example: ansible-vault encrypt_string somesecret_string --name cmk_secret
|
||||||
cmk_secret: some-secret
|
cmk_secret: some-secret
|
||||||
|
|
||||||
# Combined string required for unattended actions
|
# Combined string required for unattended actions
|
||||||
cmk_auth: "&_username={{ cmk_username }}&_secret={{ cmk_secret }}"
|
cmk_auth: "&_username={{ cmk_username }}&_secret={{ cmk_secret }}"
|
||||||
|
|
||||||
|
|||||||
@@ -8,4 +8,15 @@
|
|||||||
|
|
||||||
- name: cmk fresh install
|
- name: cmk fresh install
|
||||||
set_fact:
|
set_fact:
|
||||||
cmk_fresh_install: True
|
cmk_fresh_install: True
|
||||||
|
|
||||||
|
- name: ensure firewall open
|
||||||
|
firewalld:
|
||||||
|
port: 6556/tcp
|
||||||
|
state: enabled
|
||||||
|
permanent: yes
|
||||||
|
immediate: yes
|
||||||
|
|
||||||
|
- name: ensure firewall reloaded
|
||||||
|
command: firewall-cmd --reload
|
||||||
|
changed_when: false
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
notify:
|
notify:
|
||||||
- restart xinetd
|
- restart xinetd
|
||||||
- cmk fresh install
|
- cmk fresh install
|
||||||
|
- ensure firewall open
|
||||||
|
- ensure firewall reloaded
|
||||||
|
|
||||||
- name: Remove agent Download
|
- name: Remove agent Download
|
||||||
file:
|
file:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
- name: add host to omd
|
- name: add host to omd
|
||||||
uri:
|
uri:
|
||||||
method: POST
|
method: POST
|
||||||
url: "http://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=add_host{{ cmk_auth }}"
|
url: "{{ cmk_omd_protocol }}://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=add_host{{ cmk_auth }}"
|
||||||
body: |
|
body: |
|
||||||
request={
|
request={
|
||||||
"attributes": {
|
"attributes": {
|
||||||
@@ -25,14 +25,10 @@
|
|||||||
output: "{{ res.content | from_json }}"
|
output: "{{ res.content | from_json }}"
|
||||||
when: cmk_add_host
|
when: cmk_add_host
|
||||||
|
|
||||||
# - debug:
|
|
||||||
# msg: "{{ output }}"
|
|
||||||
# when: cmk_add_host
|
|
||||||
|
|
||||||
- name: cmk_discovery
|
- name: cmk_discovery
|
||||||
uri:
|
uri:
|
||||||
method: POST
|
method: POST
|
||||||
url: http://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=discover_services&mode=refresh{{ cmk_auth }}
|
url: "{{ cmk_omd_protocol }}://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=discover_services&mode=refresh{{ cmk_auth }}"
|
||||||
body: 'request={"hostname":"{{ inventory_hostname }}"}'
|
body: 'request={"hostname":"{{ inventory_hostname }}"}'
|
||||||
body_format: raw
|
body_format: raw
|
||||||
status_code: 200
|
status_code: 200
|
||||||
@@ -43,7 +39,7 @@
|
|||||||
- name: cmk_apply
|
- name: cmk_apply
|
||||||
uri:
|
uri:
|
||||||
method: POST
|
method: POST
|
||||||
url: http://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=activate_changes&mode=specific{{ cmk_auth }}
|
url: "{{ cmk_omd_protocol }}://{{ cmk_omd_host }}/{{ cmk_omd_site }}/check_mk/webapi.py?action=activate_changes&mode=specific{{ cmk_auth }}"
|
||||||
body: 'request={"sites":["{{ cmk_omd_site }}"]}'
|
body: 'request={"sites":["{{ cmk_omd_site }}"]}'
|
||||||
body_format: raw
|
body_format: raw
|
||||||
status_code: 200
|
status_code: 200
|
||||||
|
|||||||
Reference in New Issue
Block a user