elnappo.check_mk_agent

Ansible Role for Check_MK Agent

Build Status Ansible Galaxy

This role installs the Check_MK agent. You can run it using systemd-socket, SSH with sudo, or as root (default). For more information about Check_MK, visit this link.

Features

  • Installs Check_MK agent
  • Queries the agent using systemd-socket (available from Check_MK agent version 1.4), SSH as root, or SSH with sudo
  • Sets up firewall rules if using systemd-socket (supports ufw or firewalld)
  • Adds the SSH host key to the Check_MK server
  • Installs extra plugins/local checks and their dependencies
  • Adds hosts to the Check_MK server via the WATO API

Requirements

  • Python requests version 2.5.0 or higher

Tested on Ubuntu 16.04, 18.04, and CentOS 7. It should also work on Debian and RedHat.

Installation

Run the following command to install the role:

$ ansible-galaxy install elnappo.check_mk_agent

Role Variables

  • check_mk_agent_over_ssh: true (Use SSH for agent communication)
  • check_mk_agent_over_xinetd: false (Do not use xinetd for agent communication)
  • check_mk_agent_with_sudo: false (Allows a user to run the Check_MK agent with sudo)
  • check_mk_agent_add_host_pubkey: false (Imports SSH host keys into the Check_MK server's known_hosts file)
  • check_mk_agent_monitoring_host: (Hostname of your Check_MK server)
  • check_mk_agent_monitoring_user: (Username for your Check_MK instance)
  • check_mk_agent_plugins_requirements: [] (Dependencies for additional plugins)
  • check_mk_agent_plugins: [] (List of additional plugins to install)
  • check_mk_agent_local_checks: {} (Local checks configuration)
  • check_mk_agent_pubkey_file: (Path to the SSH public key file)
  • check_mk_agent_add_to_wato: false (Do not add host to WATO)
  • check_mk_agent_monitoring_host_folder: "" (Folder for the monitoring host)
  • check_mk_agent_monitoring_host_discovery_mode: new (Set discovery mode)
  • check_mk_agent_monitoring_host_url: (URL of the monitoring host)
  • check_mk_agent_monitoring_host_wato_username: (WATO username)
  • check_mk_agent_monitoring_host_wato_secret: (WATO secret)
  • check_mk_agent_setup_firewall: true (Enables firewall rule setup when using systemd-socket or xinetd)
  • check_mk_agent_manual_install: false (User handles agent package installation)
  • check_mk_agent_package_name: check-mk-agent (Can point to your package location)

Included Extra Plugins

These can be found under files/plugins/. They may be removed in a future version due to difficulty in keeping them updated.

Dependencies

None.

Example Playbook

Here is an example of how to use this role in a playbook:

- hosts: servers
  vars:
    check_mk_agent_pubkey_file: omd_rsa.pub
    check_mk_agent_add_host_pubkey: true
    check_mk_agent_monitoring_host: checkmk.example.com
    check_mk_agent_monitoring_user: monitoring
    check_mk_agent_add_to_wato: true
    check_mk_agent_monitoring_host_url: http://cmk.example.com/monitoring/
    check_mk_agent_monitoring_host_wato_username: ansible
    check_mk_agent_monitoring_host_wato_secret: 7JTuBt6nETYHG1GS
    check_mk_agent_local_checks:
      filecount:
        src: files/check_mk_local_checks/filecount
        cache_time: 600
      filestat:
        src: files/check_mk_local_checks/filestat

  roles:
     - elnappo.check_mk_agent

License

MIT

Author Information

elnappo elnappo@nerdpol.io

Informazioni sul progetto

Install check_mk agent

Installa
ansible-galaxy install elnappo.check_mk_agent
Licenza
mit
Download
1.1k
Proprietario