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
|
Requirements
|
||||||
------------
|
------------
|
||||||
The cookbook only requires access to the mon-notification package.
|
The cookbook only requires access to the monasca-notification package.
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
----------
|
----------
|
||||||
#### mon_notification::default
|
#### monasca_notification::default
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Key</th>
|
<th>Key</th>
|
||||||
@ -17,42 +17,42 @@ Attributes
|
|||||||
<th>Default</th>
|
<th>Default</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>[:mon_notification][:user]</tt></td>
|
<td><tt>[:monasca_notification][:user]</tt></td>
|
||||||
<td>String</td>
|
<td>String</td>
|
||||||
<td>System user for the daemon</td>
|
<td>System user for the daemon</td>
|
||||||
<td><tt>mon-notification</tt></td>
|
<td><tt>monasca-notification</tt></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>[:mon_notification][:group]</tt></td>
|
<td><tt>[:monasca_notification][:group]</tt></td>
|
||||||
<td>String</td>
|
<td>String</td>
|
||||||
<td>System group for the daemon</td>
|
<td>System group for the daemon</td>
|
||||||
<td><tt>mon-notification</tt></td>
|
<td><tt>monasca-notification</tt></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>[:mon_notification][:conf_dir]</tt></td>
|
<td><tt>[:monasca_notification][:conf_dir]</tt></td>
|
||||||
<td>String</td>
|
<td>String</td>
|
||||||
<td>Configuration Directory</td>
|
<td>Configuration Directory</td>
|
||||||
<td><tt>/etc/mon</tt></td>
|
<td><tt>/etc/monasca</tt></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>[:mon_notification][:data_bag]</tt></td>
|
<td><tt>[:monasca_notification][:data_bag]</tt></td>
|
||||||
<td>String</td>
|
<td>String</td>
|
||||||
<td>Configuration data bag</td>
|
<td>Configuration data bag</td>
|
||||||
<td><tt>mon_notification</tt></td>
|
<td><tt>monasca_notification</tt></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><tt>[:mon_notification][:log_dir]</tt></td>
|
<td><tt>[:monasca_notification][:log_dir]</tt></td>
|
||||||
<td>String</td>
|
<td>String</td>
|
||||||
<td>Daemon log directory</td>
|
<td>Daemon log directory</td>
|
||||||
<td><tt>/var/log/mon-notification</tt></td>
|
<td><tt>/var/log/monasca-notification</tt></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
Data Bags
|
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
|
for the host names and auth infomation to connect to the services: kafka, mysql, smtp and zookeeper
|
||||||
|
|
||||||
Usage
|
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
|
# encoding: UTF-8
|
||||||
# Logs to backup
|
# Logs to backup
|
||||||
node.default[:mon_log_backup][:logs][:mon_notification] =
|
node.default[:mon_log_backup][:logs][:monasca_notification] =
|
||||||
['/var/log/mon-notification/notification.log']
|
['/var/log/monasca/notification.log']
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# encoding: UTF-8
|
# encoding: UTF-8
|
||||||
#
|
#
|
||||||
default[:mon_notification][:user] = 'mon-notification'
|
default[:monasca_notification][:user] = 'monasca-notification'
|
||||||
default[:mon_notification][:group] = 'mon-notification'
|
default[:monasca_notification][:group] = 'monasca-notification'
|
||||||
default[:mon_notification][:conf_dir] = '/etc/mon'
|
default[:monasca_notification][:conf_dir] = '/etc/monasca'
|
||||||
default[:mon_notification][:log_dir] = '/var/log/mon-notification'
|
default[:monasca_notification][:log_dir] = '/var/log/monasca'
|
||||||
default[:mon_notification][:data_bag] = 'mon_notification'
|
default[:monasca_notification][:data_bag] = 'monasca_notification'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# encoding: UTF-8
|
# encoding: UTF-8
|
||||||
# Have ossec watch the log
|
# Have ossec watch the log
|
||||||
node.default[:ossec][:watched][:mon_notification] = {
|
node.default[:ossec][:watched][:monasca_notification] = {
|
||||||
'/var/log/mon-notification/notification.log' => :syslog
|
'/var/log/monasca/notification.log' => :syslog
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# encoding: UTF-8
|
# encoding: UTF-8
|
||||||
#
|
#
|
||||||
name 'mon_notification'
|
name 'monasca_notification'
|
||||||
maintainer 'HP Monitoring'
|
maintainer 'HP Monitoring'
|
||||||
maintainer_email 'hpcs-mon@hp.com'
|
maintainer_email 'hpcs-mon@hp.com'
|
||||||
license 'All rights reserved'
|
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'))
|
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||||
version '0.1.15'
|
version '0.1.16'
|
||||||
depends 'python'
|
depends 'python'
|
||||||
|
@ -9,56 +9,56 @@ include_recipe 'python'
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
python_pip 'mon-notification' do
|
python_pip 'monasca-notification' do
|
||||||
action :install
|
action :install
|
||||||
end
|
end
|
||||||
|
|
||||||
group node[:mon_notification][:group] do
|
group node[:monasca_notification][:group] do
|
||||||
action :create
|
action :create
|
||||||
end
|
end
|
||||||
user node[:mon_notification][:user] do
|
user node[:monasca_notification][:user] do
|
||||||
action :create
|
action :create
|
||||||
system true
|
system true
|
||||||
gid node[:mon_notification][:group]
|
gid node[:monasca_notification][:group]
|
||||||
end
|
end
|
||||||
|
|
||||||
template '/etc/init/mon-notification.conf' do
|
template '/etc/init/monasca-notification.conf' do
|
||||||
action :create
|
action :create
|
||||||
source 'mon-notification.conf.erb'
|
source 'monasca-notification.conf.erb'
|
||||||
owner 'root'
|
owner 'root'
|
||||||
group 'root'
|
group 'root'
|
||||||
mode 0644
|
mode 0644
|
||||||
end
|
end
|
||||||
|
|
||||||
service 'mon-notification' do
|
service 'monasca-notification' do
|
||||||
action :enable
|
action :enable
|
||||||
provider Chef::Provider::Service::Upstart
|
provider Chef::Provider::Service::Upstart
|
||||||
end
|
end
|
||||||
|
|
||||||
directory node[:mon_notification][:conf_dir] do
|
directory node[:monasca_notification][:conf_dir] do
|
||||||
action :create
|
action :create
|
||||||
owner 'root'
|
owner 'root'
|
||||||
group 'root'
|
group 'root'
|
||||||
mode 0755
|
mode 0755
|
||||||
end
|
end
|
||||||
|
|
||||||
directory node[:mon_notification][:log_dir] do
|
directory node[:monasca_notification][:log_dir] do
|
||||||
action :create
|
action :create
|
||||||
owner node[:mon_notification][:user]
|
owner node[:monasca_notification][:user]
|
||||||
group node[:mon_notification][:group]
|
group node[:monasca_notification][:group]
|
||||||
mode 0775
|
mode 0775
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: setup an encrypted data bag for credentials
|
# TODO: setup an encrypted data bag for credentials
|
||||||
hosts = data_bag_item(node[:mon_notification][:data_bag], 'hosts')
|
hosts = data_bag_item(node[:monasca_notification][:data_bag], 'hosts')
|
||||||
template "#{node[:mon_notification][:conf_dir]}/notification.yaml" do
|
template "#{node[:monasca_notification][:conf_dir]}/notification.yaml" do
|
||||||
action :create
|
action :create
|
||||||
source 'notification.yaml.erb'
|
source 'notification.yaml.erb'
|
||||||
owner 'root'
|
owner 'root'
|
||||||
group node[:mon_notification][:group]
|
group node[:monasca_notification][:group]
|
||||||
mode 0640
|
mode 0640
|
||||||
variables(
|
variables(
|
||||||
hosts: hosts
|
hosts: hosts
|
||||||
)
|
)
|
||||||
notifies :restart, 'service[mon-notification]'
|
notifies :restart, 'service[monasca-notification]'
|
||||||
end
|
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:
|
kafka:
|
||||||
url: <%= @hosts['kafka']['url'] %>
|
url: <%= @hosts['kafka']['url'] %>
|
||||||
group: <%= node[:mon_notification][:group] %>
|
group: <%= node[:monasca_notification][:group] %>
|
||||||
alarm_topic: <%= @hosts['kafka']['alarm_topic'] %>
|
alarm_topic: <%= @hosts['kafka']['alarm_topic'] %>
|
||||||
notification_topic: <%= @hosts['kafka']['notification_topic'] %>
|
notification_topic: <%= @hosts['kafka']['notification_topic'] %>
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ logging: # Used in logging.dictConfig
|
|||||||
formatter: default
|
formatter: default
|
||||||
file:
|
file:
|
||||||
class: logging.handlers.RotatingFileHandler
|
class: logging.handlers.RotatingFileHandler
|
||||||
filename: <%= node[:mon_notification][:log_dir] %>/notification.log
|
filename: <%= node[:monasca_notification][:log_dir] %>/notification.log
|
||||||
formatter: default
|
formatter: default
|
||||||
maxBytes: 10485760 # Rotate at file size ~10MB
|
maxBytes: 10485760 # Rotate at file size ~10MB
|
||||||
backupCount: 5 # Keep 5 older logs around
|
backupCount: 5 # Keep 5 older logs around
|
||||||
|
Loading…
x
Reference in New Issue
Block a user