diff --git a/README.md b/README.md
index 322c17b..494b3ff 100644
--- a/README.md
+++ b/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
Key |
@@ -17,42 +17,42 @@ Attributes
Default |
- [:mon_notification][:user] |
+ [:monasca_notification][:user] |
String |
System user for the daemon |
- mon-notification |
+ monasca-notification |
- [:mon_notification][:group] |
+ [:monasca_notification][:group] |
String |
System group for the daemon |
- mon-notification |
+ monasca-notification |
- [:mon_notification][:conf_dir] |
+ [:monasca_notification][:conf_dir] |
String |
Configuration Directory |
- /etc/mon |
+ /etc/monasca |
- [:mon_notification][:data_bag] |
+ [:monasca_notification][:data_bag] |
String |
Configuration data bag |
- mon_notification |
+ monasca_notification |
- [:mon_notification][:log_dir] |
+ [:monasca_notification][:log_dir] |
String |
Daemon log directory |
- /var/log/mon-notification |
+ /var/log/monasca-notification |
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.
diff --git a/attributes/backup.rb b/attributes/backup.rb
index a0321a2..bfa8caf 100644
--- a/attributes/backup.rb
+++ b/attributes/backup.rb
@@ -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']
diff --git a/attributes/default.rb b/attributes/default.rb
index a563421..2a31b1f 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -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'
diff --git a/attributes/monitor.rb b/attributes/monitor.rb
index 3f401ec..6b5b23f 100644
--- a/attributes/monitor.rb
+++ b/attributes/monitor.rb
@@ -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
}
diff --git a/metadata.rb b/metadata.rb
index 0b376ef..fcd03ac 100644
--- a/metadata.rb
+++ b/metadata.rb
@@ -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'
diff --git a/recipes/default.rb b/recipes/default.rb
index 3de8501..a8982c6 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -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
diff --git a/templates/default/mon-notification.conf.erb b/templates/default/mon-notification.conf.erb
deleted file mode 100644
index 37d896d..0000000
--- a/templates/default/mon-notification.conf.erb
+++ /dev/null
@@ -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
diff --git a/templates/default/monasca-notification.conf.erb b/templates/default/monasca-notification.conf.erb
new file mode 100644
index 0000000..e885ff2
--- /dev/null
+++ b/templates/default/monasca-notification.conf.erb
@@ -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
diff --git a/templates/default/notification.yaml.erb b/templates/default/notification.yaml.erb
index 4751b82..a5a07cf 100644
--- a/templates/default/notification.yaml.erb
+++ b/templates/default/notification.yaml.erb
@@ -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