Code Monkey home page Code Monkey logo

chef-articulate-monit's Introduction

chef-monit Build Status

Description

Installs the monit package from (http://mmonit.com/monit/).

Requirements

Supported Platforms

The following platforms are supported by this cookbook, meaning that the recipes run on these platforms without error:

  • Ubuntu
  • Debian
  • RedHat
  • CentOS
  • Scientific
  • Fedora
  • SUSE
  • Amazon

Recipes

  • monit - The default recipe. Sets up the service definition and default checks.

Resources

monit_monitrc

The following will create a monitrc configuration:

monit_monitrc "ssh" do
  variables({ category: "system" })
end

The name parameter must match a file located in your templates directory. In the example above, this would be ssh.monitrc.erb.

The variables option within the block is optional, and can contain a list of key-value pairs to assign within your template.

Usage

This cookbook installs the monit components if not present, and pulls updates if they are installed on the system.

Attributes

# Delay the start of polling when the service is started
default["monit"]["start_delay"] = 0

# How frequently the monit daemon polls for changes.
default["monit"]["polling_frequency"] = 20

# Use syslog for logging instead of a logfile.
default["monit"]["use_syslog"] = true

# If not using syslog, the log file that monit will use.
default["monit"]["logfile"] = "/var/log/monit.log"

# Where Monit stores unique Monit instance id
default["monit"]["idfile"] = "/var/.monit.id"

# Where Monit stores Monit state file
default["monit"]["statefile"] = "/var/lib/monit/state"

# Enable emails for internal monit alerts
default["monit"]["mail_alerts"] = true

# Ignore alerts for specific events
# Possible events include: action, checksum, connection, content, data, exec, fsflags, gid, icmp, instance, invalid, nonexist, permission, pid, ppid, resource, size, status, timeout, timestamp, uid, uptime.
default["monit"]["alert_ignore_events"] = []

# Email address that will be notified of events.
default["monit"]["alert_email"] = "root@localhost"

# Enable the web interface and define credentials.
default["monit"]["web_interface"] = {
  enable:  true,
  port:    2812,
  address: "localhost",
  allow:   ["localhost", "admin:b1gbr0th3r"]
}

# Email settings that will be used for notification of events.
default["monit"]["mail"] = {
  hostname: "localhost",
  port:     25,
  username: nil,
  password: nil,
  encrypted_credentials: nil,
  encrypted_credentials_data_bag: "credentials",
  from:     "monit@$HOST",
  subject:  "$SERVICE $EVENT at $DATE",
  message:  "Monit $ACTION $SERVICE at $DATE on $HOST,\n\n$DESCRIPTION\n\nDutifully,\nMonit",
  security: nil,  # 'SSLV2'|'SSLV3'|'TLSV1'
  timeout:  30
}

case node["platform_family"]
when "rhel", "fedora", "suse"
  default["monit"]["main_config_path"] = "/etc/monit.conf"
  default["monit"]["includes_dir"] = "/etc/monit.d"
else
  default["monit"]["main_config_path"] = "/etc/monit/monitrc"
  default["monit"]["includes_dir"] = "/etc/monit/conf.d"
end

# The monit::default recipe will load these monit_monitrc resources automatically
# NOTE setting this attribute at the default level will append values to the array
default["monit"]["default_monitrc_configs"] = %w[load ssh]

# Whether the monit service should be reloaded when a configuration changes
default["monit"]["reload_on_change"] = true

# `MONIT_OPTS` for /etc/default/monit
default["monit"]["init_opts"] = ""

# specify a particular version of the monit package you want installed,
# otherwise it will install the default. this value is ignored when performing a
# source install.
default["monit"]["version"] = nil

# source install specifics
default["monit"]["source_install"] = false

default["monit"]["source"]["version"] = "5.7"
default["monit"]["source"]["prefix"] = "/usr/local"
default["monit"]["source"]["url"] = "https://mmonit.com/monit/dist/monit-5.7.tar.gz"
default["monit"]["source"]["checksum"] = "bb250ab011d805b5693972afdf95509e79bb3b390caa763275c9501f74b598a2"
default["monit"]["source"]["pam_support"] = true
default["monit"]["source"]["ssl_support"] = true
default["monit"]["source"]["large_file_support"] = true
default["monit"]["source"]["compiler_optimized"] = true

Contributors

Many thanks go to the following contributors who have helped to make this cookbook even better:

  • @werdan
    • add support for redhat-flavored systems
  • @auser
    • add missing metadata
  • @arrowcircle
    • update syntax to be Ruby 1.8-compatible
  • @dwradcliffe
    • typo fix for README
    • fix logging logic
    • whyrun support for monitrc provider
    • support for reloading monit without restart
    • don't render 'use address' if no address is provided
    • fix attribute comments
  • @tjwallace
    • load default monitrc configs from an attribute
  • @tomdz
    • Ruby 1.8.x compatibility fix
    • add support for templates in different cookbooks
  • @alexism
    • support other security protocols
  • @fixlr
    • add mail_alerts attribute
  • @darron
    • add descriptions to email notifications
  • @claco
    • add startup delay option to monit daemon config
    • restart on default monitrc configs change
    • restart monit service if the monit config changes
    • fix platform family logic
  • @maciejgalkiewicz
    • fix logging logic
  • @pauloricardomg
    • add alert_ignore_events attribute
    • add reload_on_change attribute
  • @drywheat
    • support encrypted data bag for smtp credentials
    • add support for installation from source vs. package
  • @esigler
    • allow either style of monit startup flag to work
  • @evan2645
    • fix bug in which monit is not started during bootstrap
  • @mvdkleijn
    • add settings for idfile and statefile
  • @mbanton
    • fix statefile attribute in monitrc template
  • @foxycoder
    • add support for binary install
  • @ijin
    • add using_hostname attribute
    • better ssh support for Amazon Linux

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

chef-monit

Bitdeli Badge

chef-articulate-monit's People

Contributors

alexism avatar arrowcircle avatar auser avatar bitdeli-chef avatar claco avatar darron avatar donbecker avatar dwradcliffe avatar esigler avatar evan2645 avatar fixlr avatar ijin avatar mbanton avatar mgalkiewicz avatar mvdkleijn avatar pauloricardomg avatar phlipper avatar purrbiscuit avatar sonnysideup avatar tjwallace avatar tomdz avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.