jpartain89.configure_monit
jpartain89.Configure-Monit
I am no longer working on this repo. Apologies
Ansible role to configure Monit, not install it. This was forked off from pgolm's Monit Project
Requirements
You'll need to have monit already installed; either through your system's package manager or through Installing Monit from Source
Role Variables
monit_cycle: Time between checks in seconds. Defaults to120monit_log_destination: Where the log will be written. Can be a path to a file or "syslog", which will write to syslog daemon. Defaults to/var/log/monit.logmonit_state_file: State file path. Defaults to/var/lib/monit/statemonit_id_file: Id file path. Defaults to/var/lib/monit/idmonit_eventqueue_dir: Event queue directory path. It is only used when this variable is defined. Defaults to/var/lib/monit/events- The
monit_eventqueue_diris only necessary if you are going to be using M/Monit monit_eventqueue_slots: Event queue slots. It is only used whenmonit_eventqueue_diris defined. Defaults to1000monit_mmonit_address: The web address of your M/Monit instance to send the events tomonit_services: List of hashes of services to be monitorized by monitparent_monit_services: Same list, but as a master list, if your machines share any definitionsname: Name of the process or hosttype: Type of monitorization:processprocess_by_namefilefifohostfilesystemdirectoryprogramnetworknetwork_by_interfacesystem- This item will run a check on thetargetthat you specify, not thename
target: Target of monitorization. Should be a pidfile, processname, an address or undefined, depending on thetypeof servicestart: Command that starts the service. Optionalstop: Command that stop the service. Optionalrestart: Command that restarts the serviceuser: Linux username of the user starting the program. Optionalgroup: Linux group of the user starting the program. Optionalrules: List of rules to be included in this service. Optional
For those of you who are wondering about using depends lines in your config files, you can write the dependency with the title in the above rule line, but then you'll need to create a new rule dictionary entry that will consequently create another file. As long as the names match, monit will know.
monit_service_delete_unlisted: Remove existing service monitorization configurations not declared in theservices. Defaults totruemonit_mail_enabled: Enable mail alerts. Defaults tofalsemonit_mailserver_host: Mailserver host address. Defaults tolocalhostmonit_mailserver_port: Mailserver host port. Defaults to25monit_mailserver_user: Username for authentication on mailserver. Optionalmonit_mailserver_password: Password for authentication on mailserver Optionalmonit_mailserver_timeout: Timeout for mailserver connection. Defaults to5monit_mailserver_ssl_version: If defined, monit will use this algorithm for SSL connection to the mail server. Possible values areSSLAUTO,SSLV2,SSLV3,TLSV1,TLSV11,TLSV12monit_alert_addresses: List of mail addresses where the alerts will be sent tomonit_alert_mail_format: A hash of options for mail-formatfrom: Sender mail addressreply-to: A reply-to mail addresssubject: Mail subjectmessage: Mail message body
monit_webinterface_enabled: Enable monit web interface. Defaults totruemonit_webinterface_bind: IP address to bind web interface. Defaults to0.0.0.0(listen for external requests)monit_webinterface_port: Port for web interface. Defaults to2812monit_webinterface_acl_rules: List of ACL rules for the web interface, such aslocalhost,username:password,@groupname. It is only applied when defined and is empty by default. You should probably define at least one for the httpd service to start
Custom Facts
This role writes a monit_services_configured in /etc/ansible/facts.d/monit.fact in order to keep track of the configured monitors between different plays. This helps us removing unused monitors.
LICENSE
MIT
ansible-galaxy install jpartain89.configure_monit