Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
foodcritic updates
  • Loading branch information
phlipper committed Dec 27, 2012
1 parent 27876c8 commit f18d9ea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions templates/default/load.monitrc.erb
@@ -1,7 +1,7 @@
check system <%= node[:host] %>
check system <%= node["fqdn"] %>
if loadavg (1min) > 4 for 2 cycles then alert
if loadavg (5min) > 2 for 2 cycles then alert
if memory usage > 75% for 2 cycles then alert
if cpu usage (user) > 70% for 2 cycles then alert
if cpu usage (system) > 30% for 2 cycles then alert
if cpu usage (wait) > 20% for 2 cycles then alert
if cpu usage (wait) > 20% for 2 cycles then alert
36 changes: 18 additions & 18 deletions templates/default/monitrc.erb
@@ -1,38 +1,38 @@
# Polling frequency
set daemon <%= node[:monit][:polling_frequency] %>
set daemon <%= node["monit"]["polling_frequency"] %>

# Logging
<% if node[:monit][:syslog] == "true" %>
<% if node["monit"]["syslog"] == "true" %>
set logfile syslog facility log_daemon
<% else %>
set logfile <%= node[:monit][:logfile] %>
set logfile <%= node["monit"]["logfile"] %>
<% end %>

# Mail alerts
set alert <%= node[:monit][:alert_email] %>
set mailserver <%= node[:monit][:mail][:hostname] %> port <%= node[:monit][:mail][:port] %>
<% if node[:monit][:mail][:username] -%>
username "<%= node[:monit][:mail][:username] %>"
set alert <%= node["monit"]["alert_email"] %>
set mailserver <%= node["monit"]["mail"]["hostname"] %> port <%= node["monit"]["mail"]["port"] %>
<% if node["monit"]["mail"]["username"] -%>
username "<%= node["monit"]["mail"]["username"] %>"
<% end -%>
<% if node[:monit][:mail][:password] -%>
password "<%= node[:monit][:mail][:password] %>"
<% if node["monit"]["mail"]["password"] -%>
password "<%= node["monit"]["mail"]["password"] %>"
<% end -%>
<% if node[:monit][:mail][:tls] -%>
<% if node["monit"]["mail"]["tls"] -%>
using tlsv1
<% end -%>
with timeout <%= node[:monit][:mail][:timeout] %> seconds
with timeout <%= node["monit"]["mail"]["timeout"] %> seconds

set mail-format {
from: <%= node[:monit][:mail][:from] %>
subject: <%= node[:monit][:mail][:subject] %>
message: <%= node[:monit][:mail][:message] %>
from: <%= node["monit"]["mail"]["from"] %>
subject: <%= node["monit"]["mail"]["subject"] %>
message: <%= node["monit"]["mail"]["message"] %>
}

<% if node[:monit][:web_interface][:enable] %>
<% if node["monit"]["web_interface"]["enable"] %>
# Web interface
set httpd port <%= node[:monit][:web_interface][:port] %> and
use address <%= node[:monit][:web_interface][:address] %>
<% node[:monit][:web_interface][:allow].each do |allow| -%>
set httpd port <%= node["monit"]["web_interface"]["port"] %> and
use address <%= node["monit"]["web_interface"]["address"] %>
<% node["monit"]["web_interface"]["allow"].each do |allow| -%>
allow <%= allow %>
<% end %>
<% end %>
Expand Down

0 comments on commit f18d9ea

Please sign in to comment.