jkirk / ansible-role-checkmkagent

A simple role to deploy the Check_Mk Agent
0 stars 1 forks source link

checkmkagent

Lint Code Base

A simple role to deploy the checkmk agent with some custom local checks and agent plugins.

Requirements

N/A

Role Variables

See: defaults/main.yml

Local checks

Currently the following local checks are deployed default:

The local megacli checks are not deployed automatically:

To do so the following role variables need to be defined:

Agent plugins

Currently the following checkmk agent plugins are supported:

checkmkagent_plugins_available: [ 'mk_ceph', 'mk_logwatch.py', 'mk_mysql' ]

For general available agent plugins see the agent plugins folder of your checkmk monitoring server (i.e. https://monitoring.example.com/mysite/check_mk/agents/plugins/).

Dependencies

N/A

Example Playbook

    - hosts: site
      vars:
        checkmkagent_host_url: 'http://monitor01.example.com/mysite'
      roles:
         - { role: jkirk.checkmkagent }

    - hosts: ceph
      roles:
         - role: jkirk.checkmkagent
           checkmkagent_host_url: 'http://monitor01.example.com/mysite'
           checkmkagent_plugins: [ 'mk_ceph' ]

Update / Migration Notes

xinetd -> systemd migration

To migrate to systemd, checkmk 2.2+ needs to be installed.

To keep the xinetd integration for hosts which do not have checkmk 2.2+ and still have xinetd installed and configured checkmkagent_service_xinetd: true needs to be set.

Note, no xinetd configuration is deployed anymore, even if checkmkagent_service_xinetd: True is set.

mk_apt

mk_apt was installed in /usr/lib/check_mk_agent/plugins/60 instead of /usr/lib/check_mk_agent/plugins/3600. To delete the check on all hosts from the wrong location you could use ansible like this:

% ansible -i hosts all -m shell -a "ls -l /usr/lib/check_mk_agent/plugins/60/mk_apt"
% ansible -i hosts all -b -m shell -a "rm /usr/lib/check_mk_agent/plugins/60/mk_apt"
% ansible -i hosts all -b -m shell -a "rmdir /usr/lib/check_mk_agent/plugins/60"

Variable names

Older versions of this role used the variable checkmkagent_baseurl instead checkmkagent_host_url.

License

MIT

Author Information

Darshaka Pathirana - https://synpro.solutions