Rename to monasca and Added gitreview
Change-Id: I786b73550007cfb30fee003a44ee0f9b03bbdb4e
This commit is contained in:
parent
5ce5e04f51
commit
2dd0803846
32
README.md
32
README.md
@ -1,14 +1,14 @@
|
||||
mon_notification Cookbook
|
||||
monasca_notification Cookbook
|
||||
=========================
|
||||
Sets up the mon-notification daemon
|
||||
Sets up the monasca-notification daemon
|
||||
|
||||
Requirements
|
||||
------------
|
||||
The cookbook only requires access to the mon-notification package.
|
||||
The cookbook only requires access to the monasca-notification package.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
#### mon_notification::default
|
||||
#### monasca_notification::default
|
||||
<table>
|
||||
<tr>
|
||||
<th>Key</th>
|
||||
@ -17,42 +17,42 @@ Attributes
|
||||
<th>Default</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>[:mon_notification][:user]</tt></td>
|
||||
<td><tt>[:monasca_notification][:user]</tt></td>
|
||||
<td>String</td>
|
||||
<td>System user for the daemon</td>
|
||||
<td><tt>mon-notification</tt></td>
|
||||
<td><tt>monasca-notification</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>[:mon_notification][:group]</tt></td>
|
||||
<td><tt>[:monasca_notification][:group]</tt></td>
|
||||
<td>String</td>
|
||||
<td>System group for the daemon</td>
|
||||
<td><tt>mon-notification</tt></td>
|
||||
<td><tt>monasca-notification</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>[:mon_notification][:conf_dir]</tt></td>
|
||||
<td><tt>[:monasca_notification][:conf_dir]</tt></td>
|
||||
<td>String</td>
|
||||
<td>Configuration Directory</td>
|
||||
<td><tt>/etc/mon</tt></td>
|
||||
<td><tt>/etc/monasca</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>[:mon_notification][:data_bag]</tt></td>
|
||||
<td><tt>[:monasca_notification][:data_bag]</tt></td>
|
||||
<td>String</td>
|
||||
<td>Configuration data bag</td>
|
||||
<td><tt>mon_notification</tt></td>
|
||||
<td><tt>monasca_notification</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>[:mon_notification][:log_dir]</tt></td>
|
||||
<td><tt>[:monasca_notification][:log_dir]</tt></td>
|
||||
<td>String</td>
|
||||
<td>Daemon log directory</td>
|
||||
<td><tt>/var/log/mon-notification</tt></td>
|
||||
<td><tt>/var/log/monasca-notification</tt></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Data Bags
|
||||
---------
|
||||
A data bag item named hosts in node[:mon_notification][:data_bag] is required for running. It simply has 4 dictionary items
|
||||
A data bag item named hosts in node[:monasca_notification][:data_bag] is required for running. It simply has 4 dictionary items
|
||||
for the host names and auth infomation to connect to the services: kafka, mysql, smtp and zookeeper
|
||||
|
||||
Usage
|
||||
-----
|
||||
Simply include the mon_notification default recipe in a role.
|
||||
Simply include the monasca_notification default recipe in a role.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# encoding: UTF-8
|
||||
# Logs to backup
|
||||
node.default[:mon_log_backup][:logs][:mon_notification] =
|
||||
['/var/log/mon-notification/notification.log']
|
||||
node.default[:mon_log_backup][:logs][:monasca_notification] =
|
||||
['/var/log/monasca/notification.log']
|
||||
|
@ -1,7 +1,7 @@
|
||||
# encoding: UTF-8
|
||||
#
|
||||
default[:mon_notification][:user] = 'mon-notification'
|
||||
default[:mon_notification][:group] = 'mon-notification'
|
||||
default[:mon_notification][:conf_dir] = '/etc/mon'
|
||||
default[:mon_notification][:log_dir] = '/var/log/mon-notification'
|
||||
default[:mon_notification][:data_bag] = 'mon_notification'
|
||||
default[:monasca_notification][:user] = 'monasca-notification'
|
||||
default[:monasca_notification][:group] = 'monasca-notification'
|
||||
default[:monasca_notification][:conf_dir] = '/etc/monasca'
|
||||
default[:monasca_notification][:log_dir] = '/var/log/monasca'
|
||||
default[:monasca_notification][:data_bag] = 'monasca_notification'
|
||||
|
@ -1,5 +1,5 @@
|
||||
# encoding: UTF-8
|
||||
# Have ossec watch the log
|
||||
node.default[:ossec][:watched][:mon_notification] = {
|
||||
'/var/log/mon-notification/notification.log' => :syslog
|
||||
node.default[:ossec][:watched][:monasca_notification] = {
|
||||
'/var/log/monasca/notification.log' => :syslog
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
# encoding: UTF-8
|
||||
#
|
||||
name 'mon_notification'
|
||||
name 'monasca_notification'
|
||||
maintainer 'HP Monitoring'
|
||||
maintainer_email 'hpcs-mon@hp.com'
|
||||
license 'All rights reserved'
|
||||
description 'Installs/Configures mon_notification'
|
||||
description 'Installs/Configures monasca_notification'
|
||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||
version '0.1.15'
|
||||
version '0.1.16'
|
||||
depends 'python'
|
||||
|
@ -9,56 +9,56 @@ include_recipe 'python'
|
||||
end
|
||||
end
|
||||
|
||||
python_pip 'mon-notification' do
|
||||
python_pip 'monasca-notification' do
|
||||
action :install
|
||||
end
|
||||
|
||||
group node[:mon_notification][:group] do
|
||||
group node[:monasca_notification][:group] do
|
||||
action :create
|
||||
end
|
||||
user node[:mon_notification][:user] do
|
||||
user node[:monasca_notification][:user] do
|
||||
action :create
|
||||
system true
|
||||
gid node[:mon_notification][:group]
|
||||
gid node[:monasca_notification][:group]
|
||||
end
|
||||
|
||||
template '/etc/init/mon-notification.conf' do
|
||||
template '/etc/init/monasca-notification.conf' do
|
||||
action :create
|
||||
source 'mon-notification.conf.erb'
|
||||
source 'monasca-notification.conf.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 0644
|
||||
end
|
||||
|
||||
service 'mon-notification' do
|
||||
service 'monasca-notification' do
|
||||
action :enable
|
||||
provider Chef::Provider::Service::Upstart
|
||||
end
|
||||
|
||||
directory node[:mon_notification][:conf_dir] do
|
||||
directory node[:monasca_notification][:conf_dir] do
|
||||
action :create
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode 0755
|
||||
end
|
||||
|
||||
directory node[:mon_notification][:log_dir] do
|
||||
directory node[:monasca_notification][:log_dir] do
|
||||
action :create
|
||||
owner node[:mon_notification][:user]
|
||||
group node[:mon_notification][:group]
|
||||
owner node[:monasca_notification][:user]
|
||||
group node[:monasca_notification][:group]
|
||||
mode 0775
|
||||
end
|
||||
|
||||
# TODO: setup an encrypted data bag for credentials
|
||||
hosts = data_bag_item(node[:mon_notification][:data_bag], 'hosts')
|
||||
template "#{node[:mon_notification][:conf_dir]}/notification.yaml" do
|
||||
hosts = data_bag_item(node[:monasca_notification][:data_bag], 'hosts')
|
||||
template "#{node[:monasca_notification][:conf_dir]}/notification.yaml" do
|
||||
action :create
|
||||
source 'notification.yaml.erb'
|
||||
owner 'root'
|
||||
group node[:mon_notification][:group]
|
||||
group node[:monasca_notification][:group]
|
||||
mode 0640
|
||||
variables(
|
||||
hosts: hosts
|
||||
)
|
||||
notifies :restart, 'service[mon-notification]'
|
||||
notifies :restart, 'service[monasca-notification]'
|
||||
end
|
||||
|
@ -1,13 +0,0 @@
|
||||
# Startup script for the mon_notification
|
||||
|
||||
description "Mon Notification daemon"
|
||||
start on runlevel [2345]
|
||||
|
||||
console log
|
||||
respawn
|
||||
|
||||
kill timeout 240
|
||||
|
||||
setgid <%= node[:mon_notification][:group] %>
|
||||
setuid <%= node[:mon_notification][:user] %>
|
||||
exec /usr/local/bin/mon-notification
|
13
templates/default/monasca-notification.conf.erb
Normal file
13
templates/default/monasca-notification.conf.erb
Normal file
@ -0,0 +1,13 @@
|
||||
# Startup script for the monasca_notification
|
||||
|
||||
description "Monasca Notification daemon"
|
||||
start on runlevel [2345]
|
||||
|
||||
console log
|
||||
respawn
|
||||
|
||||
kill timeout 240
|
||||
|
||||
setgid <%= node[:monasca_notification][:group] %>
|
||||
setuid <%= node[:monasca_notification][:user] %>
|
||||
exec /usr/local/bin/monasca-notification
|
@ -1,6 +1,6 @@
|
||||
kafka:
|
||||
url: <%= @hosts['kafka']['url'] %>
|
||||
group: <%= node[:mon_notification][:group] %>
|
||||
group: <%= node[:monasca_notification][:group] %>
|
||||
alarm_topic: <%= @hosts['kafka']['alarm_topic'] %>
|
||||
notification_topic: <%= @hosts['kafka']['notification_topic'] %>
|
||||
|
||||
@ -47,7 +47,7 @@ logging: # Used in logging.dictConfig
|
||||
formatter: default
|
||||
file:
|
||||
class: logging.handlers.RotatingFileHandler
|
||||
filename: <%= node[:mon_notification][:log_dir] %>/notification.log
|
||||
filename: <%= node[:monasca_notification][:log_dir] %>/notification.log
|
||||
formatter: default
|
||||
maxBytes: 10485760 # Rotate at file size ~10MB
|
||||
backupCount: 5 # Keep 5 older logs around
|
||||
|
Loading…
Reference in New Issue
Block a user