Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Create gh-pages branch via GitHub

  • Loading branch information...
commit cb96366a0c486b2282d0b257aaa791446669681b 1 parent fea71b8
Phil Cohen authored

Showing 2 changed files with 116 additions and 21 deletions. Show diff stats Hide diff stats

  1. +115 20 index.html
  2. +1 1  params.json
135 index.html
@@ -90,50 +90,85 @@
90 90 <span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"polling_frequency"</span><span class="o">]</span> <span class="o">=</span> <span class="mi">20</span>
91 91
92 92 <span class="c1"># Use syslog for logging instead of a logfile.</span>
93   -<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"use_syslog"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">true</span>
  93 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"use_syslog"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">true</span>
94 94
95 95 <span class="c1"># If not using syslog, the log file that monit will use.</span>
96   -<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"logfile"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/var/log/monit.log"</span>
  96 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"logfile"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/var/log/monit.log"</span>
  97 +
  98 +<span class="c1"># Where Monit stores unique Monit instance id</span>
  99 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"idfile"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/var/.monit.id"</span>
  100 +
  101 +<span class="c1"># Where Monit stores Monit state file</span>
  102 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"statefile"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/var/lib/monit/state"</span>
97 103
98 104 <span class="c1"># Enable emails for internal monit alerts</span>
99   -<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"mail_alerts"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">true</span>
  105 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"mail_alerts"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">true</span>
  106 +
  107 +<span class="c1"># Ignore alerts for specific events</span>
  108 +<span class="c1"># 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.</span>
  109 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"alert_ignore_events"</span><span class="o">]</span> <span class="o">=</span> <span class="o">[]</span>
100 110
101 111 <span class="c1"># Email address that will be notified of events.</span>
102   -<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"alert_email"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"root@localhost"</span>
  112 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"alert_email"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"root@localhost"</span>
103 113
104 114 <span class="c1"># Enable the web interface and define credentials.</span>
105 115 <span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"web_interface"</span><span class="o">]</span> <span class="o">=</span> <span class="p">{</span>
106   - <span class="ss">:enable</span> <span class="o">=&gt;</span> <span class="kp">true</span><span class="p">,</span>
107   - <span class="ss">:port</span> <span class="o">=&gt;</span> <span class="mi">2812</span><span class="p">,</span>
108   - <span class="ss">:address</span> <span class="o">=&gt;</span> <span class="s2">"localhost"</span><span class="p">,</span>
109   - <span class="ss">:allow</span> <span class="o">=&gt;</span> <span class="o">[</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="s2">"admin:b1gbr0th3r"</span><span class="o">]</span>
  116 + <span class="ss">enable</span><span class="p">:</span> <span class="kp">true</span><span class="p">,</span>
  117 + <span class="ss">port</span><span class="p">:</span> <span class="mi">2812</span><span class="p">,</span>
  118 + <span class="ss">address</span><span class="p">:</span> <span class="s2">"localhost"</span><span class="p">,</span>
  119 + <span class="ss">allow</span><span class="p">:</span> <span class="o">[</span><span class="s2">"localhost"</span><span class="p">,</span> <span class="s2">"admin:b1gbr0th3r"</span><span class="o">]</span>
110 120 <span class="p">}</span>
111 121
112 122 <span class="c1"># Email settings that will be used for notification of events.</span>
113 123 <span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"mail"</span><span class="o">]</span> <span class="o">=</span> <span class="p">{</span>
114   - <span class="ss">:hostname</span> <span class="o">=&gt;</span> <span class="s2">"localhost"</span><span class="p">,</span>
115   - <span class="ss">:port</span> <span class="o">=&gt;</span> <span class="mi">25</span><span class="p">,</span>
116   - <span class="ss">:username</span> <span class="o">=&gt;</span> <span class="kp">nil</span><span class="p">,</span>
117   - <span class="ss">:password</span> <span class="o">=&gt;</span> <span class="kp">nil</span><span class="p">,</span>
118   - <span class="ss">:from</span> <span class="o">=&gt;</span> <span class="s2">"monit@$HOST"</span><span class="p">,</span>
119   - <span class="ss">:subject</span> <span class="o">=&gt;</span> <span class="s2">"$SERVICE $EVENT at $DATE"</span><span class="p">,</span>
120   - <span class="ss">:message</span> <span class="o">=&gt;</span> <span class="s2">"Monit $ACTION $SERVICE at $DATE on $HOST,</span><span class="se">\n\n</span><span class="s2">$DESCRIPTION</span><span class="se">\n\n</span><span class="s2">Dutifully,</span><span class="se">\n</span><span class="s2">Monit"</span><span class="p">,</span>
121   - <span class="ss">:security</span> <span class="o">=&gt;</span> <span class="kp">nil</span><span class="p">,</span> <span class="c1"># 'SSLV2'|'SSLV3'|'TLSV1'</span>
122   - <span class="ss">:timeout</span> <span class="o">=&gt;</span> <span class="mi">30</span>
  124 + <span class="ss">hostname</span><span class="p">:</span> <span class="s2">"localhost"</span><span class="p">,</span>
  125 + <span class="ss">port</span><span class="p">:</span> <span class="mi">25</span><span class="p">,</span>
  126 + <span class="ss">username</span><span class="p">:</span> <span class="kp">nil</span><span class="p">,</span>
  127 + <span class="ss">password</span><span class="p">:</span> <span class="kp">nil</span><span class="p">,</span>
  128 + <span class="ss">encrypted_credentials</span><span class="p">:</span> <span class="kp">nil</span><span class="p">,</span>
  129 + <span class="ss">encrypted_credentials_data_bag</span><span class="p">:</span> <span class="s2">"credentials"</span><span class="p">,</span>
  130 + <span class="ss">from</span><span class="p">:</span> <span class="s2">"monit@$HOST"</span><span class="p">,</span>
  131 + <span class="ss">subject</span><span class="p">:</span> <span class="s2">"$SERVICE $EVENT at $DATE"</span><span class="p">,</span>
  132 + <span class="ss">message</span><span class="p">:</span> <span class="s2">"Monit $ACTION $SERVICE at $DATE on $HOST,</span><span class="se">\n\n</span><span class="s2">$DESCRIPTION</span><span class="se">\n\n</span><span class="s2">Dutifully,</span><span class="se">\n</span><span class="s2">Monit"</span><span class="p">,</span>
  133 + <span class="ss">security</span><span class="p">:</span> <span class="kp">nil</span><span class="p">,</span> <span class="c1"># 'SSLV2'|'SSLV3'|'TLSV1'</span>
  134 + <span class="ss">timeout</span><span class="p">:</span> <span class="mi">30</span>
123 135 <span class="p">}</span>
124 136
125 137 <span class="k">case</span> <span class="n">node</span><span class="o">[</span><span class="s2">"platform_family"</span><span class="o">]</span>
126 138 <span class="k">when</span> <span class="s2">"rhel"</span><span class="p">,</span> <span class="s2">"fedora"</span><span class="p">,</span> <span class="s2">"suse"</span>
127 139 <span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"main_config_path"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/etc/monit.conf"</span>
128   - <span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"includes_dir"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/etc/monit.d"</span>
  140 + <span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"includes_dir"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/etc/monit.d"</span>
129 141 <span class="k">else</span>
130 142 <span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"main_config_path"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/etc/monit/monitrc"</span>
131   - <span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"includes_dir"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/etc/monit/conf.d"</span>
  143 + <span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"includes_dir"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/etc/monit/conf.d"</span>
132 144 <span class="k">end</span>
133 145
134 146 <span class="c1"># The monit::default recipe will load these monit_monitrc resources automatically</span>
135 147 <span class="c1"># NOTE setting this attribute at the default level will append values to the array</span>
136   -<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"default_monitrc_configs"</span><span class="o">]</span> <span class="o">=</span> <span class="o">[</span><span class="s2">"load"</span><span class="p">,</span> <span class="s2">"ssh"</span><span class="o">]</span>
  148 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"default_monitrc_configs"</span><span class="o">]</span> <span class="o">=</span> <span class="sx">%w[load ssh]</span>
  149 +
  150 +<span class="c1"># Whether the monit service should be reloaded when a configuration changes</span>
  151 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"reload_on_change"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">true</span>
  152 +
  153 +<span class="c1"># `MONIT_OPTS` for /etc/default/monit</span>
  154 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"init_opts"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">""</span>
  155 +
  156 +<span class="c1"># specify a particular version of the monit package you want installed,</span>
  157 +<span class="c1"># otherwise it will install the default. this value is ignored when performing a</span>
  158 +<span class="c1"># source install.</span>
  159 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"version"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">nil</span>
  160 +
  161 +<span class="c1"># source install specifics</span>
  162 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"source_install"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">false</span>
  163 +
  164 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"source"</span><span class="o">][</span><span class="s2">"version"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"5.7"</span>
  165 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"source"</span><span class="o">][</span><span class="s2">"prefix"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"/usr/local"</span>
  166 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"source"</span><span class="o">][</span><span class="s2">"url"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"https://mmonit.com/monit/dist/monit-5.7.tar.gz"</span>
  167 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"source"</span><span class="o">][</span><span class="s2">"checksum"</span><span class="o">]</span> <span class="o">=</span> <span class="s2">"bb250ab011d805b5693972afdf95509e79bb3b390caa763275c9501f74b598a2"</span>
  168 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"source"</span><span class="o">][</span><span class="s2">"pam_support"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">true</span>
  169 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"source"</span><span class="o">][</span><span class="s2">"ssl_support"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">true</span>
  170 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"source"</span><span class="o">][</span><span class="s2">"large_file_support"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">true</span>
  171 +<span class="n">default</span><span class="o">[</span><span class="s2">"monit"</span><span class="o">][</span><span class="s2">"source"</span><span class="o">][</span><span class="s2">"compiler_optimized"</span><span class="o">]</span> <span class="o">=</span> <span class="kp">true</span>
137 172 </pre></div>
138 173
139 174 <h2>
@@ -172,6 +207,7 @@
172 207 <li>whyrun support for monitrc provider</li>
173 208 <li>support for reloading monit without restart</li>
174 209 <li>don't render 'use address' if no address is provided</li>
  210 +<li>fix attribute comments</li>
175 211 </ul>
176 212 </li>
177 213 <li>
@@ -227,6 +263,65 @@
227 263 <li>fix logging logic</li>
228 264 </ul>
229 265 </li>
  266 +<li>
  267 +<strong><a href="https://github.com/pauloricardomg">@pauloricardomg</a></strong>
  268 +
  269 +<ul>
  270 +<li>add <code>alert_ignore_events</code> attribute</li>
  271 +<li>add <code>reload_on_change</code> attribute</li>
  272 +</ul>
  273 +</li>
  274 +<li>
  275 +<strong><a href="https://github.com/drywheat">@drywheat</a></strong>
  276 +
  277 +<ul>
  278 +<li>support encrypted data bag for smtp credentials</li>
  279 +<li>add support for installation from source vs. package</li>
  280 +</ul>
  281 +</li>
  282 +<li>
  283 +<strong><a href="https://github.com/esigler">@esigler</a></strong>
  284 +
  285 +<ul>
  286 +<li>allow either style of monit startup flag to work</li>
  287 +</ul>
  288 +</li>
  289 +<li>
  290 +<strong><a href="https://github.com/evan2645">@evan2645</a></strong>
  291 +
  292 +<ul>
  293 +<li>fix bug in which monit is not started during bootstrap</li>
  294 +</ul>
  295 +</li>
  296 +<li>
  297 +<strong><a href="https://github.com/mvdkleijn">@mvdkleijn</a></strong>
  298 +
  299 +<ul>
  300 +<li>add settings for idfile and statefile</li>
  301 +</ul>
  302 +</li>
  303 +<li>
  304 +<strong><a href="https://github.com/mbanton">@mbanton</a></strong>
  305 +
  306 +<ul>
  307 +<li>fix <code>statefile</code> attribute in <code>monitrc</code> template</li>
  308 +</ul>
  309 +</li>
  310 +<li>
  311 +<strong><a href="https://github.com/foxycoder">@foxycoder</a></strong>
  312 +
  313 +<ul>
  314 +<li>add support for binary install</li>
  315 +</ul>
  316 +</li>
  317 +<li>
  318 +<strong><a href="https://github.com/ijin">@ijin</a></strong>
  319 +
  320 +<ul>
  321 +<li>add <code>using_hostname</code> attribute</li>
  322 +<li>better ssh support for Amazon Linux</li>
  323 +</ul>
  324 +</li>
230 325 </ul><h2>
231 326 <a name="contributing" class="anchor" href="#contributing"><span class="octicon octicon-link"></span></a>Contributing</h2>
232 327
2  params.json
... ... @@ -1 +1 @@
1   -{"name":"chef-monit","tagline":"Chef cookbook for monit package","body":"[![Build Status](http://img.shields.io/travis-ci/phlipper/chef-monit.png)](http://travis-ci.org/phlipper/chef-monit)\r\n\r\n## Description\r\n\r\nInstalls the `monit` package from (http://mmonit.com/monit/).\r\n\r\n\r\n## Requirements\r\n\r\n### Supported Platforms\r\n\r\nThe following platforms are supported by this cookbook, meaning that the recipes run on these platforms without error:\r\n\r\n* Ubuntu\r\n* Debian\r\n* RedHat\r\n* CentOS\r\n* Scientific\r\n* Fedora\r\n* SUSE\r\n* Amazon\r\n\r\n\r\n## Recipes\r\n\r\n* `monit` - The default recipe. Sets up the service definition and default checks.\r\n\r\n\r\n## Resources\r\n\r\n### `monit_monitrc`\r\n\r\nThe following will create a monitrc configuration:\r\n\r\n```ruby\r\nmonit_monitrc \"ssh\" do\r\n variables({ category: \"system\" })\r\nend\r\n```\r\n\r\nThe `name` parameter must match a file located in your templates directory. In the example above, this would be `ssh.monitrc.erb`.\r\n\r\nThe `variables` option within the block is optional, and can contain a list of key-value pairs to assign within your template.\r\n\r\n\r\n## Usage\r\n\r\nThis cookbook installs the monit components if not present, and pulls updates if they are installed on the system.\r\n\r\n\r\n## Attributes\r\n\r\n```ruby\r\n# Delay the start of polling when the service is started\r\ndefault[\"monit\"][\"start_delay\"] = 0\r\n\r\n# How frequently the monit daemon polls for changes.\r\ndefault[\"monit\"][\"polling_frequency\"] = 20\r\n\r\n# Use syslog for logging instead of a logfile.\r\ndefault[\"monit\"][\"use_syslog\"] = true\r\n\r\n# If not using syslog, the log file that monit will use.\r\ndefault[\"monit\"][\"logfile\"] = \"/var/log/monit.log\"\r\n\r\n# Enable emails for internal monit alerts\r\ndefault[\"monit\"][\"mail_alerts\"] = true\r\n\r\n# Email address that will be notified of events.\r\ndefault[\"monit\"][\"alert_email\"] = \"root@localhost\"\r\n\r\n# Enable the web interface and define credentials.\r\ndefault[\"monit\"][\"web_interface\"] = {\r\n :enable => true,\r\n :port => 2812,\r\n :address => \"localhost\",\r\n :allow => [\"localhost\", \"admin:b1gbr0th3r\"]\r\n}\r\n\r\n# Email settings that will be used for notification of events.\r\ndefault[\"monit\"][\"mail\"] = {\r\n :hostname => \"localhost\",\r\n :port => 25,\r\n :username => nil,\r\n :password => nil,\r\n :from => \"monit@$HOST\",\r\n :subject => \"$SERVICE $EVENT at $DATE\",\r\n :message => \"Monit $ACTION $SERVICE at $DATE on $HOST,\\n\\n$DESCRIPTION\\n\\nDutifully,\\nMonit\",\r\n :security => nil, # 'SSLV2'|'SSLV3'|'TLSV1'\r\n :timeout => 30\r\n}\r\n\r\ncase node[\"platform_family\"]\r\nwhen \"rhel\", \"fedora\", \"suse\"\r\n default[\"monit\"][\"main_config_path\"] = \"/etc/monit.conf\"\r\n default[\"monit\"][\"includes_dir\"] = \"/etc/monit.d\"\r\nelse\r\n default[\"monit\"][\"main_config_path\"] = \"/etc/monit/monitrc\"\r\n default[\"monit\"][\"includes_dir\"] = \"/etc/monit/conf.d\"\r\nend\r\n\r\n# The monit::default recipe will load these monit_monitrc resources automatically\r\n# NOTE setting this attribute at the default level will append values to the array\r\ndefault[\"monit\"][\"default_monitrc_configs\"] = [\"load\", \"ssh\"]\r\n```\r\n\r\n\r\n## Contributors\r\n\r\nMany thanks go to the following [contributors](https://github.com/phlipper/chef-monit/graphs/contributors) who have helped to make this cookbook even better:\r\n\r\n* **[@werdan](https://github.com/werdan)**\r\n * add support for redhat-flavored systems\r\n* **[@auser](https://github.com/auser)**\r\n * add missing metadata\r\n* **[@arrowcircle](https://github.com/arrowcircle)**\r\n * update syntax to be Ruby 1.8-compatible\r\n* **[@dwradcliffe](https://github.com/dwradcliffe)**\r\n * typo fix for README\r\n * fix logging logic\r\n * whyrun support for monitrc provider\r\n * support for reloading monit without restart\r\n * don't render 'use address' if no address is provided\r\n* **[@tjwallace](https://github.com/tjwallace)**\r\n * load default monitrc configs from an attribute\r\n* **[@tomdz](https://github.com/tomdz)**\r\n * Ruby 1.8.x compatibility fix\r\n * add support for templates in different cookbooks\r\n* **[@alexism](https://github.com/alexism)**\r\n * support other security protocols\r\n* **[@fixlr](https://github.com/fixlr)**\r\n * add `mail_alerts` attribute\r\n* **[@darron](https://github.com/darron)**\r\n * add descriptions to email notifications\r\n* **[@claco](https://github.com/claco)**\r\n * add startup delay option to monit daemon config\r\n * restart on default monitrc configs change\r\n * restart monit service if the monit config changes\r\n * fix platform family logic\r\n* **[@maciejgalkiewicz](https://github.com/maciejgalkiewicz)**\r\n * fix logging logic\r\n\r\n\r\n## Contributing\r\n\r\n1. Fork it\r\n2. Create your feature branch (`git checkout -b my-new-feature`)\r\n3. Commit your changes (`git commit -am 'Added some feature'`)\r\n4. Push to the branch (`git push origin my-new-feature`)\r\n5. Create new Pull Request\r\n\r\n\r\n## License\r\n\r\n**chef-monit**\r\n\r\n* Freely distributable and licensed under the [MIT license](http://phlipper.mit-license.org/2011-2014/license.html).\r\n* Copyright (c) 2011-2014 Phil Cohen (github@phlippers.net) [![endorse](http://api.coderwall.com/phlipper/endorsecount.png)](http://coderwall.com/phlipper) [![Gittip](http://img.shields.io/gittip/phlipper.png)](https://www.gittip.com/phlipper/)\r\n* http://phlippers.net/\r\n\r\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/phlipper/chef-monit/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\r\n","google":"UA-10172882-2","note":"Don't delete this file! It's used internally to help with page regeneration."}
  1 +{"name":"chef-monit","tagline":"Chef cookbook for monit package","body":"[![Build Status](http://img.shields.io/travis-ci/phlipper/chef-monit.png)](http://travis-ci.org/phlipper/chef-monit)\r\n\r\n## Description\r\n\r\nInstalls the `monit` package from (http://mmonit.com/monit/).\r\n\r\n\r\n## Requirements\r\n\r\n### Supported Platforms\r\n\r\nThe following platforms are supported by this cookbook, meaning that the recipes run on these platforms without error:\r\n\r\n* Ubuntu\r\n* Debian\r\n* RedHat\r\n* CentOS\r\n* Scientific\r\n* Fedora\r\n* SUSE\r\n* Amazon\r\n\r\n\r\n## Recipes\r\n\r\n* `monit` - The default recipe. Sets up the service definition and default checks.\r\n\r\n\r\n## Resources\r\n\r\n### `monit_monitrc`\r\n\r\nThe following will create a monitrc configuration:\r\n\r\n```ruby\r\nmonit_monitrc \"ssh\" do\r\n variables({ category: \"system\" })\r\nend\r\n```\r\n\r\nThe `name` parameter must match a file located in your templates directory. In the example above, this would be `ssh.monitrc.erb`.\r\n\r\nThe `variables` option within the block is optional, and can contain a list of key-value pairs to assign within your template.\r\n\r\n\r\n## Usage\r\n\r\nThis cookbook installs the monit components if not present, and pulls updates if they are installed on the system.\r\n\r\n\r\n## Attributes\r\n\r\n```ruby\r\n# Delay the start of polling when the service is started\r\ndefault[\"monit\"][\"start_delay\"] = 0\r\n\r\n# How frequently the monit daemon polls for changes.\r\ndefault[\"monit\"][\"polling_frequency\"] = 20\r\n\r\n# Use syslog for logging instead of a logfile.\r\ndefault[\"monit\"][\"use_syslog\"] = true\r\n\r\n# If not using syslog, the log file that monit will use.\r\ndefault[\"monit\"][\"logfile\"] = \"/var/log/monit.log\"\r\n\r\n# Where Monit stores unique Monit instance id\r\ndefault[\"monit\"][\"idfile\"] = \"/var/.monit.id\"\r\n\r\n# Where Monit stores Monit state file\r\ndefault[\"monit\"][\"statefile\"] = \"/var/lib/monit/state\"\r\n\r\n# Enable emails for internal monit alerts\r\ndefault[\"monit\"][\"mail_alerts\"] = true\r\n\r\n# Ignore alerts for specific events\r\n# 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.\r\ndefault[\"monit\"][\"alert_ignore_events\"] = []\r\n\r\n# Email address that will be notified of events.\r\ndefault[\"monit\"][\"alert_email\"] = \"root@localhost\"\r\n\r\n# Enable the web interface and define credentials.\r\ndefault[\"monit\"][\"web_interface\"] = {\r\n enable: true,\r\n port: 2812,\r\n address: \"localhost\",\r\n allow: [\"localhost\", \"admin:b1gbr0th3r\"]\r\n}\r\n\r\n# Email settings that will be used for notification of events.\r\ndefault[\"monit\"][\"mail\"] = {\r\n hostname: \"localhost\",\r\n port: 25,\r\n username: nil,\r\n password: nil,\r\n encrypted_credentials: nil,\r\n encrypted_credentials_data_bag: \"credentials\",\r\n from: \"monit@$HOST\",\r\n subject: \"$SERVICE $EVENT at $DATE\",\r\n message: \"Monit $ACTION $SERVICE at $DATE on $HOST,\\n\\n$DESCRIPTION\\n\\nDutifully,\\nMonit\",\r\n security: nil, # 'SSLV2'|'SSLV3'|'TLSV1'\r\n timeout: 30\r\n}\r\n\r\ncase node[\"platform_family\"]\r\nwhen \"rhel\", \"fedora\", \"suse\"\r\n default[\"monit\"][\"main_config_path\"] = \"/etc/monit.conf\"\r\n default[\"monit\"][\"includes_dir\"] = \"/etc/monit.d\"\r\nelse\r\n default[\"monit\"][\"main_config_path\"] = \"/etc/monit/monitrc\"\r\n default[\"monit\"][\"includes_dir\"] = \"/etc/monit/conf.d\"\r\nend\r\n\r\n# The monit::default recipe will load these monit_monitrc resources automatically\r\n# NOTE setting this attribute at the default level will append values to the array\r\ndefault[\"monit\"][\"default_monitrc_configs\"] = %w[load ssh]\r\n\r\n# Whether the monit service should be reloaded when a configuration changes\r\ndefault[\"monit\"][\"reload_on_change\"] = true\r\n\r\n# `MONIT_OPTS` for /etc/default/monit\r\ndefault[\"monit\"][\"init_opts\"] = \"\"\r\n\r\n# specify a particular version of the monit package you want installed,\r\n# otherwise it will install the default. this value is ignored when performing a\r\n# source install.\r\ndefault[\"monit\"][\"version\"] = nil\r\n\r\n# source install specifics\r\ndefault[\"monit\"][\"source_install\"] = false\r\n\r\ndefault[\"monit\"][\"source\"][\"version\"] = \"5.7\"\r\ndefault[\"monit\"][\"source\"][\"prefix\"] = \"/usr/local\"\r\ndefault[\"monit\"][\"source\"][\"url\"] = \"https://mmonit.com/monit/dist/monit-5.7.tar.gz\"\r\ndefault[\"monit\"][\"source\"][\"checksum\"] = \"bb250ab011d805b5693972afdf95509e79bb3b390caa763275c9501f74b598a2\"\r\ndefault[\"monit\"][\"source\"][\"pam_support\"] = true\r\ndefault[\"monit\"][\"source\"][\"ssl_support\"] = true\r\ndefault[\"monit\"][\"source\"][\"large_file_support\"] = true\r\ndefault[\"monit\"][\"source\"][\"compiler_optimized\"] = true\r\n```\r\n\r\n## Contributors\r\n\r\nMany thanks go to the following [contributors](https://github.com/phlipper/chef-monit/graphs/contributors) who have helped to make this cookbook even better:\r\n\r\n* **[@werdan](https://github.com/werdan)**\r\n * add support for redhat-flavored systems\r\n* **[@auser](https://github.com/auser)**\r\n * add missing metadata\r\n* **[@arrowcircle](https://github.com/arrowcircle)**\r\n * update syntax to be Ruby 1.8-compatible\r\n* **[@dwradcliffe](https://github.com/dwradcliffe)**\r\n * typo fix for README\r\n * fix logging logic\r\n * whyrun support for monitrc provider\r\n * support for reloading monit without restart\r\n * don't render 'use address' if no address is provided\r\n * fix attribute comments\r\n* **[@tjwallace](https://github.com/tjwallace)**\r\n * load default monitrc configs from an attribute\r\n* **[@tomdz](https://github.com/tomdz)**\r\n * Ruby 1.8.x compatibility fix\r\n * add support for templates in different cookbooks\r\n* **[@alexism](https://github.com/alexism)**\r\n * support other security protocols\r\n* **[@fixlr](https://github.com/fixlr)**\r\n * add `mail_alerts` attribute\r\n* **[@darron](https://github.com/darron)**\r\n * add descriptions to email notifications\r\n* **[@claco](https://github.com/claco)**\r\n * add startup delay option to monit daemon config\r\n * restart on default monitrc configs change\r\n * restart monit service if the monit config changes\r\n * fix platform family logic\r\n* **[@maciejgalkiewicz](https://github.com/maciejgalkiewicz)**\r\n * fix logging logic\r\n* **[@pauloricardomg](https://github.com/pauloricardomg)**\r\n * add `alert_ignore_events` attribute\r\n * add `reload_on_change` attribute\r\n* **[@drywheat](https://github.com/drywheat)**\r\n * support encrypted data bag for smtp credentials\r\n * add support for installation from source vs. package\r\n* **[@esigler](https://github.com/esigler)**\r\n * allow either style of monit startup flag to work\r\n* **[@evan2645](https://github.com/evan2645)**\r\n * fix bug in which monit is not started during bootstrap\r\n* **[@mvdkleijn](https://github.com/mvdkleijn)**\r\n * add settings for idfile and statefile\r\n* **[@mbanton](https://github.com/mbanton)**\r\n * fix `statefile` attribute in `monitrc` template\r\n* **[@foxycoder](https://github.com/foxycoder)**\r\n * add support for binary install\r\n* **[@ijin](https://github.com/ijin)**\r\n * add `using_hostname` attribute\r\n * better ssh support for Amazon Linux\r\n\r\n\r\n## Contributing\r\n\r\n1. Fork it\r\n2. Create your feature branch (`git checkout -b my-new-feature`)\r\n3. Commit your changes (`git commit -am 'Added some feature'`)\r\n4. Push to the branch (`git push origin my-new-feature`)\r\n5. Create new Pull Request\r\n\r\n\r\n## License\r\n\r\n**chef-monit**\r\n\r\n* Freely distributable and licensed under the [MIT license](http://phlipper.mit-license.org/2011-2014/license.html).\r\n* Copyright (c) 2011-2014 Phil Cohen (github@phlippers.net) [![endorse](http://api.coderwall.com/phlipper/endorsecount.png)](http://coderwall.com/phlipper) [![Gittip](http://img.shields.io/gittip/phlipper.png)](https://www.gittip.com/phlipper/)\r\n* http://phlippers.net/\r\n\r\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/phlipper/chef-monit/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\r\n","google":"UA-10172882-2","note":"Don't delete this file! It's used internally to help with page regeneration."}

0 comments on commit cb96366

Please sign in to comment.
Something went wrong with that request. Please try again.