Skip to content

Commit

Permalink
Increase version to 2.2.0p20
Browse files Browse the repository at this point in the history
  • Loading branch information
kso512 committed Jan 24, 2024
1 parent d410408 commit 6ec44a1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 19 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ The following distributions have been tested automatically:
- [Debian 12 "Bookworm"](https://www.debian.org/releases/bookworm/)
- [Fedora 37](https://docs.fedoraproject.org/en-US/fedora/f37/release-notes/)
- [Fedora 38](https://docs.fedoraproject.org/en-US/fedora/f38/release-notes/)
- [Fedora 39](https://docs.fedoraproject.org/en-US/fedora/f39/release-notes/)
- [Microsoft Windows Server 2019](https://docs.microsoft.com/en-us/windows-server/get-started/whats-new-in-windows-server-2019) / [Microsoft Windows 10](https://www.microsoft.com/en-us/windows/windows-10-specifications)
- [Ubuntu 20.04 LTS "Focal Fossa"](http://releases.ubuntu.com/focal/)
- [Ubuntu 22.04 LTS "Jammy Jellyfish"](http://releases.ubuntu.com/jammy/)

For performance reasons, the following "sections" have been disabled in the Windows agent:
For performance reasons, the following "sections" have been disabled by default in the Windows agent:

- services
- msexch
Expand All @@ -49,11 +50,11 @@ Create your own "check_mk.user.yml.j2" and override `checkmk_agent_win_config_sr

| CheckMK Raw Edition Version | Role Version/Tag |
| --------------------------- | ---------------- |
| 2.2.0p20 | 1.0.82 |
| 2.2.0p19 | 1.0.81 |
| 2.2.0p18 | 1.0.80 |
| 2.2.0p17 | 1.0.79 |
| 2.2.0p16 | 1.0.78 |
| 2.2.0p15 | 1.0.77 |

## Requirements

Expand Down Expand Up @@ -158,7 +159,7 @@ Some of these may be seem redundant but are specified so future users can overri
| checkmk_agent_sudo_src | Filename of the "sudoers.d" file template | `"99_cmkagent.j2"` |
| checkmk_agent_sudo_validate | Command used to validate the "sudoers.d" file; %s will be filled in with `checkmk_agent_sudo_dest` | `'visudo -cf %s'` |
| checkmk_agent_user | Login name of the CheckMK Agent user | `"cmkagent"` |
| checkmk_agent_version | Version of CheckMK Agent to install | `"2.2.0p19"` |
| checkmk_agent_version | Version of CheckMK Agent to install | `"2.2.0p20"` |
| checkmk_agent_win_config_dest | Full pathname of configuration file | `"{{ checkmk_agent_win_data_folder }}check_mk.user.yml"` |
| checkmk_agent_win_config_src | Filename of the configuration file template | `"check_mk.user.yml.j2"` |
| checkmk_agent_win_data_folder | Full pathname of the CheckMK Agent data folder | `"C:\\ProgramData\\checkmk\\agent\\"` |
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ checkmk_agent_sudo_owner: "root"
checkmk_agent_sudo_src: "99_cmkagent.j2"
checkmk_agent_sudo_validate: 'visudo -cf %s'
checkmk_agent_user: "cmkagent"
checkmk_agent_version: "2.2.0p19"
checkmk_agent_version: "2.2.0p20"
checkmk_agent_win_config_dest: "{{ checkmk_agent_win_data_folder }}check_mk.user.yml"
checkmk_agent_win_config_src: "check_mk.user.yml.j2"
checkmk_agent_win_data_folder: "C:\\ProgramData\\checkmk\\agent\\"
Expand Down
Binary file modified files/check_mk_agent.msi
Binary file not shown.
4 changes: 3 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ galaxy_info:
platforms:
- name: Debian
versions:
- bookworm
- bullseye
- buster
- name: EL
Expand All @@ -20,15 +21,16 @@ galaxy_info:
versions:
- "37"
- "38"
- "39"
- name: Ubuntu
versions:
- bionic
- focal
- jammy
- name: Windows
versions:
- "2019"
galaxy_tags:
- check_mk
- checkmk
- raw
- cre
Expand Down
35 changes: 21 additions & 14 deletions templates/mk_docker.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ class Section(list):
if piggytarget is not None:
self.append("<<<<%s>>>>" % piggytarget)
if name is not None:
self.append("<<<docker_%s:sep(124)>>>" % name)
self.append("<<<%s:sep(124)>>>" % name)
version_json = json.dumps(Section.version_info)
self.append("@docker_version_info|%s" % version_json)
self.append("<<<docker_%s:sep(0)>>>" % name)
self.append("<<<%s:sep(0)>>>" % name)

def write(self):
if self[0].startswith("<<<<"):
Expand All @@ -184,7 +184,7 @@ class Section(list):
def report_exception_to_server(exc, location):
LOGGER.info("handling exception: %s", exc)
msg = "Plugin exception in %s: %s" % (location, exc)
sec = Section("node_info")
sec = Section("docker_node_info")
sec.append(json.dumps({"Unknown": msg}))
sec.write()

Expand Down Expand Up @@ -411,15 +411,15 @@ def is_disabled_section(config, section_name):
@time_it
def section_node_info(client):
LOGGER.debug(client.node_info)
section = Section("node_info")
section = Section("docker_node_info")
section.append(json.dumps(client.node_info))
section.write()


@time_it
def section_node_disk_usage(client):
"""docker system df"""
section = Section("node_disk_usage")
section = Section("docker_node_disk_usage")
try:
data = client.df()
except docker.errors.APIError as exc:
Expand Down Expand Up @@ -497,7 +497,7 @@ def _robust_inspect(client, docker_object):
@time_it
def section_node_images(client):
"""in subsections list [[[images]]] and [[[containers]]]"""
section = Section("node_images")
section = Section("docker_node_images")

images = _robust_inspect(client, "images")
LOGGER.debug(images)
Expand All @@ -516,14 +516,14 @@ def section_node_images(client):
@time_it
def section_node_network(client):
networks = client.networks.list(filters={"driver": "bridge"})
section = Section("node_network")
section = Section("docker_node_network")
section += [json.dumps(n.attrs) for n in networks]
section.write()


def section_container_node_name(client, container_id):
node_name = client.node_info.get("Name")
section = Section("container_node_name", piggytarget=container_id)
section = Section("docker_container_node_name", piggytarget=container_id)
section.append(json.dumps({"NodeName": node_name}))
section.write()

Expand All @@ -546,22 +546,22 @@ def section_container_status(client, container_id):
pass
status["NodeName"] = client.node_info.get("Name")

section = Section("container_status", piggytarget=container_id)
section = Section("docker_container_status", piggytarget=container_id)
section.append(json.dumps(status))
section.write()


def section_container_labels(client, container_id):
container = client.all_containers[container_id]
section = Section("container_labels", piggytarget=container_id)
section = Section("docker_container_labels", piggytarget=container_id)
section.append(json.dumps(container.labels))
section.write()


def section_container_network(client, container_id):
container = client.all_containers[container_id]
network = container.attrs.get("NetworkSettings", {})
section = Section("container_network", piggytarget=container_id)
section = Section("docker_container_network", piggytarget=container_id)
section.append(json.dumps(network))
section.write()

Expand Down Expand Up @@ -604,7 +604,7 @@ def section_container_mem(client, container_id):
if stats is None: # container not running
return
container_mem = stats["memory_stats"]
section = Section("container_mem", piggytarget=container_id)
section = Section("docker_container_mem", piggytarget=container_id)
section.append(json.dumps(container_mem))
section.write()

Expand All @@ -614,7 +614,7 @@ def section_container_cpu(client, container_id):
if stats is None: # container not running
return
container_cpu = stats["cpu_stats"]
section = Section("container_cpu", piggytarget=container_id)
section = Section("docker_container_cpu", piggytarget=container_id)
section.append(json.dumps(container_cpu))
section.write()

Expand All @@ -626,7 +626,7 @@ def section_container_diskstat(client, container_id):
container_blkio = stats["blkio_stats"]
container_blkio["time"] = time.time()
container_blkio["names"] = client.device_map()
section = Section("container_diskstat", piggytarget=container_id)
section = Section("docker_container_diskstat", piggytarget=container_id)
section.append(json.dumps(container_blkio))
section.write()

Expand Down Expand Up @@ -661,9 +661,16 @@ def call_node_sections(client, config):
except Exception as exc:
if DEBUG:
raise
# The section is already always written. Prevent duplicate @docker_version_info
if name != "docker_node_info":
write_empty_section(name)
report_exception_to_server(exc, section.__name__)


def write_empty_section(name, piggytarget=None):
Section(name, piggytarget).write()


def call_container_sections(client, config):
jobs = []
for container_id in client.all_containers:
Expand Down

0 comments on commit 6ec44a1

Please sign in to comment.