Skip to content

bodsch/ansible-monit

Repository files navigation

Ansible Role: monit

Installs and configure a monit on various linux systems.

GitHub Workflow Status GitHub issues GitHub release (latest by date) Ansible Downloads

Requirements & Dependencies

Ansible Collections

ansible-galaxy collection install bodsch.core

or

ansible-galaxy collection install --requirements-file collections.yml

tested operating systems

  • ArchLinux
  • Debian based
    • Debian 11 / 12
    • Ubuntu 20.04 / 22.04

RedHat-based systems are no longer officially supported! May work, but does not have to.

usage

monit_daemon:
  cycle: 120
  delay: 240

monit_log_destination: /var/log/monit.log
monit_lib_folder: /var/lib/monit
monit_state_file: "{{ monit_lib_folder }}/state"
monit_id_file: "{{ monit_lib_folder }}/id"

monit_services: []
monit_service_delete_unlisted: true

monit_eventqueue:
  enabled: false
  base_directory: /var/monit
  slots: 100

monit_mail:
  enabled: false
  server_host: localhost
  server_port: 25

monit_alert:
  alert_addresses: []
  mail_format: {}

monit_webinterface:
  enabled: false
  bind: 127.0.0.1
  port: 2812

Configurations examples

monit_services

monit_services:
  - type: 'process'
    name: sshd
    target: '/run/sshd.pid'
    start: '/etc/init.d/sshd start'
    stop: '/etc/init.d/sshd stop'
    restart: '/etc/init.d/sshd restart'
    rules:
      - if failed port 22 protocol ssh then restart

monit_webinterface

upstream documentation

curl -u foo:bar "localhost:2812/_status?format=json&level=full"

Contribution

Please read Contribution

Development, Branches (Git Tags)

The master Branch is my Working Horse includes the "latest, hot shit" and can be complete broken!

If you want to use something stable, please use a Tagged Version!


Author and License

  • Bodo Schulz

License

Apache

FREE SOFTWARE, HELL YEAH!